A method for verifying fabric complex endorsement strategy in cross-chain

By registering the MSP list, chaincode ID, and endorsement policy expression of the Fabric blockchain in the cross-chain network, an endorsement policy interpreter is generated, solving the verification problem of complex endorsement policies in cross-chain transactions and achieving efficient and secure cross-chain transaction verification.

CN116582272BActive Publication Date: 2026-05-29HANGZHOU QULIAN TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU QULIAN TECHNOLOGY CO LTD
Filing Date
2020-04-21
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing technologies cannot effectively verify the complex endorsement strategies of the Fabric blockchain in cross-chain transactions, resulting in high complexity in cross-chain transaction verification and failing to meet practical needs.

Method used

By registering the MSP list, chaincode ID, and endorsement policy expression of the Fabric blockchain in the cross-chain network, an endorsement policy interpreter is generated to parse transaction information and perform semantic analysis to verify whether the transaction signature set meets the endorsement policy requirements.

Benefits of technology

It enables effective verification of the complex endorsement strategy of the Fabric blockchain, reduces verification complexity, improves the reliability and security of cross-chain transactions, and prevents malicious attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116582272B_ABST
    Figure CN116582272B_ABST
Patent Text Reader

Abstract

The application discloses a method for verifying a Fabric complex endorsement strategy in cross-chain, wherein the Fabric blockchain first registers an MSP list, a chain code ID and an endorsement strategy description into a cross-chain network, transmits a generated cross-chain transaction to a relay chain, then the relay chain analyzes a transaction execution result and a set of endorsement node signatures, generates an endorsement strategy interpreter, and confirms that the transaction execution result is consistent with the chain code ID registered in the cross-chain network, and if not, the verification fails, and finally the endorsement strategy interpreter verifies the set of signatures. The application can verify a complex endorsement strategy customized by a user, is friendly to a user of the Fabric network, does not need to write a verification strategy by itself, and only needs to submit an endorsement strategy description, and can prevent a user from performing malicious attacks through different chain codes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of blockchain technology, and in particular relates to a method for verifying complex Fabric endorsement strategies across chains. Background Technology

[0002] Cross-chain technology refers to achieving cross-chain interoperability of ledgers by connecting relatively independent blockchain systems. In terms of asset exchange, some blockchains are still largely isolated from each other, with extremely high barriers to interoperability between various blockchain applications, and verifying transactions during asset exchange presents a significant challenge.

[0003] Verifying cross-chain transactions generated by the Fabric blockchain is particularly challenging. Fabric requires designated endorsing nodes to endorse transactions. These endorsing nodes are sets of multiple nodes, and users can customize the endorsement strategy for this set. For example, they can specify which nodes must endorse the transaction, or only certain nodes from a set can endorse it. For instance, if there are endorsing nodes A, B, C, and D in the Fabric blockchain, a user can define that a transaction is successfully endorsed if any node successfully endorses it, or they can specify that both nodes A and B must endorse the transaction for it to be successful. However, while this customization provides flexibility in the blockchain's endorsement requirements, it creates a significant obstacle in writing verification rules for the endorsement information of transactions generated by Fabric in cross-chain transactions. Writing a corresponding verification rule for each strategy would be a considerable expense in terms of both workload and complexity.

[0004] Typical cross-chain verification cannot verify complex endorsement policies; it can only verify simple ones, such as transactions signed by a single node or a fixed set of nodes. Generally, for the default Fabric network, the endorsement policy is that a transaction is considered valid as long as any node in the endorsement node pool endorses it. Therefore, a simple endorsement policy only requires storing the certificates of all endorsing nodes in the cross-chain network, and verification simply involves iterating through these certificates. However, complex endorsement policies cannot be handled by simple iteration, and this completely fails to meet the cross-chain requirements of complex endorsement policies in real-world Fabric environments. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of existing technologies by providing a method for verifying complex Fabric endorsement strategies across chains.

[0006] The objective of this invention is achieved through the following technical solution: a method for verifying complex Fabric endorsement strategies across chains, comprising the following steps:

[0007] (1) The Fabric blockchain registers all MSP lists, chaincode IDs and endorsement policy expressions in the blockchain network to the cross-chain network;

[0008] (2) When a cross-chain transaction is generated on the Fabric blockchain, the transaction information that has already been recorded on the chain is transmitted to the relay chain of the cross-chain network. The relay chain endorses and verifies the transaction information, including the following sub-steps:

[0009] (2.1) The relay chain parses the execution result of the transaction proposal and the signature set of the endorser nodes on the execution result of the transaction proposal from the transaction information;

[0010] (2.2) First, perform semantic analysis on the expression of the endorsement policy registered in the cross-chain network in step (1) and split it into a logical syntax tree. Then, map the logical syntax tree with the MSP list passed into the cross-chain network in step (1) to generate an endorsement policy interpreter.

[0011] (2.3) The relay chain compares the chaincode ID in the execution result of the transaction proposal obtained in step (2.1) with the chaincode ID registered by Fabric in the cross-chain network in step (1) to confirm that the chaincode IDs are consistent. If they are inconsistent, the verification fails.

[0012] (2.4) The signature set of the execution results of the endorsement node for the transaction proposal obtained in step (2.1) is put into the endorsement strategy interpreter generated in step (2.2). The endorsement strategy interpreter checks whether the number of signatures in the signature set meets the expression of the endorsement strategy passed in step (1), determines whether the logic of the signature set meets the logic syntax tree, and extracts the certificates required by the endorsement strategy from the MSP list linked to the logic syntax tree in step (2.2), and verifies the signature set. If the signatures in the signature set meet the requirements of the endorsement strategy interpreter and the verification is successful, the verification is successful; otherwise, the verification fails.

[0013] Further, step (2.2) specifically involves: using an abstract syntax tree to perform semantic analysis on the expression of the endorsement policy registered in the cross-chain network by the Fabric blockchain in step (1) and transform it into a tree-like data structure to obtain a logical syntax tree. Then, the logical syntax tree is mapped to the MSP list passed into the cross-chain network in step (1) to generate an endorsement policy interpreter.

[0014] Furthermore, when the endorsement policy in the Fabric blockchain is updated, the expression of the endorsement policy is synchronously updated to the cross-chain network, and a new endorsement policy interpreter is generated for each transaction verification.

[0015] The beneficial effects of this invention are as follows: In this invention, the Fabric blockchain first registers the MSP list, chaincode ID, and endorsement policy description into the cross-chain network, transmits the generated cross-chain transactions to the relay chain, then the relay chain parses the transaction execution result and the endorsement node signature set, generates an endorsement policy interpreter, and confirms that the transaction execution result is consistent with the chaincode ID registered in the cross-chain network. Finally, the endorsement policy interpreter verifies the signature set. This invention has the following characteristics:

[0016] 1. This invention can verify complex endorsement strategies defined by the user;

[0017] 2. This invention is user-friendly for Fabric network users, eliminating the need to write verification policies; only an endorsement policy description needs to be submitted.

[0018] 3. This invention can prevent users from launching malicious attacks through different chaincodes. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 A diagram illustrating the registration phase for Fabric to be registered with the cross-chain network;

[0021] Figure 2 Flowchart for validating complex validation rules in Fabric. Detailed Implementation

[0022] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0023] This invention provides a method for verifying complex Fabric endorsement strategies across blockchains, comprising the following steps:

[0024] (1) As Figure 1 As shown, during the registration phase of the Fabric blockchain to the cross-chain network, the Fabric blockchain registers the list of MSPs of all institutions in the blockchain network, the chaincode ID used to send cross-chain transactions, and the endorsement policy description together with the cross-chain network.

[0025] Specifically, Fabric's MSP list needs to include the MSP lists of all institutions in the Fabric blockchain network. When generating an endorsement policy, multiple institutions' MSP lists need to be combined, rather than using only a single institution's MSP list as the input source for the endorsement policy.

[0026] (2) Figure 2 As shown, when a cross-chain transaction is generated on the Fabric blockchain, the transaction information that has already been recorded on the chain is transmitted to the relay chain of the cross-chain network. The relay chain endorses and verifies the transaction information, including the following sub-steps:

[0027] (2.1) The relay chain parses the execution result of the transaction proposal and the signature set of the endorser node on the execution result of the transaction proposal from the transaction information.

[0028] (2.2) Compile the endorsement policy description registered in the cross-chain network in step (1) of Fabric blockchain, and generate an endorsement policy interpreter in combination with the MSP list registered in the cross-chain network. Specifically, first perform semantic analysis on the endorsement policy description and split it into a logical syntax tree, such as using an abstract syntax tree (AST) to transform the endorsement policy expression into a tree data structure, and then link the logical syntax tree with the MSP list passed to the cross-chain network in step (1).

[0029] It should be noted that when the endorsement policy in the Fabric blockchain is updated, the endorsement policy is synchronously updated in the cross-chain network. The verification method in this invention generates a new endorsement policy interpreter for each transaction verification, rather than permanently generating a cached interpreter for a specific Fabric blockchain. Therefore, updates to the endorsement policy will not affect updates to the verification method.

[0030] (2.3) The relay chain compares the chaincode ID in the execution result of the transaction proposal with the chaincode ID registered in the cross-chain network by Fabric in step (1) to confirm that the chaincode IDs are consistent. If they are inconsistent, the verification fails.

[0031] To prevent malicious attacks, when verifying transactions sent by Fabric, the chaincode ID needs to be verified. This prevents malicious attackers from constructing fake transactions using different chaincodes to achieve their malicious purposes. Therefore, when parsing transaction information passed to the cross-chain network, the chaincode ID needs to be extracted first. The extracted ID is then compared with the chaincode IDs pre-registered in the cross-chain network. Only if the IDs match can it be confirmed that the transaction was indeed generated by the corresponding chaincode, and MSP identity authentication can proceed.

[0032] (2.4) The signature set of the execution result of the endorsement node on the transaction proposal obtained in step (2.1) is put into the endorsement strategy interpreter generated in step (2.2). The endorsement strategy interpreter verifies it through the logical syntax tree obtained in step (2.2). Specifically, it checks whether the number of signatures in the signature set meets the endorsement strategy description passed in step (1), determines whether the logic of the signature set meets the logical syntax tree, and extracts the certificates required by the endorsement strategy from the MSP list linked to the logical syntax tree in step (2.2). The signature set of the execution result of the endorsement node on the transaction proposal is verified. If the signatures in the signature set meet the requirements of the endorsement strategy interpreter and the verification is successful, the verification is successful; otherwise, the verification fails.

[0033] The specific verification process can be illustrated with an example. When Institution 1 (including members A and B), Institution 2 (including members C and D), and Institution 3 (including members E and F) form the Fabric blockchain network, during the registration phase with the cross-chain network, the MSP lists of Institution 1, Institution 2, and Institution 3 need to be submitted to the cross-chain network. Simultaneously, if the Fabric blockchain specifies an endorsement policy such as And(Org1.A, Or(Org2.C, Org3.E)), this policy expression also needs to be registered with the cross-chain network, along with the chaincode IDs involved in the cross-chain transaction. After registration, if a cross-chain transaction occurs on the Fabric network, it will be submitted to the cross-chain network. The cross-chain network needs to verify the transaction information. First, it generates a syntax tree based on the endorsement policy expression. The leaf nodes of the syntax tree represent members A, C, and E. Then, a mapping needs to be established between the members of the leaf nodes and their certificates in the MSP list. This syntax tree, which generates the mappings, is used to create an endorsement policy interpreter. This interpreter can then be used to verify the signature set of the endorsement nodes in the transaction information.

Claims

1. A method for verifying complex Fabric endorsement strategies in cross-chain applications, applied to a relay chain, wherein the relay chain is a blockchain in a cross-chain network used to receive transaction information for cross-chain transactions, characterized in that... include: When the transaction information sent by the Fabric blockchain is received, the transaction information is parsed to obtain the execution result of the transaction proposal corresponding to the transaction information and the signature set corresponding to the execution result; If the first chaincode ID matches the second chaincode ID in the execution result, then the first expression pre-registered by the Fabric blockchain is obtained; the first chaincode ID and the first expression are pre-registered by the Fabric blockchain in the relay chain. The first expression is used to represent the endorsement strategy corresponding to the Fabric blockchain; The first expression is semantically analyzed to generate a corresponding logical syntax tree, and a first endorsement policy interpreter is generated based on the logical syntax tree and the MSP list corresponding to the Fabric blockchain; the MSP list is a list of Fabric blockchains pre-registered in the relay chain for transaction verification. Based on the first endorsement policy interpreter, it is determined whether the signature set conforms to the logical syntax tree, and whether the signature set satisfies the certificate corresponding to the logical syntax tree; The certificate corresponding to the logical syntax tree is the certificate required by the endorsement policy extracted by the first endorsement policy interpreter from the MSP list corresponding to the logical syntax tree; If the signature set conforms to the logical syntax tree and the signature set satisfies the certificate corresponding to the logical syntax tree, then the transaction information is determined to be successfully verified.

2. The method according to claim 1, characterized in that, The step of performing semantic analysis on the expression to generate a corresponding logical syntax tree, and generating a first endorsement policy interpreter based on the logical syntax tree and the MSP list corresponding to the Fabric blockchain, includes: The expression is transformed into a tree-like data structure based on a preset abstract syntax tree, and the logical syntax tree is generated; the abstract syntax tree is used to perform syntax analysis on the expression; The logical syntax tree is mapped to the MSP list, and the first endorsement policy interpreter is generated.

3. The method according to claim 1, characterized in that, The step of performing semantic analysis on the expression to generate a corresponding logical syntax tree, and generating a first endorsement policy interpreter based on the logical syntax tree and the MSP list corresponding to the Fabric blockchain, includes: Receive the second expression uploaded by the Fabric blockchain; the second expression is sent by the Fabric blockchain when updating the endorsement policy; A second endorsement policy interpreter is generated based on the second expression, and the signature set is used to determine whether it conforms to the logical syntax tree.

4. The method according to claim 1, characterized in that, After determining whether the signature set conforms to the logical syntax tree based on the first endorsement policy interpreter and determining whether the signature set satisfies the certificate corresponding to the logical syntax tree, the process includes: If the signature set does not conform to the logical syntax tree and / or the signature set does not satisfy the certificate corresponding to the logical syntax tree, then the transaction information verification is deemed to have failed.

5. The method according to claim 1, characterized in that, The MSP list includes the MSP list of all institutions in the Fabric blockchain; the endorsement strategy represented by the first expression is composed of the MSP lists of multiple institutions in the Fabric blockchain.

6. The method according to claim 1, characterized in that, The first endorsement strategy interpreter is generated by the relay chain each time it receives the transaction information.

7. A method for verifying complex Fabric endorsement strategies across chains, applied to the Fabric blockchain, characterized in that, include: Send the MSP list, the first chaincode ID, and the first expression to the relay chain; the first expression is used to represent the endorsement policy corresponding to the Fabric blockchain. When the updated endorsement policy is received, the second expression related to the updated endorsement policy is sent to the relay chain to generate a second endorsement policy interpreter corresponding to the second expression on the relay chain. When a cross-chain transaction occurs, the transaction information corresponding to the cross-chain transaction is sent to the relay chain for verification on the relay chain.

8. The method according to claim 7, characterized in that, After sending the transaction information corresponding to the cross-chain transaction to the relay chain, the process includes: The relay chain receives a verification error returned by the relay chain; the verification error is returned by the relay chain when it determines, based on the endorsement logic interpreter, that the first chaincode ID and the second chaincode ID are inconsistent; the second chaincode ID is obtained by the relay chain based on the transaction information.

9. The method according to claim 8, characterized in that... The verification error may also be returned by the relay chain when the endorsement logic interpreter determines that the signature set does not conform to the logic syntax tree and / or the signature set does not satisfy the certificate corresponding to the logic syntax tree; the signature set is obtained by the relay chain based on the transaction information; the logic syntax tree is generated by the relay chain through semantic analysis of the first expression; the endorsement logic interpreter is generated by the relay chain based on the logic syntax tree and the MSP list.