WO2022206454A1 - Method and apparatus for providing cross-chain messages - Google Patents

Method and apparatus for providing cross-chain messages Download PDF

Info

Publication number
WO2022206454A1
WO2022206454A1 PCT/CN2022/082018 CN2022082018W WO2022206454A1 WO 2022206454 A1 WO2022206454 A1 WO 2022206454A1 CN 2022082018 W CN2022082018 W CN 2022082018W WO 2022206454 A1 WO2022206454 A1 WO 2022206454A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
read
message
node
chain
Prior art date
Application number
PCT/CN2022/082018
Other languages
French (fr)
Chinese (zh)
Inventor
余逸荣
Original Assignee
支付宝(杭州)信息技术有限公司
蚂蚁区块链科技(上海)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 支付宝(杭州)信息技术有限公司, 蚂蚁区块链科技(上海)有限公司 filed Critical 支付宝(杭州)信息技术有限公司
Publication of WO2022206454A1 publication Critical patent/WO2022206454A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/0825Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using asymmetric-key encryption or public key infrastructure [PKI], e.g. key signature or public key certificates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3263Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements
    • H04L9/3268Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements using certificate validation, registration, distribution or revocation, e.g. certificate revocation list [CRL]

Definitions

  • the embodiments of this specification relate to the field of blockchain technology, and more particularly, to a method and apparatus for providing cross-chain messages in Fabric blockchain, and a method and apparatus for obtaining cross-chain messages in Fabric blockchain.
  • Blockchain technology also known as distributed ledger technology, is a decentralized distributed database technology characterized by decentralization, openness, transparency, immutability, and trustworthiness.
  • many different types of chains have emerged, which are applied in the fields of finance, health care, supply chain, asset management and traceability. At present, how to make different types of chains cooperate and realize the circulation of value is an important exploration direction.
  • the cross-chain messages sent by the account in the blockchain to the outside of the chain are usually obtained by reading the block data in the blockchain ledger.
  • the Fabric blockchain Hyperledger Fabric blockchain
  • each peer node stores a full amount of consistent ledger data.
  • the peer node has its own query chain code (Query System Chaincode, qscc).
  • qscc query System Chaincode
  • the peer node needs to query the ledger data, it can query the local block data by calling the qscc system chain code.
  • the off-chain user wants to query the target block data in the channel, the off-chain user needs to start a peer node to query the block data in the Fabric blockchain.
  • the embodiments of the present specification aim to provide a more effective solution for transmitting messages across chains, so as to solve the deficiencies in the prior art.
  • one aspect of this specification provides a method for providing cross-chain messages, the method is executed by an endorsement node of the Fabric blockchain, and includes: receiving transaction information of a first transaction from the Fabric blockchain, the The transaction information includes a transaction proposal of the first transaction and at least one read-write set, and the transaction proposal of the first transaction calls the first contract and provides the first cross-chain message to the first contract; determine The execution status of the first transaction; in the case of determining that the first transaction can be successfully executed, record the first cross-chain message in the message queue in the account status of the first contract; from the client node Receive a transaction proposal of a second transaction, in which the query function in the first contract is called; pre-execute the second transaction to read the first cross-chain message from the message queue; generating a read-write set of the second transaction, the read-write set including the first cross-chain message; sending the read-write set of the second transaction to the client node.
  • the method further includes, after sending the read-write set of the second transaction to the client node, receiving transaction information of the second transaction from the Fabric blockchain, the first
  • the transaction information of the second transaction includes the transaction proposal of the second transaction and at least one read-write set; determining the execution status of the second transaction; in the case of determining that the second transaction can be successfully executed, in the message The state of the first cross-chain message is changed in the queue.
  • the first contract invokes a predetermined chain code for obtaining information about the account that initiates the proposal
  • pre-executing the second transaction further includes: obtaining the information of the second transaction by pre-executing the predetermined chain code.
  • a proposal initiating account verifying whether the proposal initiating account is a predetermined account, and in the case that the proposal initiating account is a predetermined account, reading the first cross-chain message from the message queue.
  • Another aspect of this specification provides a method for obtaining a cross-chain message, the method being executed by a client node of the Fabric blockchain, comprising: sending a transaction proposal of the second transaction to at least one endorsement node of the Fabric blockchain, where the The query function in the first contract is called in the transaction proposal of the second transaction, the account status of the first contract includes a message queue of cross-chain messages, and the query function is used to read the cross-chain message in the message queue. message; respectively receiving read-write sets of the second transaction from the at least one endorsement node, each of the read-write sets including the first cross-chain message in the message queue.
  • the method further includes, after respectively receiving the read-write sets of the second transaction from the at least one peer node, verifying each of the read-write sets based on a predetermined endorsement policy; After the verification is passed, the transaction information of the second transaction is sent to the ordering node in the Fabric block chain, and the transaction information of the second transaction includes the transaction proposal of the second transaction and each of the read-write sets.
  • the query function in the first contract is called with a query parameter as an incoming parameter in the second transaction, and the query parameter is used to indicate the first cross-chain message.
  • sending the transaction proposal of the second transaction to at least one endorsing node of the Fabric blockchain includes sending the transaction proposal of the second transaction to the first endorsing node of the Fabric blockchain, the first endorsing node Including TEE.
  • Another aspect of the present specification provides an apparatus for providing a cross-chain message, the apparatus is deployed on an endorsement node of the Fabric blockchain, and includes: a first receiving unit configured to receive a transaction of the first transaction from the Fabric blockchain information, the transaction information includes a transaction proposal of the first transaction and at least one read-write set, and the transaction proposal of the first transaction calls the first contract and provides the first cross to the first contract.
  • a first determination unit configured to determine the execution state of the first transaction
  • a recording unit configured to, in the case of determining that the first transaction can be successfully executed, in the account state of the first contract the first cross-chain message is recorded in the message queue in ;
  • a pre-execution unit configured to pre-execute the second transaction to read the first cross-chain message from the message queue;
  • a generation unit configured to generate a read-write set of the second transaction, The read-write set includes the first cross-chain message; the sending unit is configured to send the read-write set of the second transaction to the client node.
  • the apparatus further includes a third receiving unit configured to, after sending the read-write set of the second transaction to the client node, receive the second transaction from the Fabric blockchain transaction information of the transaction, the transaction information of the second transaction includes a transaction proposal of the second transaction and at least one read-write set; a second determination unit configured to determine the execution state of the second transaction; a modification unit , and is configured to change the state of the first cross-chain message in the message queue when it is determined that the second transaction can be executed successfully.
  • a third receiving unit configured to, after sending the read-write set of the second transaction to the client node, receive the second transaction from the Fabric blockchain transaction information of the transaction, the transaction information of the second transaction includes a transaction proposal of the second transaction and at least one read-write set
  • a second determination unit configured to determine the execution state of the second transaction
  • a modification unit and is configured to change the state of the first cross-chain message in the message queue when it is determined that the second transaction can be executed successfully.
  • the first contract invokes a predetermined chain code for obtaining information about the account that initiates the proposal
  • the pre-execution unit includes an obtaining subunit configured to obtain by pre-executing the predetermined chain code
  • the proposal initiating account of the second transaction, the verification subunit, is configured to verify whether the proposal initiating account is a predetermined account
  • the reading subunit is configured to, in the case that the proposal initiating account is a predetermined account, from the The first cross-chain message is read from the message queue.
  • Another aspect of this specification provides an apparatus for obtaining a cross-chain message, the apparatus is deployed on a client node of the Fabric blockchain, and includes: a first sending unit configured to send to at least one endorsement node of the Fabric blockchain
  • the transaction proposal of the second transaction, the query function in the first contract is called in the transaction proposal of the second transaction, the account status of the first contract includes a message queue of cross-chain messages, and the query function is used to read the cross-chain message in the message queue
  • the receiving unit is configured to respectively receive read-write sets of the second transaction from the at least one endorsement node, and each read-write set includes the first read-write set in the message queue Cross-chain messages.
  • the apparatus further includes a verification unit configured to, after respectively receiving the read-write set of the second transaction from the at least one peer node, verify each of the read-write sets based on a predetermined endorsement policy.
  • the second sending unit is configured to send the transaction information of the second transaction to the ordering node in the Fabric blockchain after the verification is passed, and the transaction information of the second transaction includes the first Two transaction proposals and read-write sets for each of the transactions.
  • the query function in the first contract is called with a query parameter as an incoming parameter in the second transaction, and the query parameter is used to indicate the first cross-chain message.
  • the first sending unit is further configured to send a transaction proposal of the second transaction to a first endorsement node of the Fabric blockchain, where the first endorsement node includes a TEE.
  • Another aspect of the present specification provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed in a computer, the computer is made to execute any of the above-mentioned methods executed by an endorsement node of the Fabric blockchain .
  • Another aspect of the present specification provides a computing device, including a memory and a processor, where executable code is stored in the memory, and when the processor executes the executable code, any one of the above-mentioned processing by the Fabric blockchain is implemented.
  • Another aspect of the present specification provides a computer-readable storage medium on which a computer program is stored.
  • the computer program is executed in a computer, the computer is made to execute any of the above-mentioned functions executed by the client node of the Fabric blockchain. method.
  • Another aspect of the present specification provides a computing device, including a memory and a processor, where executable code is stored in the memory, and when the processor executes the executable code, any one of the above-mentioned processing by the Fabric blockchain is implemented. The method executed by the client node.
  • the cross-chain message is saved in the account state of the message sending contract deployed in the Fabric blockchain, and the cross-chain message in the account state is queried by calling the query function of the message sending contract.
  • Chain message provides a novel method of querying the blockchain ledger in the Fabric blockchain. Through this method, you can also set a verification program in the query function, and you can also verify whether the query account is an allowed preset account. Thereby improving security.
  • FIG. 1 shows a schematic diagram of a cross-chain system based on Fabric blockchain according to an embodiment of the present specification
  • FIG. 2 shows a flowchart of a method for executing transaction 1 in the Fabric blockchain according to an embodiment of the present specification
  • FIG. 3 shows a flowchart of a method for executing transaction m in the Fabric blockchain according to an embodiment of the present specification
  • FIG. 4 shows an apparatus 400 for providing a cross-chain message according to an embodiment of the present specification
  • FIG. 5 shows an apparatus 500 for acquiring a cross-chain message according to an embodiment of the present specification.
  • the Fabric blockchain is an enterprise-oriented consortium chain.
  • the Fabric blockchain includes the following types of nodes: client nodes, peer nodes, orderer nodes, and so on.
  • the peer nodes further include an endorsement (Endorsor) node, an management (Anchor) node, a commit (Committer) node, and the like.
  • the Fabric blockchain includes multiple channels, and each channel has its own closed ledger data and chaincode, which is the smart contract in the Fabric blockchain. Peers can choose which channels to join, and they can join the channel after being authenticated by peers already in the channel.
  • the client node (that is, the node device of the client node) can initiate a transaction proposal to a channel in the Fabirc blockchain, so that the client node can endorse at least two predetermined endorsement nodes in the channel according to the endorsement policy of the channel Send a transaction proposal.
  • the endorsement node in the channel has a transaction proposal system interface, so that the endorsement node can pre-execute the transaction proposal received from the client node by calling the system interface to obtain the read-write set of the pre-executed transaction, and digitally sign the read-write set. And after the pre-execution, the pre-execution result (that is, the read-write set) and the digital signature are returned to the client node.
  • each peer node After receiving the transaction pre-execution result and digital signature from each endorsement node, the client node sends it to the ordering node.
  • the sorting node is used to sort transactions, and pack the sorted transactions into blocks at fixed time intervals and send them to the management node.
  • the management node After receiving the block, the management node broadcasts the block to each submitting node. After the submitting node receives the block, it verifies the execution status of each transaction in the block, marks its execution status in each transaction of the block, and then adds the block to the node's ledger data (ie, submits the block).
  • each peer node is a commit node, that is, each peer node locally includes the ledger data of the channel.
  • FIG. 1 shows a schematic diagram of a cross-chain system based on the Fabric blockchain according to an embodiment of the present specification.
  • the cross-chain system includes an endorsement node 11, a first client node 12, a second client node 13 and an ordering node 14 in the Fabric blockchain, and these nodes all correspond to specific node devices , hereinafter, the node refers to the corresponding node device.
  • a business contract and a message sending contract are deployed in the endorsement node 11.
  • the business contract is, for example, a cross-chain transfer contract, and the business contract includes a call of a message sending contract, and the message sending contract is used to send cross-chain messages.
  • the corresponding first client node 12 can send transaction 1 to at least one predetermined endorsement node (for example, including the endorsement node 11 ) in the Fabric blockchain
  • the business contract is called, and the parameters related to the transfer are passed to the business contract, such as the blockchain identifier for receiving the transfer, the account for receiving the transfer, the transfer amount, the receiving contract account, and so on.
  • the endorsement node 11 pre-executes transaction 1, that is, pre-executes the business contract, records in the read-write set of pre-execution transaction 1: reads the account balance that initiates transaction 1, and reduces the account balance by any amount.
  • Message 1 includes, for example, the identifier of the sending blockchain, the identifier of the receiving blockchain, the sending account, the receiving account, the receiving contract account and the pairing of the message 1.
  • the balance of the receiving account is increased by the amount, etc., and then the message sending contract is pre-executed, and message 1 is provided to the message sending contract.
  • "message 1" is added to the message queue recorded in the account status of the message sending contract in the above-mentioned read-write set.
  • the endorsement node 11 signs the generated read-write set, and sends the read-write set of transaction 1 and its signature back to the first client node 12 .
  • the first client node 12 collects the read-write set of each endorsement node and its signature, it verifies it based on the predetermined endorsement policy, and after the verification is passed, the information of the transaction 1 is packaged and sent to the ordering node 14.
  • the ordering node 14 The received transactions (including transaction 1) are sorted and packaged into blocks based on predetermined rules, and the blocks are sent to a management node in the Fabric blockchain (not shown in Figure 1).
  • the management node sends the block to each submission node in the Fabric blockchain, including, for example, the endorsement node 11, that is, the endorsement node 11 acts as both an endorsement node and a submission node.
  • the endorsement node 11 verifies the read-write set of transaction 1 based on the current world state, and after determining that transaction 1 is executable, updates the world state according to the write set in the read-write set, that is, updates the sending of transaction 1 account balance of the account, and add message 1 to the message queue in the account state of the message sending contract.
  • Message 1 - Message 5 arranged in sequence in FIG. 1 schematically illustrate the message queue in the account state of the message sending contract.
  • the second client node 13 is used to transfer messages between the Fabric blockchain 11 and other blockchains. Similar to the above, the second client node 13 can obtain the cross-chain message by sending a transaction proposal (for example, the proposal of transaction m in FIG. 1 , where m is the transaction number) to a predetermined endorsement node in the Fabric blockchain 11 . .
  • the query function of the message sending contract is called in transaction m to query the above message queue.
  • the endorsement node 11 pre-executes transaction m, that is, pre-executes the query function, reads message 1 in the message queue of the message sending contract, and then records the message in the read set of transaction m.
  • the read of 1, and the deletion of message 1 in the message queue are recorded in the write set.
  • the endorsement node 11 After generating the read-write set of transaction m, the endorsement node 11 signs the read-write set, and sends the read-write set and its signature back to the second client node 13 . After the second client node 13 receives the responses to the transaction m sent back by each endorsement node, it verifies each response, so that the message 1 can be obtained from any read-write set. After verifying the responses of each endorser node to transaction m, the second client node 13 can package the transaction information of transaction m, and send the transaction information of transaction m to the ordering node 14 .
  • the sorting node 14 sorts the received multiple transactions, and packs the multiple transactions into a block, for example, the block includes transaction m. Afterwards, the ordering node 14 sends the block to the management node (not shown in FIG. 1 ), which in turn sends the block to each submitting node (including the endorsing node 11). After receiving the transaction information of transaction m, the endorsement node verifies whether transaction m can be executed based on the world state. In the case of verifying that transaction m is executable, the world state is updated based on the read-write set of transaction m, that is, in the account of the message sending contract. Message 1 is deleted from the message queue in the state.
  • the business contract is not limited to be a cross-chain transfer contract, and the message 1 is not limited to the above-mentioned form.
  • the method for providing messages across chains according to embodiments of the present specification will be described in detail below.
  • FIG. 2 shows a flowchart of a method for executing transaction 1 in the Fabric blockchain according to an embodiment of the present specification. It is shown in FIG. 2 that the method is performed jointly by the first client node 12 , the endorsing node 11 and the ordering node 14 .
  • step S201 the first client node 12 sends a proposal of transaction 1 to a predetermined endorsement node, where the predetermined endorsement node includes the endorsement node 11.
  • the endorsement nodes and endorsement policies are preset, and only the endorsement nodes are deployed with chaincodes, so that only the endorsement nodes can pre-execute each chaincode.
  • the client node makes the endorsement node pre-execute the transaction by sending a transaction proposal to at least one preset endorsement node.
  • the first client node 12 sends a proposal for transaction 1 for cross-chain transfer to the endorsement node 11, and the proposal includes a call to a business contract, and the business contract includes a call to the message sending contract. Called to send cross-chain messages.
  • step S202 the endorsement node 11 pre-executes transaction 1, and generates a read-write set of transaction 1.
  • the endorsement nodes in the Fabric blockchain perform the endorsement process according to the preset process relative to the endorsement nodes. Specifically, after receiving the transaction 1, the endorsement node 11 pre-executes the transaction 1, and the pre-execution is the simulated execution of the transaction 1, but does not store the acquired transaction execution result (ie, the change to the world state) into the local ledger , but generate a read-write set corresponding to transaction 1, and store the changes to the world state caused by the execution into the read-write set. After the endorsing node 11 starts to pre-execute transaction 1, it pre-executes the business contract.
  • the pre-execution process includes, for example, reading the account balance of account 1 that sends the transaction 1 proposal, and reducing the balance of this account 1 by the transfer amount.
  • the account balance of account 1 is recorded in the read set of transaction 1, and the balance of account 1 after reducing the transfer balance is recorded in the write set of transaction 1.
  • the endorsement node 11 generates the message 1 based on the program in the business contract, executes the message sending contract called in the business contract, and provides the message 1 to the message sending contract.
  • the message 1 added to the message queue in the account state of the message sending contract is recorded in the write set of transaction 1, thereby completing the pre-execution of transaction 1.
  • step S203 the endorsement node 11 sends the read-write set of transaction 1 to the first client node 12.
  • the endorsement node After completing the pre-execution of transaction 1, the endorsement node signs the generated read-write set of transaction 1, and returns the read-write set and its signature to the first client node 12.
  • step S204 the first client node 12 verifies the read-write set of transaction 1.
  • the first client node 12 After receiving the read-write set of transaction 1 and its signature from at least one endorsement node, the first client node 12 first verifies whether the signature of each read-write set is the signature of each endorser node through the public key of each endorser node, and then, based on The predetermined endorsement policy verifies the read-write set, for example, the predetermined endorsement policy is an endorsement requiring at least three endorsing nodes, an endorsement requiring a specific number of endorsing nodes, and so on. If the verification is passed, the subsequent step S205 is executed, and if the verification is not passed, the processing of the transaction 1 is ended.
  • a secure execution environment is included in the endorsement node 11 .
  • the first client node 12 may verify the TEE in the endorsing node 11 . Specifically, the first client node 12 may send an authentication request to the TEE. After receiving the verification request, the TEE generates authentication information based on its internal mechanism, and sends the authentication information and the hardware public key of the TEE to the first client node 12 .
  • the authentication information includes, for example, signature information, hardware information, software information, and the like of the TEE.
  • the signature information is generated by, for example, the hardware key of the TEE; the hardware information includes, for example, various hardware indicators, such as CPU frequency, memory capacity, etc.; the software information includes the code hash value of each program , code name, version, run log, etc.
  • a TEE can perform "measurements" of a program running in it through memory hardware, such as obtaining a code hash of the program, a hash of the program's memory occupancy at a particular point of execution, etc.
  • the authentication information includes "measurement" information for the program, which is authentic and credible because the "measurement" information is executed by the TEE's own entity (memory hardware) without involving any software or operating system.
  • the first client node 12 may send the authentication information to the remote authentication server of the TEE, so as to receive the verification result of the TEE from the server.
  • the verification result includes the identity verification of the TEE, the verification of the internal execution program of the TEE, and the like. Therefore, based on the verification result, the first client node 12 can determine that the TEE is credible, and the processing result of the TEE is credible. At the same time, the first client node 12 locally saves the hardware public key of the TEE for subsequent verification of the signature of the TEE.
  • the endorsing node 11 In the case where a secure execution environment (TEE) is included in the endorsing node 11, the endorsing node 11 is trusted, so the first client node 12 can only receive the read-write set of transaction 1 from the endorsing node 11, and use the After the signature of the read-write set is verified by the public key of the TEE, it can be confirmed that the read-write set is a real read-write set.
  • TEE secure execution environment
  • step S205 the first client node 12 sends the transaction information of transaction 1 to the ordering node 14 .
  • the first client node 12 After the first client node 12 passes the verification of the read-write set of transaction 1, it packages the transaction information of transaction 1, and the transaction information includes the proposal of transaction 1, each read-write set of transaction 1 and the corresponding read-write set of each endorsement node. After writing the signature of the set, the first client node 12 sends the transaction information of transaction 1 to the ordering node 14 for block entry.
  • step S206 after receiving the transaction information of transaction 1, the sorting node 14 sorts the multiple transactions that have been received, and packages the multiple transactions into block 1.
  • the ordering node 14 may order the plurality of transactions based on a predetermined ordering rule, for example, the transactions may be ordered based on their proposal sending time. After sorting, the sorting node 14 packages the respective transaction information of the plurality of transactions into, for example, a block 1 in the above-mentioned sorting order, and the block 1 includes the transaction information of the transaction 1 .
  • step S207 the ordering node 14 sends the block 1 to a plurality of submitting nodes, including the endorsing node 11.
  • the submission node is used to determine the execution state of the transaction, put the transaction into a block, and update the world state according to the read-write set of the transaction. That is to say, the submission node stores the ledger data in the Fabric blockchain. Includes block and world state. Since the endorsement node 11 needs to perform operations such as querying the ledger data, the endorsement node 11 needs to act as a submitting node to enter a transaction block to update the local ledger data.
  • step S208 the endorsement node 11 determines the execution status of transaction 1.
  • the endorsement node 11 After receiving block 1, the endorsement node 11 needs to process each transaction in sequence according to the arrangement order of each transaction in block 1.
  • the endorsement node 11 first determines the execution status of transaction 1, that is, determines whether transaction 1 can be successfully executed. Specifically, the endorsement node 11 determines whether there is a read-write conflict based on the read-write set of transaction 1 and the current world state, so as to determine whether transaction 1 can be successfully executed. For example, if the read-write set of transaction 1 includes reading and modification of the balance of account 1, the endorsement node 11 determines whether the balance of account 1 read during pre-execution in the read-write set of transaction 1 has any value after the read. The transaction that is sorted before transaction 1 is changed. If there is this change, there is a read conflict, and the transaction 1 cannot be successfully executed. If there is no such change, it means that there is no read-write conflict, and the transaction 1 can be successfully executed.
  • step S209 the endorsement node 11 records the message 1 in the message queue in the account state of the message sending contract.
  • the endorsement node 11 After the endorsement node 11 determines that the transaction 1 can be successfully executed, it changes the world state based on the read-write set of the transaction 1, and stores the transaction information of the transaction 1 and its execution status (ie, the successful execution status) in the Fabric blockchain.
  • the read-write set of transaction 1 includes changes to account 1's balance and changes to the message queue, therefore, the endorsing node 11 stores the changes locally, ie changes the world state, that is, makes changes to account 1
  • the change in the balance of the message 1 is logged in the message queue in the account state of the message sending contract.
  • the processing of transaction 1 in the Fabric blockchain ends, and thus, through the processing of transaction 1, message 1 is stored in the Fabric blockchain as a message to be sent across chains.
  • FIG. 3 shows a flowchart of a method for executing transaction m in the Fabric blockchain according to an embodiment of the present specification. It is shown in FIG. 3 that the method is performed jointly by the second client node 13 , the endorsing node 11 and the ordering node 14 .
  • step S301 the second client node 13 sends a proposal for transaction m.
  • the second client node 13 does not store the ledger data of the Fabric blockchain.
  • the second client node 13 obtains the cross-chain message from the endorsing node by sending a specific transaction proposal to the endorsing node in the Fabric blockchain.
  • the second client node 13 may send a proposal for transaction m to at least one predetermined endorsement node (including the endorsement node 11 ) in the Fabric blockchain, and the proposal for transaction m calls
  • the query function included in the message sending contract is used to read cross-chain messages in the above message queue.
  • step S302 the endorsement node 11 pre-executes the transaction m, and generates a read-write set of the transaction m, and the read-write set includes the message 1.
  • the query function can be preset to allow the query account to verify whether the account that sends the proposal of the transaction m is an allowed query account. . Therefore, when the query function is pre-executed, the account that sends the proposal of transaction m is first verified. If the verification fails, the query failure is returned. If the verification succeeds, the cross-link is read from the message queue in the account status of the message sending contract. chain message. It can be understood that in the case where the query account does not need to be verified, when the query function is pre-executed, the cross-chain message can be directly read from the message queue in the account status of the message sending contract.
  • the query function includes, for example, the GetProposer interface.
  • the certificate of the proposer is first obtained by calling GetProposer.
  • the certificate includes the account, public key and other information of the proposer, so that the Verify that the proposer is allowed to query based on the account or public key preset in the query function.
  • the query function includes, for example, the GetCreator interface.
  • the proposer's account is first obtained by calling GetCreator, and then whether the proposer's account is verified based on the allowable account preset in the query function for allowed accounts.
  • the reading method of cross-chain messages in the query function can be set according to requirements. For example, it can be preset that each time the query function is pre-executed, the oldest message is read from the message queue. Referring to Figure 1, assuming that the current Message 1 is the earliest recorded message, and message 2 to message 5 are all messages recorded after message 1. Therefore, when the query function is executed this time, message 1 in the message queue is read.
  • the query function is not limited to reading the oldest message, but can be preset to read the oldest predetermined number (for example, 5, etc.) messages in the message queue, or can be preset to read The latest predetermined number of messages in the message queue, or it can be preset to read the message with the specified sequence number, and the specified sequence number can be passed to the query function as an incoming parameter when calling the query function, or it can be preset to read the specified sequence number.
  • the content of the message, the specified content is the content included in the message, such as accepting the contract account number, receiving the blockchain identifier, etc.
  • the specified content can also be passed to the query function as an incoming parameter when calling the query function. .
  • the endorsement node 11 After reading, for example, message 1 from the message queue in the above-described manner, the endorsement node 11 records message 1 in the read set relative to the read-write set generated by transaction m.
  • the query function can also be preset to pre-modify the state of the message sending contract after reading the cross-chain message, that is, not to modify the world state immediately, but to record the changes to the world state in the write set. Specifically, in one embodiment, after, for example, reading the message 1 in the message queue, record and delete the message 1 in the message queue in the write set of the transaction m, so that the endorsement node 11 will, after submitting the transaction m, record the message 1 according to the write set of the transaction m. The content of the set record deletes message 1 in the message queue so that message 1 will not be read repeatedly the next time the query function is executed.
  • message 1 may be marked in the write set record to indicate that off-chain device 12 has read message 1, in this embodiment, the endorsing node 11 is submitting transaction m Message 1 will then be marked according to the records in the write set, so that the second client node 13 can read the message 1 repeatedly, or, in the case of more than one client node reading the cross-chain message from the endorsing node 11, at After the second client node 13 reads the message 1, other client nodes can also read the message 1.
  • the endorsement node 11 pre-executes the transaction m as described above, thereby generating a read-write set corresponding to the transaction m, and the read-write set includes the read message 1 .
  • step S303 the endorsement node 11 sends the read-write set of the transaction m to the second client node 13.
  • step S304 the second client node 13 verifies the read-write set of the transaction m.
  • step S303 and the step S304 reference may be made to the description of the step S203 and the step S204 above, which will not be repeated here.
  • step S305 the second client node 13 obtains the message 1 from the read-write set of the transaction m.
  • the endorsement node 11 when the endorsement node 11 pre-executes the transaction m, it records the message 1 read from the message queue into the read set. Therefore, the second client node 13 can read the read set in the read-write set of the transaction m.
  • the content is the content of message 1.
  • the second client node 13 can determine the receiving chain identifier from the message 1 based on the predetermined data structure of the message 1, so that each read-write set of the transaction m and its signature can be obtained Provided to the corresponding receiving chain, so that the corresponding receiving chain can verify each read-write set of transaction m based on the signature of each read-write set, and determine whether the each read-write set is credible according to the predetermined endorsement strategy, and then verify each read-write set. If the read-write set is trusted, message 1 can be obtained from it.
  • the second client node 13 determines the receiving chain identifier from the message 1, so as to directly provide the message 1 to the corresponding receive chain.
  • step S306 the second client node 13 sends the transaction information of the transaction m to the ordering node 14.
  • step S307 the sorting node 14 sorts the plurality of transactions to generate block 2.
  • step S308 the ordering node 14 sends the block 2 to a plurality of submitting nodes, including the endorsing node 11.
  • step S309 the endorsement node 11 determines the execution status of the transaction m.
  • steps S306-S309 reference may be made to the description of steps S205-S208 above, and details are not repeated here.
  • step S310 the endorsement node 11 deletes message 1 from the message queue in the account state of the message sending contract.
  • the endorsement node 11 determines that the transaction m can be successfully executed, it stores the transaction information of the transaction m and the execution state of the transaction m in the Fabric blockchain, and changes the world state according to the write set of the transaction m. For example, deletion of message 1 in the message queue is recorded in the write set. Therefore, the endorsement node performs deletion of message 1 in the message queue. If, as described above, the write set records the deletion of message 1 in the message queue. If marking is performed, the endorsing node will perform the marking of message 1 correspondingly. By submitting the transaction m in the Fabric blockchain, the world state can be changed according to the execution of the transaction m, thereby facilitating the subsequent reading of the message queue by the second client node 13 .
  • FIG. 4 shows an apparatus 400 for providing a cross-chain message according to an embodiment of the present specification.
  • the apparatus 400 is deployed on an endorsement node of the Fabric blockchain, and includes: a first receiving unit 401 configured to receive data from the Fabric blockchain
  • the transaction information of the first transaction is received in the transaction information, and the transaction information includes the transaction proposal of the first transaction and at least one read-write set.
  • the first contract provides the first cross-chain message;
  • the first determining unit 402 is configured to determine the execution state of the first transaction;
  • the recording unit 403 is configured to, in the case of determining that the first transaction can be successfully executed, Record the first cross-chain message in the message queue in the account state of the first contract;
  • the second receiving unit 404 is configured to receive a transaction proposal of the second transaction from the client node, in the second transaction
  • the query function in the first contract is called;
  • the pre-execution unit 405 is configured to pre-execute the second transaction to read the first cross-chain message from the message queue;
  • the generation unit 406 is configured to , generating a read-write set of the second transaction, and the read-write set includes the first cross-chain message;
  • the sending unit 407 is configured to send the read-write set of the second transaction to the client node .
  • the apparatus 400 further includes a third receiving unit 408, configured to, after sending the read-write set of the second transaction to the client node, receive from the Fabric blockchain Transaction information of the second transaction, the transaction information of the second transaction includes a transaction proposal of the second transaction and at least one read-write set; the second determining unit 409 is configured to determine the execution state of the second transaction ; The changing unit 410 is configured to, in the case of determining that the second transaction can be executed successfully, change the state of the first cross-chain message in the message queue.
  • the first contract invokes a predetermined chain code for obtaining information about the account that initiates the proposal
  • the pre-execution unit 405 includes an obtaining sub-unit 4051 configured to pre-execute the predetermined chain by pre-executing the predetermined chain code.
  • the code obtains the proposal initiating account of the second transaction
  • the verification subunit 4052 is configured to verify whether the proposal initiating account is a predetermined account
  • the reading subunit 4053 is configured to, when the proposal initiating account is a predetermined account In this case, the first cross-chain message is read from the message queue.
  • FIG. 5 shows an apparatus 500 for acquiring cross-chain messages according to an embodiment of the present specification.
  • the apparatus 500 is deployed on a client node of the Fabric block chain, and includes: a first sending unit 51 configured to send a message to the Fabric block chain.
  • At least one endorsement node of the chain sends a transaction proposal of the second transaction, the query function in the first contract is called in the transaction proposal of the second transaction, and the account status of the first contract includes the message queue of cross-chain messages, so
  • the query function is used to read the cross-chain message in the message queue;
  • the receiving unit 52 is configured to respectively receive the read-write set of the second transaction from the at least one endorsement node, and each of the read-write sets includes The first cross-chain message in the message queue.
  • the apparatus 500 further includes a verification unit 53, configured to, after receiving the read-write set of the second transaction from the at least one peer node respectively, verify each transaction based on a predetermined endorsement policy.
  • the read-write set is verified;
  • the second sending unit 54 is configured to, after the verification is passed, send the transaction information of the second transaction to the ordering node in the Fabric blockchain, where the transaction information of the second transaction includes The transaction proposal of the second transaction and each of the read and write sets.
  • the query function in the first contract is called with a query parameter as an incoming parameter in the second transaction, and the query parameter is used to indicate the first cross-chain message.
  • the first sending unit 51 is further configured to send a transaction proposal of the second transaction to a first endorsement node of the Fabric blockchain, where the first endorsement node includes a TEE.
  • Another aspect of the present specification provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed in a computer, the computer is made to execute any of the above-mentioned methods executed by an endorsement node of the Fabric blockchain .
  • Another aspect of the present specification provides a computing device, including a memory and a processor, where executable code is stored in the memory, and when the processor executes the executable code, any one of the above-mentioned processing by the Fabric blockchain is implemented.
  • Another aspect of the present specification provides a computer-readable storage medium on which a computer program is stored.
  • the computer program is executed in a computer, the computer is made to execute any of the above-mentioned functions executed by the client node of the Fabric blockchain. method.
  • Another aspect of the present specification provides a computing device, including a memory and a processor, where executable code is stored in the memory, and when the processor executes the executable code, any one of the above-mentioned processing by the Fabric blockchain is implemented. The method executed by the client node.
  • the cross-chain message is saved in the account state of the message sending contract deployed in the Fabric blockchain, and the cross-chain message in the account state is queried by calling the query function of the message sending contract.
  • Chain message provides a novel method of querying the blockchain ledger in the Fabric blockchain. Through this method, you can also set a verification program in the query function, and you can also verify whether the query account is an allowed preset account. Thereby improving security.
  • the software module can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or technical fields in any other form of storage medium known in the art.
  • RAM random access memory
  • ROM read only memory
  • electrically programmable ROM electrically erasable programmable ROM
  • registers hard disks, removable disks, CD-ROMs, or technical fields in any other form of storage medium known in the art.

Abstract

Provided in the embodiments of the present description are a method and an apparatus for providing cross-chain messages, the method being executed by an endorsing node of a Fabric blockchain, and comprising: receiving transaction information of a first transaction from a Fabric blockchain, a first contract being invoked in the transaction proposal of the first transaction, and a first cross-chain message being provided to the first contract; determining the execution state of the first transaction; when determining that the first transaction can be successfully executed, recording the first cross-chain message in a message queue in the account state of the first contract; receiving a transaction proposal of a second transaction from a client terminal node, a query function in the first contract being invoked in the second transaction; pre-executing the second transaction in order to read the first cross-chain message from the message queue; generating a read-write set of the second transaction, the read-write set comprising the first cross-chain message; and sending the read-write set of the second transaction to the client terminal node.

Description

提供跨链消息的方法和装置Method and apparatus for providing cross-chain messages 技术领域technical field
本说明书实施例涉及区块链技术领域,更具体地,涉及一种在Fabric区块链中提供跨链消息的方法和装置、以及在Fabric区块链中获取跨链消息的方法和装置。The embodiments of this specification relate to the field of blockchain technology, and more particularly, to a method and apparatus for providing cross-chain messages in Fabric blockchain, and a method and apparatus for obtaining cross-chain messages in Fabric blockchain.
背景技术Background technique
区块链技术也被称之为分布式账本技术,是一种去中心化的分布式数据库技术,其特点是去中心化、公开透明、不可篡改、可信任。随着区块链技术的火热,出现了许多不同类型的链,应用在金融、健康医疗、供应链、资产管理和溯源等领域。当前,如何能让不同类型的链协同合作实现价值的流通是一个重要的探索方向。在已有的跨链技术中,通常通过读取区块链账本中的区块数据而获取由该区块链中的账户向链外发送的跨链消息。例如,在Hyperledger Fabric区块链(下文简称为Fabric区块链)中,每个对等节点都存储有全量的、一致的账本数据。对等节点具有系统自带的查询链码(Query System Chaincode,qscc),当对等节点需要查询账本数据时,可通过调用该qscc系统链码,查询本地区块数据。然而,当链下用户希望查询通道中的目标区块数据时,链下用户需要启动一个对等节点以用于查询Fabric区块链中的区块数据。Blockchain technology, also known as distributed ledger technology, is a decentralized distributed database technology characterized by decentralization, openness, transparency, immutability, and trustworthiness. With the popularity of blockchain technology, many different types of chains have emerged, which are applied in the fields of finance, health care, supply chain, asset management and traceability. At present, how to make different types of chains cooperate and realize the circulation of value is an important exploration direction. In the existing cross-chain technology, the cross-chain messages sent by the account in the blockchain to the outside of the chain are usually obtained by reading the block data in the blockchain ledger. For example, in the Hyperledger Fabric blockchain (hereinafter referred to as the Fabric blockchain), each peer node stores a full amount of consistent ledger data. The peer node has its own query chain code (Query System Chaincode, qscc). When the peer node needs to query the ledger data, it can query the local block data by calling the qscc system chain code. However, when an off-chain user wants to query the target block data in the channel, the off-chain user needs to start a peer node to query the block data in the Fabric blockchain.
因此,需要一种更有效的跨链传递消息的方案。Therefore, a more efficient scheme for delivering messages across chains is needed.
发明内容SUMMARY OF THE INVENTION
本说明书实施例旨在提供一种更有效的跨链传递消息的方案,以解决现有技术中的不足。The embodiments of the present specification aim to provide a more effective solution for transmitting messages across chains, so as to solve the deficiencies in the prior art.
为实现上述目的,本说明书一个方面提供一种提供跨链消息的方法,所述方法由Fabric区块链的背书节点执行,包括:从Fabric区块链中接收第一交易的交易信息,所述交易信息中包括所述第一交易的交易提案和至少一个读写集,所述第一交易的交易提案中调用所述第一合约、并向所述第一合约提供第一跨链消息;确定所述第一交易的执行状态;在确定所述第一交易可成功执行的情况中,在所述第一合约的账户状态中的消息队列中记录所述第一跨链消息;从客户端节点接收第二交易的交易提案,所述第二交易中调用所述第一合约中的查询函数;预执行所述第二交易,以从所述消息队列中读取所述第一跨链消息;生成所述第二交易的读写集,所述读写集中包括所述第一跨链消息; 将所述第二交易的读写集发送给所述客户端节点。In order to achieve the above object, one aspect of this specification provides a method for providing cross-chain messages, the method is executed by an endorsement node of the Fabric blockchain, and includes: receiving transaction information of a first transaction from the Fabric blockchain, the The transaction information includes a transaction proposal of the first transaction and at least one read-write set, and the transaction proposal of the first transaction calls the first contract and provides the first cross-chain message to the first contract; determine The execution status of the first transaction; in the case of determining that the first transaction can be successfully executed, record the first cross-chain message in the message queue in the account status of the first contract; from the client node Receive a transaction proposal of a second transaction, in which the query function in the first contract is called; pre-execute the second transaction to read the first cross-chain message from the message queue; generating a read-write set of the second transaction, the read-write set including the first cross-chain message; sending the read-write set of the second transaction to the client node.
在一种实施方式中,所述方法还包括,在将所述第二交易的读写集发送给所述客户端节点之后,从Fabric区块链中接收第二交易的交易信息,所述第二交易的交易信息中包括所述第二交易的交易提案和至少一个读写集;确定所述第二交易的执行状态;在确定所述第二交易可成功执行的情况中,在所述消息队列中更改所述第一跨链消息的状态。In one embodiment, the method further includes, after sending the read-write set of the second transaction to the client node, receiving transaction information of the second transaction from the Fabric blockchain, the first The transaction information of the second transaction includes the transaction proposal of the second transaction and at least one read-write set; determining the execution status of the second transaction; in the case of determining that the second transaction can be successfully executed, in the message The state of the first cross-chain message is changed in the queue.
在一种实施方式中,所述第一合约中调用用于获取提案发起账户相关信息的预定链码,预执行第二交易还包括,通过预执行所述预定链码获取所述第二交易的提案发起账户,验证所述提案发起账户是否为预定账户,在所述提案发起账户为预定账户的情况中,从所述消息队列中读取所述第一跨链消息。In one embodiment, the first contract invokes a predetermined chain code for obtaining information about the account that initiates the proposal, and pre-executing the second transaction further includes: obtaining the information of the second transaction by pre-executing the predetermined chain code. A proposal initiating account, verifying whether the proposal initiating account is a predetermined account, and in the case that the proposal initiating account is a predetermined account, reading the first cross-chain message from the message queue.
本说明书另一方面提供一种获取跨链消息的方法,所述方法由Fabric区块链的客户端节点执行,包括:向Fabric区块链的至少一个背书节点发送第二交易的交易提案,所述第二交易的交易提案中调用第一合约中的查询函数,所述第一合约的账户状态中包括跨链消息的消息队列,所述查询函数用于读取所述消息队列中的跨链消息;从所述至少一个背书节点分别接收所述第二交易的读写集,各个所述读写集中包括所述消息队列中的第一跨链消息。Another aspect of this specification provides a method for obtaining a cross-chain message, the method being executed by a client node of the Fabric blockchain, comprising: sending a transaction proposal of the second transaction to at least one endorsement node of the Fabric blockchain, where the The query function in the first contract is called in the transaction proposal of the second transaction, the account status of the first contract includes a message queue of cross-chain messages, and the query function is used to read the cross-chain message in the message queue. message; respectively receiving read-write sets of the second transaction from the at least one endorsement node, each of the read-write sets including the first cross-chain message in the message queue.
在一种实施方式中,所述方法还包括,在从所述至少一个对等节点分别接收所述第二交易的读写集之后,基于预定背书策略对各个所述读写集进行验证;在验证通过之后,将第二交易的交易信息发送给所述Fabric区块链中的排序节点,所述第二交易的交易信息包括所述第二交易的交易提案和各个所述读写集。In one embodiment, the method further includes, after respectively receiving the read-write sets of the second transaction from the at least one peer node, verifying each of the read-write sets based on a predetermined endorsement policy; After the verification is passed, the transaction information of the second transaction is sent to the ordering node in the Fabric block chain, and the transaction information of the second transaction includes the transaction proposal of the second transaction and each of the read-write sets.
在一种实施方式中,所述第二交易中以查询参数为传入参数调用第一合约中的查询函数,所述查询参数用于指示所述第一跨链消息。In an implementation manner, the query function in the first contract is called with a query parameter as an incoming parameter in the second transaction, and the query parameter is used to indicate the first cross-chain message.
在一种实施方式中,向Fabric区块链的至少一个背书节点发送第二交易的交易提案包括,向Fabric区块链的第一背书节点发送第二交易的交易提案,所述第一背书节点中包括TEE。In one embodiment, sending the transaction proposal of the second transaction to at least one endorsing node of the Fabric blockchain includes sending the transaction proposal of the second transaction to the first endorsing node of the Fabric blockchain, the first endorsing node Including TEE.
本说明书另一方面提供一种提供跨链消息的装置,所述装置部署于Fabric区块链的背书节点,包括:第一接收单元,配置为,从Fabric区块链中接收第一交易的交易信息,所述交易信息中包括所述第一交易的交易提案和至少一个读写集,所述第一交易的交易提案中调用所述第一合约、并向所述第一合约提供第一跨链消息;第一确定单元,配置为,确定所述第一交易的执行状态;记录单元,配置为,在确定所述第一交易可成功执 行的情况中,在所述第一合约的账户状态中的消息队列中记录所述第一跨链消息;第二接收单元,配置为,从客户端节点接收第二交易的交易提案,所述第二交易中调用所述第一合约中的查询函数;预执行单元,配置为,预执行所述第二交易,以从所述消息队列中读取所述第一跨链消息;生成单元,配置为,生成所述第二交易的读写集,所述读写集中包括所述第一跨链消息;发送单元,配置为,将所述第二交易的读写集发送给所述客户端节点。Another aspect of the present specification provides an apparatus for providing a cross-chain message, the apparatus is deployed on an endorsement node of the Fabric blockchain, and includes: a first receiving unit configured to receive a transaction of the first transaction from the Fabric blockchain information, the transaction information includes a transaction proposal of the first transaction and at least one read-write set, and the transaction proposal of the first transaction calls the first contract and provides the first cross to the first contract. chain message; a first determination unit, configured to determine the execution state of the first transaction; and a recording unit, configured to, in the case of determining that the first transaction can be successfully executed, in the account state of the first contract the first cross-chain message is recorded in the message queue in ; a pre-execution unit, configured to pre-execute the second transaction to read the first cross-chain message from the message queue; a generation unit, configured to generate a read-write set of the second transaction, The read-write set includes the first cross-chain message; the sending unit is configured to send the read-write set of the second transaction to the client node.
在一种实施方式中,所述装置还包括,第三接收单元,配置为,在将所述第二交易的读写集发送给所述客户端节点之后,从Fabric区块链中接收第二交易的交易信息,所述第二交易的交易信息中包括所述第二交易的交易提案和至少一个读写集;第二确定单元,配置为,确定所述第二交易的执行状态;更改单元,配置为,在确定所述第二交易可成功执行的情况中,在所述消息队列中更改所述第一跨链消息的状态。In one embodiment, the apparatus further includes a third receiving unit configured to, after sending the read-write set of the second transaction to the client node, receive the second transaction from the Fabric blockchain transaction information of the transaction, the transaction information of the second transaction includes a transaction proposal of the second transaction and at least one read-write set; a second determination unit configured to determine the execution state of the second transaction; a modification unit , and is configured to change the state of the first cross-chain message in the message queue when it is determined that the second transaction can be executed successfully.
在一种实施方式中,所述第一合约中调用用于获取提案发起账户相关信息的预定链码,所述预执行单元包括,获取子单元,配置为,通过预执行所述预定链码获取所述第二交易的提案发起账户,验证子单元,配置为,验证所述提案发起账户是否为预定账户,读取子单元,配置为,在所述提案发起账户为预定账户的情况中,从所述消息队列中读取所述第一跨链消息。In one embodiment, the first contract invokes a predetermined chain code for obtaining information about the account that initiates the proposal, and the pre-execution unit includes an obtaining subunit configured to obtain by pre-executing the predetermined chain code The proposal initiating account of the second transaction, the verification subunit, is configured to verify whether the proposal initiating account is a predetermined account, and the reading subunit is configured to, in the case that the proposal initiating account is a predetermined account, from the The first cross-chain message is read from the message queue.
本说明书另一方面提供一种获取跨链消息的装置,所述装置部署于Fabric区块链的客户端节点,包括:第一发送单元,配置为,向Fabric区块链的至少一个背书节点发送第二交易的交易提案,所述第二交易的交易提案中调用第一合约中的查询函数,所述第一合约的账户状态中包括跨链消息的消息队列,所述查询函数用于读取所述消息队列中的跨链消息;接收单元,配置为,从所述至少一个背书节点分别接收所述第二交易的读写集,各个所述读写集中包括所述消息队列中的第一跨链消息。Another aspect of this specification provides an apparatus for obtaining a cross-chain message, the apparatus is deployed on a client node of the Fabric blockchain, and includes: a first sending unit configured to send to at least one endorsement node of the Fabric blockchain The transaction proposal of the second transaction, the query function in the first contract is called in the transaction proposal of the second transaction, the account status of the first contract includes a message queue of cross-chain messages, and the query function is used to read the cross-chain message in the message queue; the receiving unit is configured to respectively receive read-write sets of the second transaction from the at least one endorsement node, and each read-write set includes the first read-write set in the message queue Cross-chain messages.
在一种实施方式中,所述装置还包括,验证单元,配置为,在从所述至少一个对等节点分别接收所述第二交易的读写集之后,基于预定背书策略对各个所述读写集进行验证;第二发送单元,配置为,在验证通过之后,将第二交易的交易信息发送给所述Fabric区块链中的排序节点,所述第二交易的交易信息包括所述第二交易的交易提案和各个所述读写集。In one embodiment, the apparatus further includes a verification unit configured to, after respectively receiving the read-write set of the second transaction from the at least one peer node, verify each of the read-write sets based on a predetermined endorsement policy. The second sending unit is configured to send the transaction information of the second transaction to the ordering node in the Fabric blockchain after the verification is passed, and the transaction information of the second transaction includes the first Two transaction proposals and read-write sets for each of the transactions.
在一种实施方式中,所述第二交易中以查询参数为传入参数调用第一合约中的查询函数,所述查询参数用于指示所述第一跨链消息。In an implementation manner, the query function in the first contract is called with a query parameter as an incoming parameter in the second transaction, and the query parameter is used to indicate the first cross-chain message.
在一种实施方式中,所述第一发送单元还配置为,向Fabric区块链的第一背书节点发送第二交易的交易提案,所述第一背书节点中包括TEE。In an embodiment, the first sending unit is further configured to send a transaction proposal of the second transaction to a first endorsement node of the Fabric blockchain, where the first endorsement node includes a TEE.
本说明书另一方面提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行上述任一项由Fabric区块链的背书节点执行的方法。Another aspect of the present specification provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed in a computer, the computer is made to execute any of the above-mentioned methods executed by an endorsement node of the Fabric blockchain .
本说明书另一方面提供一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现上述任一项由Fabric区块链的背书节点执行的方法。Another aspect of the present specification provides a computing device, including a memory and a processor, where executable code is stored in the memory, and when the processor executes the executable code, any one of the above-mentioned processing by the Fabric blockchain is implemented. The method executed by the endorsing node.
本说明书另一方面提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行上述任一项由Fabric区块链的客户端节点执行的方法。Another aspect of the present specification provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is made to execute any of the above-mentioned functions executed by the client node of the Fabric blockchain. method.
本说明书另一方面提供一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现上述任一项由Fabric区块链的客户端节点执行的方法。Another aspect of the present specification provides a computing device, including a memory and a processor, where executable code is stored in the memory, and when the processor executes the executable code, any one of the above-mentioned processing by the Fabric blockchain is implemented. The method executed by the client node.
通过根据本说明书实施例的传递跨链消息的方案,在Fabric区块链中部署的消息发送合约的账户状态中保存跨链消息,并通过调用消息发送合约的查询函数来查询账户状态中的跨链消息,提供了一种新颖的在Fabric区块链中查询区块链账本的方法,通过该方法,还可以通过在查询函数设置验证程序,还可以验证查询账户是否为允许的预设账户,从而提高了安全性。Through the solution for transmitting cross-chain messages according to the embodiments of this specification, the cross-chain message is saved in the account state of the message sending contract deployed in the Fabric blockchain, and the cross-chain message in the account state is queried by calling the query function of the message sending contract. Chain message provides a novel method of querying the blockchain ledger in the Fabric blockchain. Through this method, you can also set a verification program in the query function, and you can also verify whether the query account is an allowed preset account. Thereby improving security.
附图说明Description of drawings
通过结合附图描述本说明书实施例,可以使得本说明书实施例更加清楚:By describing the embodiments of the present specification in conjunction with the accompanying drawings, the embodiments of the present specification can be made clearer:
图1示出根据本说明书实施例的基于Fabric区块链的跨链系统的示意图;FIG. 1 shows a schematic diagram of a cross-chain system based on Fabric blockchain according to an embodiment of the present specification;
图2示出根据本说明书实施例的在Fabric区块链中执行交易1的方法流程图;FIG. 2 shows a flowchart of a method for executing transaction 1 in the Fabric blockchain according to an embodiment of the present specification;
图3示出根据本说明书实施例的在Fabric区块链中执行交易m的方法流程图;3 shows a flowchart of a method for executing transaction m in the Fabric blockchain according to an embodiment of the present specification;
图4示出根据本说明书实施例的一种提供跨链消息的装置400;FIG. 4 shows an apparatus 400 for providing a cross-chain message according to an embodiment of the present specification;
图5示出根据本说明书实施例的一种获取跨链消息的装置500。FIG. 5 shows an apparatus 500 for acquiring a cross-chain message according to an embodiment of the present specification.
具体实施方式Detailed ways
下面将结合附图描述本说明书实施例。The embodiments of the present specification will be described below with reference to the accompanying drawings.
首先介绍一下Fabric区块链的构造和交易过程。Fabric区块链是一种面向企业的联盟链。Fabric区块链中包括以下多种类型的节点:客户端节点、对等(Peer)节点、排序(orderer)节点等等。所述对等节点中又包括背书(Endorsor)节点、管理(Anchor)节点、提交(Committer)节点等。Fabric区块链中包括多个通道(channel),每个通道具有自身封闭的账本数据和链码(chaincode),所述链码即为Fabric区块链中的智能合约。对等节点可选择加入哪些通道,其在经过通道中已有的对等节点的身份验证之后可加入该通道。客户端节点(即客户端节点的节点设备)可向Fabirc区块链中的某个通道发起交易提案,从而,客户端节点根据该通道的背书策略向该通道中的预定的至少两个背书节点发送交易提案。通道中的背书节点具有交易提案系统接口,从而背书节点可通过调用该系统接口对从客户端节点接收的交易提案进行预执行以获取预执行交易的读写集,对读写集进行数字签名,并在预执行之后将预执行结果(即读写集)和数字签名返回给所述客户端节点。所述客户端节点在从各个背书节点接收到交易预执行结果和数字签名之后,将其发送给排序节点。排序节点用于对交易进行排序、并将经排序的交易按照固定的时间间隔打包成区块发送给管理节点。管理节点收到区块之后将区块广播给每个提交节点。提交节点收到区块之后验证区块中每个交易的执行状态,在区块的每个交易中标记其执行状态,然后将区块加入本节点的账本数据中(即,提交区块)。其中,每个对等节点都是提交节点,即,每个对等节点本地都包括通道的账本数据。First, let's introduce the construction and transaction process of the Fabric blockchain. The Fabric blockchain is an enterprise-oriented consortium chain. The Fabric blockchain includes the following types of nodes: client nodes, peer nodes, orderer nodes, and so on. The peer nodes further include an endorsement (Endorsor) node, an management (Anchor) node, a commit (Committer) node, and the like. The Fabric blockchain includes multiple channels, and each channel has its own closed ledger data and chaincode, which is the smart contract in the Fabric blockchain. Peers can choose which channels to join, and they can join the channel after being authenticated by peers already in the channel. The client node (that is, the node device of the client node) can initiate a transaction proposal to a channel in the Fabirc blockchain, so that the client node can endorse at least two predetermined endorsement nodes in the channel according to the endorsement policy of the channel Send a transaction proposal. The endorsement node in the channel has a transaction proposal system interface, so that the endorsement node can pre-execute the transaction proposal received from the client node by calling the system interface to obtain the read-write set of the pre-executed transaction, and digitally sign the read-write set. And after the pre-execution, the pre-execution result (that is, the read-write set) and the digital signature are returned to the client node. After receiving the transaction pre-execution result and digital signature from each endorsement node, the client node sends it to the ordering node. The sorting node is used to sort transactions, and pack the sorted transactions into blocks at fixed time intervals and send them to the management node. After receiving the block, the management node broadcasts the block to each submitting node. After the submitting node receives the block, it verifies the execution status of each transaction in the block, marks its execution status in each transaction of the block, and then adds the block to the node's ledger data (ie, submits the block). Among them, each peer node is a commit node, that is, each peer node locally includes the ledger data of the channel.
图1示出根据本说明书实施例的基于Fabric区块链的跨链系统的示意图。如图1所示,所述跨链系统中包括Fabric区块链中的背书节点11、第一客户端节点12、第二客户端节点13和排序节点14,这些节点都对应于具体的节点设备,下文中,所述节点即指相应的节点设备。背书节点11中部署有业务合约和消息发送合约,所述业务合约例如为跨链转账合约,并且所述业务合约中包括消息发送合约的调用,所述消息发送合约用于发送跨链消息。当Fabric区块链中的用户希望进行跨链转账时,可通过其对应的第一客户端节点12向Fabric区块链中的预定的至少一个背书节点(其中例如包括背书节点11)发送交易1的提案,所述交易1的提案中调用业务合约,并向业务合约传入与转账相关的参数,如接收转账的区块链标识、接收转账的账户、转账金额、接收合约账户等等。背书节点11中在接收到交易1的提案之后预执行交易1,即,预执行业务合约,在预执行交易1的读写集中记录:读取发起交易1的账户余额、以及将账户余额减少所 述转账金额,并生成跨链消息(图1中的消息1),消息1中例如包括该消息1的发送区块链标识、接收区块链标识、发送账户、接收账户、接收合约账户及对接收账户的余额增加金额等内容,然后预执行消息发送合约,并将消息1提供给消息发送合约。在预执行消息发送合约时,在上述读写集中记录在消息发送合约的账户状态中的消息队列中加入“消息1”。在完成上述预执行之后,背书节点11对生成的读写集签名,并将交易1的读写集及其签名发回给第一客户端节点12。第一客户端节点12在收集了各个背书节点的读写集及其签名之后,基于预定背书策略对其进行验证,并在验证通过之后打包交易1的信息并发送给排序节点14,排序节点14基于预定规则对收到多个交易(其中包括交易1)进行排序并打包为区块,并将该区块发送给Fabric区块链中的管理节点(图1中未示出)。管理节点将该区块发送给Fabric区块链中的各个提交节点,其中例如包括背书节点11,也就是说,背书节点11即作为背书节点又作为提交节点。背书节点11在收到区块之后,基于当前世界状态对交易1的读写集进行验证,在确定交易1可执行之后,根据读写集中的写集更新世界状态,即,更新交易1的发送账户的账户余额,并在消息发送合约的账户状态中的消息队列中增加消息1。图1中以顺序排列的消息1-消息5示意示出消息发送合约的账户状态中的消息队列。FIG. 1 shows a schematic diagram of a cross-chain system based on the Fabric blockchain according to an embodiment of the present specification. As shown in Figure 1, the cross-chain system includes an endorsement node 11, a first client node 12, a second client node 13 and an ordering node 14 in the Fabric blockchain, and these nodes all correspond to specific node devices , hereinafter, the node refers to the corresponding node device. A business contract and a message sending contract are deployed in the endorsement node 11. The business contract is, for example, a cross-chain transfer contract, and the business contract includes a call of a message sending contract, and the message sending contract is used to send cross-chain messages. When a user in the Fabric blockchain wishes to perform a cross-chain transfer, the corresponding first client node 12 can send transaction 1 to at least one predetermined endorsement node (for example, including the endorsement node 11 ) in the Fabric blockchain In the proposal of transaction 1, the business contract is called, and the parameters related to the transfer are passed to the business contract, such as the blockchain identifier for receiving the transfer, the account for receiving the transfer, the transfer amount, the receiving contract account, and so on. After receiving the proposal of transaction 1, the endorsement node 11 pre-executes transaction 1, that is, pre-executes the business contract, records in the read-write set of pre-execution transaction 1: reads the account balance that initiates transaction 1, and reduces the account balance by any amount. The transfer amount is described, and a cross-chain message (message 1 in Figure 1) is generated. Message 1 includes, for example, the identifier of the sending blockchain, the identifier of the receiving blockchain, the sending account, the receiving account, the receiving contract account and the pairing of the message 1. The balance of the receiving account is increased by the amount, etc., and then the message sending contract is pre-executed, and message 1 is provided to the message sending contract. When pre-executing the message sending contract, "message 1" is added to the message queue recorded in the account status of the message sending contract in the above-mentioned read-write set. After completing the above pre-execution, the endorsement node 11 signs the generated read-write set, and sends the read-write set of transaction 1 and its signature back to the first client node 12 . After the first client node 12 collects the read-write set of each endorsement node and its signature, it verifies it based on the predetermined endorsement policy, and after the verification is passed, the information of the transaction 1 is packaged and sent to the ordering node 14. The ordering node 14 The received transactions (including transaction 1) are sorted and packaged into blocks based on predetermined rules, and the blocks are sent to a management node in the Fabric blockchain (not shown in Figure 1). The management node sends the block to each submission node in the Fabric blockchain, including, for example, the endorsement node 11, that is, the endorsement node 11 acts as both an endorsement node and a submission node. After receiving the block, the endorsement node 11 verifies the read-write set of transaction 1 based on the current world state, and after determining that transaction 1 is executable, updates the world state according to the write set in the read-write set, that is, updates the sending of transaction 1 account balance of the account, and add message 1 to the message queue in the account state of the message sending contract. Message 1 - Message 5 arranged in sequence in FIG. 1 schematically illustrate the message queue in the account state of the message sending contract.
第二客户端节点13用于在Fabric区块链11与其它区块链之间传递消息。与上文类似地,第二客户端节点13可通过向Fabric区块链11中的预定背书节点发送交易提案(例如图1中的交易m的提案,其中m为交易编号)以获取跨链消息。交易m中调用消息发送合约的查询函数,以进行对上述消息队列的查询。背书节点11在接收到交易m的提案之后,预执行交易m,即预执行查询函数,在消息发送合约的消息队列中读取消息1,然后,背书节点在交易m的读集中记录对该消息1的读取、以及在写集中记录对消息队列中的消息1的删除。在生成交易m的读写集之后,背书节点11对该读写集签名,并将该读写集及其签名发回给第二客户端节点13。第二客户端节点13在接收到各个背书节点发回的对交易m的响应之后,对各个响应进行验证,从而可从任一读写集中获取消息1。第二客户端节点13在对各个背书节点对交易m的响应进行验证之后,可打包交易m的交易信息,并将交易m的交易信息发送给排序节点14。The second client node 13 is used to transfer messages between the Fabric blockchain 11 and other blockchains. Similar to the above, the second client node 13 can obtain the cross-chain message by sending a transaction proposal (for example, the proposal of transaction m in FIG. 1 , where m is the transaction number) to a predetermined endorsement node in the Fabric blockchain 11 . . The query function of the message sending contract is called in transaction m to query the above message queue. After receiving the proposal of transaction m, the endorsement node 11 pre-executes transaction m, that is, pre-executes the query function, reads message 1 in the message queue of the message sending contract, and then records the message in the read set of transaction m. The read of 1, and the deletion of message 1 in the message queue are recorded in the write set. After generating the read-write set of transaction m, the endorsement node 11 signs the read-write set, and sends the read-write set and its signature back to the second client node 13 . After the second client node 13 receives the responses to the transaction m sent back by each endorsement node, it verifies each response, so that the message 1 can be obtained from any read-write set. After verifying the responses of each endorser node to transaction m, the second client node 13 can package the transaction information of transaction m, and send the transaction information of transaction m to the ordering node 14 .
排序节点14对接收的多个交易进行排序,并将该多个交易打包为区块,所述区块中例如包括交易m。之后,排序节点14将该区块发送给管理节点(图1中未示出),从而管理节点将该区块发送给每个提交节点(其中包括背书节点11)。背书节点在接收到交易m的交易信息之后,基于世界状态验证交易m是否可以执行,在验证交易m可执行的情况中,基于交易m的读写集更新世界状态,即在消息发送合约的账户状态中的消 息队列中删除消息1。The sorting node 14 sorts the received multiple transactions, and packs the multiple transactions into a block, for example, the block includes transaction m. Afterwards, the ordering node 14 sends the block to the management node (not shown in FIG. 1 ), which in turn sends the block to each submitting node (including the endorsing node 11). After receiving the transaction information of transaction m, the endorsement node verifies whether transaction m can be executed based on the world state. In the case of verifying that transaction m is executable, the world state is updated based on the read-write set of transaction m, that is, in the account of the message sending contract. Message 1 is deleted from the message queue in the state.
可以理解,上述参考图1的描述只是示意性的,而不是用于限制本说明书实施例。例如,所述业务合约不限于为跨链转账合约,所述消息1不限于具有如上文上述的形式。下文将详细描述根据本说明书实施例的跨链提供消息的方法。It can be understood that the above description with reference to FIG. 1 is only illustrative, and is not used to limit the embodiments of the present specification. For example, the business contract is not limited to be a cross-chain transfer contract, and the message 1 is not limited to the above-mentioned form. The method for providing messages across chains according to embodiments of the present specification will be described in detail below.
图2示出根据本说明书实施例的在Fabric区块链中执行交易1的方法流程图。图2中示出了由第一客户端节点12、背书节点11和排序节点14共同执行该方法。FIG. 2 shows a flowchart of a method for executing transaction 1 in the Fabric blockchain according to an embodiment of the present specification. It is shown in FIG. 2 that the method is performed jointly by the first client node 12 , the endorsing node 11 and the ordering node 14 .
首先,在步骤S201,第一客户端节点12向预定背书节点发送交易1的提案,所述预定背书节点中包括背书节点11。First, in step S201, the first client node 12 sends a proposal of transaction 1 to a predetermined endorsement node, where the predetermined endorsement node includes the endorsement node 11.
在Fabric区块链的各个通道中,预设了背书节点和背书策略,并且仅有背书节点中才部署有链码,从而只有背书节点才能够预执行各个链码。客户端节点通过向预设的至少一个背书节点发送交易提案,而使得背书节点预执行交易。如上文上述,第一客户端节点12向背书节点11发送用于进行跨链转账的交易1的提案,在该提案中,包括对业务合约的调用,所述业务合约中包括对消息发送合约的调用,以用于发送跨链消息。In each channel of the Fabric blockchain, the endorsement nodes and endorsement policies are preset, and only the endorsement nodes are deployed with chaincodes, so that only the endorsement nodes can pre-execute each chaincode. The client node makes the endorsement node pre-execute the transaction by sending a transaction proposal to at least one preset endorsement node. As mentioned above, the first client node 12 sends a proposal for transaction 1 for cross-chain transfer to the endorsement node 11, and the proposal includes a call to a business contract, and the business contract includes a call to the message sending contract. Called to send cross-chain messages.
在步骤S202,背书节点11预执行交易1,生成交易1的读写集。In step S202, the endorsement node 11 pre-executes transaction 1, and generates a read-write set of transaction 1.
Fabric区块链中的背书节点根据相对于背书节点预设的流程执行背书过程。具体是,背书节点11在接收到交易1之后,预执行交易1,所述预执行即模拟执行交易1,但是并不将获取的交易执行结果(即对世界状态的改变)存入本地账本中,而是生成与交易1对应的读写集,并将所述执行造成的对世界状态的改变存入到该读写集中。背书节点11在开始预执行交易1之后,预执行业务合约,该预执行过程例如包括对发送交易1提案的账户1的账户余额的读取,以及将该账户1的余额减少转账金额,因此,在交易1的读集中记录账户1的账户余额,在交易1的写集中记录账户1在减少转账余额之后的余额。然后,背书节点11基于业务合约中的程序生成消息1,执行业务合约中调用的消息发送合约,并向消息发送合约提供消息1。在对消息发送合约的执行过程中,在交易1的写集中记录在消息发送合约的账户状态中的消息队列中增加的消息1,从而完成对交易1的预执行。The endorsement nodes in the Fabric blockchain perform the endorsement process according to the preset process relative to the endorsement nodes. Specifically, after receiving the transaction 1, the endorsement node 11 pre-executes the transaction 1, and the pre-execution is the simulated execution of the transaction 1, but does not store the acquired transaction execution result (ie, the change to the world state) into the local ledger , but generate a read-write set corresponding to transaction 1, and store the changes to the world state caused by the execution into the read-write set. After the endorsing node 11 starts to pre-execute transaction 1, it pre-executes the business contract. The pre-execution process includes, for example, reading the account balance of account 1 that sends the transaction 1 proposal, and reducing the balance of this account 1 by the transfer amount. Therefore, The account balance of account 1 is recorded in the read set of transaction 1, and the balance of account 1 after reducing the transfer balance is recorded in the write set of transaction 1. Then, the endorsement node 11 generates the message 1 based on the program in the business contract, executes the message sending contract called in the business contract, and provides the message 1 to the message sending contract. During the execution of the message sending contract, the message 1 added to the message queue in the account state of the message sending contract is recorded in the write set of transaction 1, thereby completing the pre-execution of transaction 1.
在步骤S203,背书节点11向第一客户端节点12发送交易1的读写集。In step S203, the endorsement node 11 sends the read-write set of transaction 1 to the first client node 12.
在完成对交易1的预执行之后,背书节点对生成的交易1的读写集签名,并将该读写集及其签名返回给第一客户端节点12。After completing the pre-execution of transaction 1, the endorsement node signs the generated read-write set of transaction 1, and returns the read-write set and its signature to the first client node 12.
在步骤S204,第一客户端节点12验证交易1的读写集。In step S204, the first client node 12 verifies the read-write set of transaction 1.
第一客户端节点12从至少一个背书节点接收到交易1的读写集及其签名之后,首先通过各个背书节点的公钥验证各个读写集的签名是否为各个背书节点的签名,然后,基于预定背书策略对所述读写集进行验证,例如,所述预定背书策略为需要至少3个背书节点的背书、需要特定多个背书节点的背书等等。如果验证通过,则执行后续的步骤S205,如果验证不通过,则结束对交易1的处理。After receiving the read-write set of transaction 1 and its signature from at least one endorsement node, the first client node 12 first verifies whether the signature of each read-write set is the signature of each endorser node through the public key of each endorser node, and then, based on The predetermined endorsement policy verifies the read-write set, for example, the predetermined endorsement policy is an endorsement requiring at least three endorsing nodes, an endorsement requiring a specific number of endorsing nodes, and so on. If the verification is passed, the subsequent step S205 is executed, and if the verification is not passed, the processing of the transaction 1 is ended.
在一种实施方式中,背书节点11中包括安全执行环境(TEE)。第一客户端节点12可对背书节点11中的TEE进行验证。具体是,第一客户端节点12可向TEE发送验证请求。TEE在接收所述验证请求之后,基于其内部机制生成认证信息,并将该认证信息及TEE的硬件公钥发送给第一客户端节点12。所述认证信息例如包括所述TEE的签名信息、硬件信息和软件信息等。其中,所述签名信息例如通过TEE的硬件密钥生成;所述硬件信息例如包括,各种硬件的指标,比如CPU主频,内存容量等等;所述软件信息包括各个程序的代码哈希值、代码名称、版本、运行日志等。如本领域技术人员所知,TEE可通过内存硬件执行对其中运行程序的“测量”,例如获取该程序的代码哈希值、该程序在特定执行点的内存占有的哈希值等等,并在所述认证信息中包括对所述程序的“测量”信息,由于该“测量”信息由该TEE自身实体(内存硬件)执行,而不涉及任何软件、操作系统,因此是真实可信的。第一客户端节点12在接收到所述认证信息之后,可把所述认证信息发送给TEE的远程认证服务器,从而从所述服务器接收到对所述TEE的验证结果。所述验证结果包括所述TEE的身份验证、及对所述TEE内部执行程序的验证等等。从而,第一客户端节点12基于该验证结果可确定TEE是可信的,TEE的处理结果是可信的。同时,第一客户端节点12在本地保存TEE的硬件公钥,以用于后续对TEE的签名的验证。In one embodiment, a secure execution environment (TEE) is included in the endorsement node 11 . The first client node 12 may verify the TEE in the endorsing node 11 . Specifically, the first client node 12 may send an authentication request to the TEE. After receiving the verification request, the TEE generates authentication information based on its internal mechanism, and sends the authentication information and the hardware public key of the TEE to the first client node 12 . The authentication information includes, for example, signature information, hardware information, software information, and the like of the TEE. Wherein, the signature information is generated by, for example, the hardware key of the TEE; the hardware information includes, for example, various hardware indicators, such as CPU frequency, memory capacity, etc.; the software information includes the code hash value of each program , code name, version, run log, etc. As is known to those skilled in the art, a TEE can perform "measurements" of a program running in it through memory hardware, such as obtaining a code hash of the program, a hash of the program's memory occupancy at a particular point of execution, etc., and The authentication information includes "measurement" information for the program, which is authentic and credible because the "measurement" information is executed by the TEE's own entity (memory hardware) without involving any software or operating system. After receiving the authentication information, the first client node 12 may send the authentication information to the remote authentication server of the TEE, so as to receive the verification result of the TEE from the server. The verification result includes the identity verification of the TEE, the verification of the internal execution program of the TEE, and the like. Therefore, based on the verification result, the first client node 12 can determine that the TEE is credible, and the processing result of the TEE is credible. At the same time, the first client node 12 locally saves the hardware public key of the TEE for subsequent verification of the signature of the TEE.
在背书节点11中包括安全执行环境(TEE)的情况中,该背书节点11是可信的,因此,第一客户端节点12可仅从背书节点11接收交易1的读写集,并在使用TEE的公钥对该读写集的签名验证通过之后,即可确认该读写集为真实的读写集。In the case where a secure execution environment (TEE) is included in the endorsing node 11, the endorsing node 11 is trusted, so the first client node 12 can only receive the read-write set of transaction 1 from the endorsing node 11, and use the After the signature of the read-write set is verified by the public key of the TEE, it can be confirmed that the read-write set is a real read-write set.
在步骤S205,第一客户端节点12将交易1的交易信息发送给排序节点14。In step S205 , the first client node 12 sends the transaction information of transaction 1 to the ordering node 14 .
第一客户端节点12在对交易1的读写集验证通过之后,打包交易1的交易信息,该交易信息中包括交易1的提案、交易1的各个读写集及各个背书节点对相应的读写集的签名,之后,第一客户端节点12将交易1的交易信息发送给排序节点14,以用于进行入块。After the first client node 12 passes the verification of the read-write set of transaction 1, it packages the transaction information of transaction 1, and the transaction information includes the proposal of transaction 1, each read-write set of transaction 1 and the corresponding read-write set of each endorsement node. After writing the signature of the set, the first client node 12 sends the transaction information of transaction 1 to the ordering node 14 for block entry.
在步骤S206,排序节点14在接收交易1的交易信息之后,对已经接收的多个交易 排序,并将该多个交易打包成区块1。In step S206, after receiving the transaction information of transaction 1, the sorting node 14 sorts the multiple transactions that have been received, and packages the multiple transactions into block 1.
排序节点14可基于预定排序规则对多个交易进行排序,例如,可基于各个交易的提案发送时间对各个交易进行排序。在排序之后,排序节点14以上述排序顺序将多个交易各自的交易信息打包成例如区块1,所述区块1中包括交易1的交易信息。The ordering node 14 may order the plurality of transactions based on a predetermined ordering rule, for example, the transactions may be ordered based on their proposal sending time. After sorting, the sorting node 14 packages the respective transaction information of the plurality of transactions into, for example, a block 1 in the above-mentioned sorting order, and the block 1 includes the transaction information of the transaction 1 .
在步骤S207,排序节点14将区块1发送给多个提交节点,其中包括背书节点11。In step S207, the ordering node 14 sends the block 1 to a plurality of submitting nodes, including the endorsing node 11.
所述提交节点用于确定交易的执行状态、将交易入块,并根据交易的读写集更新世界状态,也就是说,提交节点中存储有Fabric区块链中的账本数据,该账本数据中包括区块和世界状态。由于背书节点11需要进行对账本数据的查询等操作,因此,背书节点11需要本身作为提交节点进行交易的入块,以更新本地的账本数据。The submission node is used to determine the execution state of the transaction, put the transaction into a block, and update the world state according to the read-write set of the transaction. That is to say, the submission node stores the ledger data in the Fabric blockchain. Includes block and world state. Since the endorsement node 11 needs to perform operations such as querying the ledger data, the endorsement node 11 needs to act as a submitting node to enter a transaction block to update the local ledger data.
在步骤S208,背书节点11确定交易1的执行状态。In step S208, the endorsement node 11 determines the execution status of transaction 1.
背书节点11在接收到区块1之后,需要按照区块1中各个交易的排列顺序依次处理各个交易。在处理交易1的交易信息时,背书节点11首先确定交易1的执行状态,即确定交易1是否可成功执行。具体是,背书节点11基于交易1的读写集和当前世界状态确定是否存在读写冲突,从而确定交易1是否可成功执行。例如,交易1的读写集中包括对账户1的余额的读取和更改,则背书节点11确定交易1的读写集中的在预执行时读取的账户1的余额在该读取之后有没有被排序在交易1之前的交易更改,如果存在该更改,则存在读冲突,该交易1就不能成功执行,如果不存在该更改,则说明不存在读写冲突,该交易1可成功执行。After receiving block 1, the endorsement node 11 needs to process each transaction in sequence according to the arrangement order of each transaction in block 1. When processing the transaction information of transaction 1, the endorsement node 11 first determines the execution status of transaction 1, that is, determines whether transaction 1 can be successfully executed. Specifically, the endorsement node 11 determines whether there is a read-write conflict based on the read-write set of transaction 1 and the current world state, so as to determine whether transaction 1 can be successfully executed. For example, if the read-write set of transaction 1 includes reading and modification of the balance of account 1, the endorsement node 11 determines whether the balance of account 1 read during pre-execution in the read-write set of transaction 1 has any value after the read. The transaction that is sorted before transaction 1 is changed. If there is this change, there is a read conflict, and the transaction 1 cannot be successfully executed. If there is no such change, it means that there is no read-write conflict, and the transaction 1 can be successfully executed.
在步骤S209,背书节点11在消息发送合约的账户状态中的消息队列中记录消息1。In step S209, the endorsement node 11 records the message 1 in the message queue in the account state of the message sending contract.
背书节点11在确定交易1可成功执行之后,基于交易1的读写集更改世界状态,并在Fabric区块链中存入交易1的交易信息及其执行状态(即成功执行状态)。如上文所述,交易1的读写集中包括对账户1的余额的更改和对消息队列的更改,因此,背书节点11在本地存储该更改,即改变世界状态,也就是说,进行对账户1的余额的更改,并在消息发送合约的账户状态中的消息队列中记录消息1。在进行该记录之后,Fabric区块链中对交易1的处理结束,从而,通过对交易1的处理,在Fabric区块链中存入消息1作为待跨链发送的消息。After the endorsement node 11 determines that the transaction 1 can be successfully executed, it changes the world state based on the read-write set of the transaction 1, and stores the transaction information of the transaction 1 and its execution status (ie, the successful execution status) in the Fabric blockchain. As mentioned above, the read-write set of transaction 1 includes changes to account 1's balance and changes to the message queue, therefore, the endorsing node 11 stores the changes locally, ie changes the world state, that is, makes changes to account 1 The change in the balance of the message 1 is logged in the message queue in the account state of the message sending contract. After the record is made, the processing of transaction 1 in the Fabric blockchain ends, and thus, through the processing of transaction 1, message 1 is stored in the Fabric blockchain as a message to be sent across chains.
图3示出根据本说明书实施例的在Fabric区块链中执行交易m的方法流程图。图3中示出了由第二客户端节点13、背书节点11和排序节点14共同执行该方法。FIG. 3 shows a flowchart of a method for executing transaction m in the Fabric blockchain according to an embodiment of the present specification. It is shown in FIG. 3 that the method is performed jointly by the second client node 13 , the endorsing node 11 and the ordering node 14 .
在步骤S301,第二客户端节点13发送交易m的提案。In step S301, the second client node 13 sends a proposal for transaction m.
第二客户端节点13中未存储有Fabric区块链的账本数据。第二客户端节点13通过向Fabric区块链中的背书节点发送特定交易提案以从背书节点获取跨链消息。具体是,例如,如图1所示,第二客户端节点13可向Fabric区块链中的预定至少一个背书节点(其中包括背书节点11)发送交易m的提案,该交易m的提案中调用消息发送合约中包括的查询函数,该查询函数用于在上述消息队列中读取跨链消息。The second client node 13 does not store the ledger data of the Fabric blockchain. The second client node 13 obtains the cross-chain message from the endorsing node by sending a specific transaction proposal to the endorsing node in the Fabric blockchain. Specifically, for example, as shown in FIG. 1 , the second client node 13 may send a proposal for transaction m to at least one predetermined endorsement node (including the endorsement node 11 ) in the Fabric blockchain, and the proposal for transaction m calls The query function included in the message sending contract is used to read cross-chain messages in the above message queue.
在步骤S302,背书节点11预执行交易m,生成交易m的读写集,所述读写集中包括消息1。In step S302, the endorsement node 11 pre-executes the transaction m, and generates a read-write set of the transaction m, and the read-write set includes the message 1.
当背书节点11预执行交易m时,预执行交易m中的消息发送合约中的查询函数,该查询函数中可预设允许查询账户,以验证发送交易m的提案的账户是否为允许的查询账户。因此,在预执行查询函数时,首先对发送交易m的提案的账户进行验证,如果验证失败,则返回查询失败,如果验证成功,则从消息发送合约的账户状态中的消息队列中读取跨链消息。可以理解,在不需要对查询账户进行验证的情况中,在预执行查询函数时,可直接从消息发送合约的账户状态中的消息队列中读取跨链消息。When the endorsement node 11 pre-executes the transaction m, it pre-executes the query function in the message sending contract in the transaction m. The query function can be preset to allow the query account to verify whether the account that sends the proposal of the transaction m is an allowed query account. . Therefore, when the query function is pre-executed, the account that sends the proposal of transaction m is first verified. If the verification fails, the query failure is returned. If the verification succeeds, the cross-link is read from the message queue in the account status of the message sending contract. chain message. It can be understood that in the case where the query account does not need to be verified, when the query function is pre-executed, the cross-chain message can be directly read from the message queue in the account status of the message sending contract.
在一种实施方式中,所述查询函数中例如包括GetProposer接口,在预执行查询函数时,首先通过调用GetProposer获取提案者的证书,该证书中包括提案者的账户、公钥等信息,从而可基于查询函数中预设的账户或公钥验证该提案者是否被允许进行查询。在一种实施方式中,所述查询函数中例如包括GetCreator接口,在执行查询函数时,首先通过调用GetCreator获取提案者的账户,然后基于查询函数中预设的允许账户验证该提案者的账户是否为允许账户。In one embodiment, the query function includes, for example, the GetProposer interface. When the query function is pre-executed, the certificate of the proposer is first obtained by calling GetProposer. The certificate includes the account, public key and other information of the proposer, so that the Verify that the proposer is allowed to query based on the account or public key preset in the query function. In one embodiment, the query function includes, for example, the GetCreator interface. When the query function is executed, the proposer's account is first obtained by calling GetCreator, and then whether the proposer's account is verified based on the allowable account preset in the query function for allowed accounts.
所述查询函数中对跨链消息的读取方式可根据需求进行设置,例如,可预设,在每次预执行查询函数时,从消息队列中读取最早的消息,参考图1,假设当前消息1为最早记录的消息,消息2-消息5都是在消息1之后记录的消息。因此,在该次执行查询函数时,读取消息队列中的消息1。可以理解,所述查询函数不限于读取最老的1个消息,而可以预设为读取消息队列中最老的预定数目个(例如5个等等)消息,或者可以预设为读取消息队列中最新的预定数目个消息,或者可以预设为读取指定序号的消息,所述指定序号可在调用查询函数时作为传入参数传入给查询函数,或者可以预设为读取指定内容的消息,所述指定内容为所述消息中包括的内容,如接受合约账号、接收区块链标识等等,所述指定内容也可以在调用查询函数时作为传入参数传入给查询函数。在通过上述方式从消息队列中读取了例如消息1之后,背书节点11在相对于交易m生成的读写集的读集中记录消息1。The reading method of cross-chain messages in the query function can be set according to requirements. For example, it can be preset that each time the query function is pre-executed, the oldest message is read from the message queue. Referring to Figure 1, assuming that the current Message 1 is the earliest recorded message, and message 2 to message 5 are all messages recorded after message 1. Therefore, when the query function is executed this time, message 1 in the message queue is read. It can be understood that the query function is not limited to reading the oldest message, but can be preset to read the oldest predetermined number (for example, 5, etc.) messages in the message queue, or can be preset to read The latest predetermined number of messages in the message queue, or it can be preset to read the message with the specified sequence number, and the specified sequence number can be passed to the query function as an incoming parameter when calling the query function, or it can be preset to read the specified sequence number. The content of the message, the specified content is the content included in the message, such as accepting the contract account number, receiving the blockchain identifier, etc. The specified content can also be passed to the query function as an incoming parameter when calling the query function. . After reading, for example, message 1 from the message queue in the above-described manner, the endorsement node 11 records message 1 in the read set relative to the read-write set generated by transaction m.
查询函数中还可以预设在进行对跨链消息的读取之后预修改消息发送合约的状态,即并不立即修改世界状态,而是在写集中记录对世界状态的更改。具体是,在一种实施方式中,在例如读取消息队列中的消息1之后,在交易m的写集中记录删除消息队列中的消息1,从而背书节点11在提交交易m之后将根据该写集记录的内容删除消息队列中的消息1,使得在下一次执行查询函数时不会重复读取消息1。在一种实施方式中,在读取消息1之后,可在写集中记录对消息1进行标记,以指示链下设备12已读取消息1,在该实施方式中,背书节点11在提交交易m之后将根据该写集中的记录对消息1进行标记,从而第二客户端节点13可重复读取消息1,或者,在不止一个客户端节点从背书节点11读取跨链消息的情况中,在第二客户端节点13读取消息1之后,其它客户端节点还可以读取消息1。The query function can also be preset to pre-modify the state of the message sending contract after reading the cross-chain message, that is, not to modify the world state immediately, but to record the changes to the world state in the write set. Specifically, in one embodiment, after, for example, reading the message 1 in the message queue, record and delete the message 1 in the message queue in the write set of the transaction m, so that the endorsement node 11 will, after submitting the transaction m, record the message 1 according to the write set of the transaction m. The content of the set record deletes message 1 in the message queue so that message 1 will not be read repeatedly the next time the query function is executed. In one embodiment, after reading message 1, message 1 may be marked in the write set record to indicate that off-chain device 12 has read message 1, in this embodiment, the endorsing node 11 is submitting transaction m Message 1 will then be marked according to the records in the write set, so that the second client node 13 can read the message 1 repeatedly, or, in the case of more than one client node reading the cross-chain message from the endorsing node 11, at After the second client node 13 reads the message 1, other client nodes can also read the message 1.
背书节点11通过如上所述预执行交易m,从而生成与交易m对应的读写集,并且该读写集中包括读取的消息1。The endorsement node 11 pre-executes the transaction m as described above, thereby generating a read-write set corresponding to the transaction m, and the read-write set includes the read message 1 .
在步骤S303,背书节点11向第二客户端节点13发送交易m的读写集。In step S303, the endorsement node 11 sends the read-write set of the transaction m to the second client node 13.
在步骤S304,第二客户端节点13验证交易m的读写集。In step S304, the second client node 13 verifies the read-write set of the transaction m.
所述步骤S303和步骤S304可参考上文对步骤S203和步骤S204的描述,在此不再赘述。For the step S303 and the step S304, reference may be made to the description of the step S203 and the step S204 above, which will not be repeated here.
在步骤S305,第二客户端节点13从交易m的读写集中获取消息1。In step S305, the second client node 13 obtains the message 1 from the read-write set of the transaction m.
根据上文的描述,背书节点11在预执行交易m时,将从消息队列读取的消息1记录到读集中,因此,第二客户端节点13可读取交易m的读写集中的读集的内容,该内容即为消息1的内容。According to the above description, when the endorsement node 11 pre-executes the transaction m, it records the message 1 read from the message queue into the read set. Therefore, the second client node 13 can read the read set in the read-write set of the transaction m. The content is the content of message 1.
在一种实施方式中,第二客户端节点13在获取消息1之后,可基于消息1的预定数据结构从消息1中确定接收链标识,从而可将该交易m的各个读写集及其签名提供给相应的接收链,从而相应的接收链可基于各个读写集的签名对交易m的各个读写集进行验证,并根据预定背书策略确定所述各个读写集是否可信,在验证各个读写集可信的情况中,可从中获取消息1。In one embodiment, after acquiring the message 1, the second client node 13 can determine the receiving chain identifier from the message 1 based on the predetermined data structure of the message 1, so that each read-write set of the transaction m and its signature can be obtained Provided to the corresponding receiving chain, so that the corresponding receiving chain can verify each read-write set of transaction m based on the signature of each read-write set, and determine whether the each read-write set is credible according to the predetermined endorsement strategy, and then verify each read-write set. If the read-write set is trusted, message 1 can be obtained from it.
在一种实施方式中,在第二客户端节点13为可信节点的情况中,第二客户端节点13在获取消息1之后,从消息1中确定接收链标识,从而将消息1直接提供给相应的接收链。In one embodiment, in the case where the second client node 13 is a trusted node, after acquiring the message 1, the second client node 13 determines the receiving chain identifier from the message 1, so as to directly provide the message 1 to the corresponding receive chain.
在步骤S306,第二客户端节点13将交易m的交易信息发送给排序节点14。In step S306, the second client node 13 sends the transaction information of the transaction m to the ordering node 14.
在步骤S307,排序节点14对多个交易排序,生成区块2。In step S307, the sorting node 14 sorts the plurality of transactions to generate block 2.
在步骤S308,排序节点14将区块2发送给多个提交节点,其中包括背书节点11。In step S308, the ordering node 14 sends the block 2 to a plurality of submitting nodes, including the endorsing node 11.
在步骤S309,背书节点11确定交易m的执行状态。In step S309, the endorsement node 11 determines the execution status of the transaction m.
步骤S306-S309可参考上文对步骤S205-S208的描述,在此不再赘述。For steps S306-S309, reference may be made to the description of steps S205-S208 above, and details are not repeated here.
在步骤S310,背书节点11在消息发送合约的账户状态中的消息队列中删除消息1。In step S310, the endorsement node 11 deletes message 1 from the message queue in the account state of the message sending contract.
背书节点11在确定交易m可成功执行的情况中,在Fabric区块链中存入交易m的交易信息和交易m的执行状态,并根据交易m的写集更改世界状态。例如,所述写集中记录了删除所述消息队列中的消息1,因此,背书节点执行对所述消息队列中的消息1的删除,如果如上文所述,所述写集中记录了对消息1进行标记,则背书节点对应地执行对消息1的标记。通过在Fabric区块链中提交交易m,从而可根据交易m的执行更改世界状态,从而有助于第二客户端节点13后续对消息队列的读取。When the endorsement node 11 determines that the transaction m can be successfully executed, it stores the transaction information of the transaction m and the execution state of the transaction m in the Fabric blockchain, and changes the world state according to the write set of the transaction m. For example, deletion of message 1 in the message queue is recorded in the write set. Therefore, the endorsement node performs deletion of message 1 in the message queue. If, as described above, the write set records the deletion of message 1 in the message queue. If marking is performed, the endorsing node will perform the marking of message 1 correspondingly. By submitting the transaction m in the Fabric blockchain, the world state can be changed according to the execution of the transaction m, thereby facilitating the subsequent reading of the message queue by the second client node 13 .
图4示出根据本说明书实施例的一种提供跨链消息的装置400,所述装置400部署于Fabric区块链的背书节点,包括:第一接收单元401,配置为,从Fabric区块链中接收第一交易的交易信息,所述交易信息中包括所述第一交易的交易提案和至少一个读写集,所述第一交易的交易提案中调用所述第一合约、并向所述第一合约提供第一跨链消息;第一确定单元402,配置为,确定所述第一交易的执行状态;记录单元403,配置为,在确定所述第一交易可成功执行的情况中,在所述第一合约的账户状态中的消息队列中记录所述第一跨链消息;第二接收单元404,配置为,从客户端节点接收第二交易的交易提案,所述第二交易中调用所述第一合约中的查询函数;预执行单元405,配置为,预执行所述第二交易,以从所述消息队列中读取所述第一跨链消息;生成单元406,配置为,生成所述第二交易的读写集,所述读写集中包括所述第一跨链消息;发送单元407,配置为,将所述第二交易的读写集发送给所述客户端节点。FIG. 4 shows an apparatus 400 for providing a cross-chain message according to an embodiment of the present specification. The apparatus 400 is deployed on an endorsement node of the Fabric blockchain, and includes: a first receiving unit 401 configured to receive data from the Fabric blockchain The transaction information of the first transaction is received in the transaction information, and the transaction information includes the transaction proposal of the first transaction and at least one read-write set. The first contract provides the first cross-chain message; the first determining unit 402 is configured to determine the execution state of the first transaction; the recording unit 403 is configured to, in the case of determining that the first transaction can be successfully executed, Record the first cross-chain message in the message queue in the account state of the first contract; the second receiving unit 404 is configured to receive a transaction proposal of the second transaction from the client node, in the second transaction The query function in the first contract is called; the pre-execution unit 405 is configured to pre-execute the second transaction to read the first cross-chain message from the message queue; the generation unit 406 is configured to , generating a read-write set of the second transaction, and the read-write set includes the first cross-chain message; the sending unit 407 is configured to send the read-write set of the second transaction to the client node .
在一种实施方式中,所述装置400还包括,第三接收单元408,配置为,在将所述第二交易的读写集发送给所述客户端节点之后,从Fabric区块链中接收第二交易的交易信息,所述第二交易的交易信息中包括所述第二交易的交易提案和至少一个读写集;第二确定单元409,配置为,确定所述第二交易的执行状态;更改单元410,配置为,在确定所述第二交易可成功执行的情况中,在所述消息队列中更改所述第一跨链消息的状态。In an embodiment, the apparatus 400 further includes a third receiving unit 408, configured to, after sending the read-write set of the second transaction to the client node, receive from the Fabric blockchain Transaction information of the second transaction, the transaction information of the second transaction includes a transaction proposal of the second transaction and at least one read-write set; the second determining unit 409 is configured to determine the execution state of the second transaction ; The changing unit 410 is configured to, in the case of determining that the second transaction can be executed successfully, change the state of the first cross-chain message in the message queue.
在一种实施方式中,所述第一合约中调用用于获取提案发起账户相关信息的预定链 码,所述预执行单元405包括,获取子单元4051,配置为,通过预执行所述预定链码获取所述第二交易的提案发起账户,验证子单元4052,配置为,验证所述提案发起账户是否为预定账户,读取子单元4053,配置为,在所述提案发起账户为预定账户的情况中,从所述消息队列中读取所述第一跨链消息。In one embodiment, the first contract invokes a predetermined chain code for obtaining information about the account that initiates the proposal, and the pre-execution unit 405 includes an obtaining sub-unit 4051 configured to pre-execute the predetermined chain by pre-executing the predetermined chain code. The code obtains the proposal initiating account of the second transaction, the verification subunit 4052 is configured to verify whether the proposal initiating account is a predetermined account, and the reading subunit 4053 is configured to, when the proposal initiating account is a predetermined account In this case, the first cross-chain message is read from the message queue.
图5示出根据本说明书实施例的一种获取跨链消息的装置500,所述装置500部署于Fabric区块链的客户端节点,包括:第一发送单元51,配置为,向Fabric区块链的至少一个背书节点发送第二交易的交易提案,所述第二交易的交易提案中调用第一合约中的查询函数,所述第一合约的账户状态中包括跨链消息的消息队列,所述查询函数用于读取所述消息队列中的跨链消息;接收单元52,配置为,从所述至少一个背书节点分别接收所述第二交易的读写集,各个所述读写集中包括所述消息队列中的第一跨链消息。FIG. 5 shows an apparatus 500 for acquiring cross-chain messages according to an embodiment of the present specification. The apparatus 500 is deployed on a client node of the Fabric block chain, and includes: a first sending unit 51 configured to send a message to the Fabric block chain. At least one endorsement node of the chain sends a transaction proposal of the second transaction, the query function in the first contract is called in the transaction proposal of the second transaction, and the account status of the first contract includes the message queue of cross-chain messages, so The query function is used to read the cross-chain message in the message queue; the receiving unit 52 is configured to respectively receive the read-write set of the second transaction from the at least one endorsement node, and each of the read-write sets includes The first cross-chain message in the message queue.
在一种实施方式中,所述装置500还包括,验证单元53,配置为,在从所述至少一个对等节点分别接收所述第二交易的读写集之后,基于预定背书策略对各个所述读写集进行验证;第二发送单元54,配置为,在验证通过之后,将第二交易的交易信息发送给所述Fabric区块链中的排序节点,所述第二交易的交易信息包括所述第二交易的交易提案和各个所述读写集。In one embodiment, the apparatus 500 further includes a verification unit 53, configured to, after receiving the read-write set of the second transaction from the at least one peer node respectively, verify each transaction based on a predetermined endorsement policy. The read-write set is verified; the second sending unit 54 is configured to, after the verification is passed, send the transaction information of the second transaction to the ordering node in the Fabric blockchain, where the transaction information of the second transaction includes The transaction proposal of the second transaction and each of the read and write sets.
在一种实施方式中,所述第二交易中以查询参数为传入参数调用第一合约中的查询函数,所述查询参数用于指示所述第一跨链消息。In an implementation manner, the query function in the first contract is called with a query parameter as an incoming parameter in the second transaction, and the query parameter is used to indicate the first cross-chain message.
在一种实施方式中,所述第一发送单元51还配置为,向Fabric区块链的第一背书节点发送第二交易的交易提案,所述第一背书节点中包括TEE。In an embodiment, the first sending unit 51 is further configured to send a transaction proposal of the second transaction to a first endorsement node of the Fabric blockchain, where the first endorsement node includes a TEE.
本说明书另一方面提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行上述任一项由Fabric区块链的背书节点执行的方法。Another aspect of the present specification provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed in a computer, the computer is made to execute any of the above-mentioned methods executed by an endorsement node of the Fabric blockchain .
本说明书另一方面提供一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现上述任一项由Fabric区块链的背书节点执行的方法。Another aspect of the present specification provides a computing device, including a memory and a processor, where executable code is stored in the memory, and when the processor executes the executable code, any one of the above-mentioned processing by the Fabric blockchain is implemented. The method executed by the endorsing node.
本说明书另一方面提供一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行上述任一项由Fabric区块链的客户端节点执行的方法。Another aspect of the present specification provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is made to execute any of the above-mentioned functions executed by the client node of the Fabric blockchain. method.
本说明书另一方面提供一种计算设备,包括存储器和处理器,所述存储器中存储有 可执行代码,所述处理器执行所述可执行代码时,实现上述任一项由Fabric区块链的客户端节点执行的方法。Another aspect of the present specification provides a computing device, including a memory and a processor, where executable code is stored in the memory, and when the processor executes the executable code, any one of the above-mentioned processing by the Fabric blockchain is implemented. The method executed by the client node.
通过根据本说明书实施例的传递跨链消息的方案,在Fabric区块链中部署的消息发送合约的账户状态中保存跨链消息,并通过调用消息发送合约的查询函数来查询账户状态中的跨链消息,提供了一种新颖的在Fabric区块链中查询区块链账本的方法,通过该方法,还可以通过在查询函数设置验证程序,还可以验证查询账户是否为允许的预设账户,从而提高了安全性。Through the solution for transmitting cross-chain messages according to the embodiments of this specification, the cross-chain message is saved in the account state of the message sending contract deployed in the Fabric blockchain, and the cross-chain message in the account state is queried by calling the query function of the message sending contract. Chain message provides a novel method of querying the blockchain ledger in the Fabric blockchain. Through this method, you can also set a verification program in the query function, and you can also verify whether the query account is an allowed preset account. Thereby improving security.
需要理解,本文中的“第一”,“第二”等描述,仅仅为了描述的简单而对相似概念进行区分,并不具有其他限定作用。It should be understood that the descriptions of "first", "second" and so on herein are only for the simplicity of description to distinguish similar concepts, and have no other limiting effect.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for related parts, please refer to the partial descriptions of the method embodiments.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that in the embodiments and still achieve desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
本领域普通技术人员应该还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。本领域普通技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。其中,软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。Those of ordinary skill in the art should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software or a combination of the two, in order to clearly illustrate the hardware and software interchangeability, the components and steps of each example have been generally described in terms of functions in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Persons of ordinary skill in the art may use different methods of implementing the described functionality for each particular application, but such implementations should not be considered beyond the scope of this application. Wherein, the software module can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or technical fields in any other form of storage medium known in the art.
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发 明的保护范围,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The specific embodiments described above further describe the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above descriptions are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims (18)

  1. 一种提供跨链消息的方法,所述方法由Fabric区块链的背书节点执行,包括:A method for providing cross-chain messages, the method being performed by an endorsement node of the Fabric blockchain, comprising:
    从Fabric区块链中接收第一交易的交易信息,所述交易信息中包括所述第一交易的交易提案和至少一个读写集,所述第一交易的交易提案中调用第一合约、并向所述第一合约提供第一跨链消息;Receive transaction information of the first transaction from the Fabric blockchain, the transaction information includes a transaction proposal of the first transaction and at least one read-write set, the transaction proposal of the first transaction calls the first contract, and providing the first cross-chain message to the first contract;
    确定所述第一交易的执行状态;determining the execution status of the first transaction;
    在确定所述第一交易可成功执行的情况中,在所述第一合约的账户状态中的消息队列中记录所述第一跨链消息;In the case of determining that the first transaction can be successfully executed, recording the first cross-chain message in the message queue in the account state of the first contract;
    从客户端节点接收第二交易的交易提案,所述第二交易中调用所述第一合约中的查询函数;Receive a transaction proposal of the second transaction from the client node, and the query function in the first contract is called in the second transaction;
    预执行所述第二交易,以从所述消息队列中读取所述第一跨链消息;pre-executing the second transaction to read the first cross-chain message from the message queue;
    生成所述第二交易的读写集,所述读写集中包括所述第一跨链消息;generating a read-write set of the second transaction, where the read-write set includes the first cross-chain message;
    将所述第二交易的读写集发送给所述客户端节点。Send the read-write set of the second transaction to the client node.
  2. 根据权利要求1所述的方法,还包括,在将所述第二交易的读写集发送给所述客户端节点之后,从Fabric区块链中接收第二交易的交易信息,所述第二交易的交易信息中包括所述第二交易的交易提案和至少一个读写集;确定所述第二交易的执行状态;在确定所述第二交易可成功执行的情况中,在所述消息队列中更改所述第一跨链消息的状态。The method of claim 1, further comprising, after sending the read-write set of the second transaction to the client node, receiving transaction information of the second transaction from the Fabric blockchain, the second transaction The transaction information of the transaction includes the transaction proposal of the second transaction and at least one read-write set; determining the execution status of the second transaction; in the case of determining that the second transaction can be successfully executed, in the message queue to change the state of the first cross-chain message.
  3. 根据权利要求1或2所述的方法,其中,所述第一合约中调用用于获取提案发起账户相关信息的预定链码,预执行第二交易还包括,通过预执行所述预定链码获取所述第二交易的提案发起账户,验证所述提案发起账户是否为预定账户,在所述提案发起账户为预定账户的情况中,从所述消息队列中读取所述第一跨链消息。The method according to claim 1 or 2, wherein the first contract invokes a predetermined chaincode for acquiring the relevant information of the proposal initiating account, and pre-executing the second transaction further comprises: acquiring by pre-executing the predetermined chain code The proposal initiating account of the second transaction verifies whether the proposal initiating account is a predetermined account, and in the case where the proposal initiating account is a predetermined account, reads the first cross-chain message from the message queue.
  4. 一种获取跨链消息的方法,所述方法由Fabric区块链的客户端节点执行,包括:A method for obtaining cross-chain messages, the method is executed by a client node of the Fabric blockchain, including:
    向Fabric区块链的至少一个背书节点发送第二交易的交易提案,所述第二交易的交易提案中调用第一合约中的查询函数,所述第一合约的账户状态中包括跨链消息的消息队列,所述查询函数用于读取所述消息队列中的跨链消息;Send a transaction proposal of the second transaction to at least one endorsement node of the Fabric blockchain, the transaction proposal of the second transaction calls the query function in the first contract, and the account status of the first contract includes the cross-chain message. a message queue, where the query function is used to read cross-chain messages in the message queue;
    从所述至少一个背书节点分别接收所述第二交易的读写集,各个所述读写集中包括所述消息队列中的第一跨链消息。The read-write sets of the second transaction are respectively received from the at least one endorsing node, and each of the read-write sets includes the first cross-chain message in the message queue.
  5. 根据权利要求4所述的方法,还包括,在从所述至少一个对等节点分别接收所述第二交易的读写集之后,基于预定背书策略对各个所述读写集进行验证;在验证通过之后,将第二交易的交易信息发送给所述Fabric区块链中的排序节点,所述第二交易的交 易信息包括所述第二交易的交易提案和各个所述读写集。The method of claim 4, further comprising, after respectively receiving the read-write sets of the second transaction from the at least one peer node, verifying each of the read-write sets based on a predetermined endorsement policy; After passing, the transaction information of the second transaction is sent to the ordering node in the Fabric blockchain, where the transaction information of the second transaction includes the transaction proposal of the second transaction and each of the read-write sets.
  6. 根据权利要求4或5所述的方法,其中,所述第二交易中以查询参数为传入参数调用第一合约中的查询函数,所述查询参数用于指示所述第一跨链消息。The method according to claim 4 or 5, wherein in the second transaction, a query function in the first contract is called with a query parameter as an incoming parameter, and the query parameter is used to indicate the first cross-chain message.
  7. 根据权利要求4或5所述的方法,其中,向Fabric区块链的至少一个背书节点发送第二交易的交易提案包括,向Fabric区块链的第一背书节点发送第二交易的交易提案,所述第一背书节点中包括TEE。The method according to claim 4 or 5, wherein sending the transaction proposal of the second transaction to at least one endorsing node of the Fabric blockchain comprises sending the transaction proposal of the second transaction to the first endorsing node of the Fabric blockchain, The first endorsement node includes a TEE.
  8. 一种提供跨链消息的装置,所述装置部署于Fabric区块链的背书节点,包括:A device for providing cross-chain messages, the device is deployed on an endorsement node of the Fabric blockchain, including:
    第一接收单元,配置为,从Fabric区块链中接收第一交易的交易信息,所述交易信息中包括所述第一交易的交易提案和至少一个读写集,所述第一交易的交易提案中调用所述第一合约、并向所述第一合约提供第一跨链消息;The first receiving unit is configured to receive transaction information of the first transaction from the Fabric blockchain, where the transaction information includes a transaction proposal of the first transaction and at least one read-write set, the transaction of the first transaction Invoke the first contract in the proposal and provide the first cross-chain message to the first contract;
    第一确定单元,配置为,确定所述第一交易的执行状态;a first determining unit, configured to determine the execution state of the first transaction;
    记录单元,配置为,在确定所述第一交易可成功执行的情况中,在所述第一合约的账户状态中的消息队列中记录所述第一跨链消息;a recording unit, configured to record the first cross-chain message in a message queue in the account state of the first contract in the case of determining that the first transaction can be successfully executed;
    第二接收单元,配置为,从客户端节点接收第二交易的交易提案,所述第二交易中调用所述第一合约中的查询函数;a second receiving unit, configured to receive a transaction proposal of a second transaction from the client node, where the query function in the first contract is invoked in the second transaction;
    预执行单元,配置为,预执行所述第二交易,以从所述消息队列中读取所述第一跨链消息;a pre-execution unit, configured to pre-execute the second transaction to read the first cross-chain message from the message queue;
    生成单元,配置为,生成所述第二交易的读写集,所述读写集中包括所述第一跨链消息;a generating unit, configured to generate a read-write set of the second transaction, the read-write set including the first cross-chain message;
    发送单元,配置为,将所述第二交易的读写集发送给所述客户端节点。The sending unit is configured to send the read-write set of the second transaction to the client node.
  9. 根据权利要求8所述的装置,还包括,第三接收单元,配置为,在将所述第二交易的读写集发送给所述客户端节点之后,从Fabric区块链中接收第二交易的交易信息,所述第二交易的交易信息中包括所述第二交易的交易提案和至少一个读写集;第二确定单元,配置为,确定所述第二交易的执行状态;更改单元,配置为,在确定所述第二交易可成功执行的情况中,在所述消息队列中更改所述第一跨链消息的状态。The apparatus according to claim 8, further comprising a third receiving unit configured to receive the second transaction from the Fabric blockchain after sending the read-write set of the second transaction to the client node The transaction information of the second transaction includes a transaction proposal of the second transaction and at least one read-write set; a second determination unit, configured to determine the execution state of the second transaction; a modification unit, is configured to change the state of the first cross-chain message in the message queue in the case that it is determined that the second transaction can be executed successfully.
  10. 根据权利要求8或9所述的装置,其中,所述第一合约中调用用于获取提案发起账户相关信息的预定链码,所述预执行单元包括,获取子单元,配置为,通过预执行所述预定链码获取所述第二交易的提案发起账户,验证子单元,配置为,验证所述提案发起账户是否为预定账户,读取子单元,配置为,在所述提案发起账户为预定账户的情况中,从所述消息队列中读取所述第一跨链消息。The apparatus according to claim 8 or 9, wherein the first contract invokes a predetermined chain code for acquiring information about the proposal initiation account, and the pre-execution unit includes an acquisition sub-unit configured to perform pre-execution The predetermined chain code obtains the proposal initiating account of the second transaction, and a verification subunit is configured to verify whether the proposal initiating account is a predetermined account, and the reading subunit is configured to verify that the proposal initiating account is a predetermined account. In the case of an account, the first cross-chain message is read from the message queue.
  11. 一种获取跨链消息的装置,所述装置部署于Fabric区块链的客户端节点,包括:A device for acquiring cross-chain messages, the device is deployed on a client node of the Fabric blockchain, including:
    第一发送单元,配置为,向Fabric区块链的至少一个背书节点发送第二交易的交易提案,所述第二交易的交易提案中调用第一合约中的查询函数,所述第一合约的账户状态中包括跨链消息的消息队列,所述查询函数用于读取所述消息队列中的跨链消息;The first sending unit is configured to send a transaction proposal of the second transaction to at least one endorsement node of the Fabric blockchain, where the transaction proposal of the second transaction calls the query function in the first contract, and the first contract's transaction proposal calls the query function in the first contract. The account state includes a message queue of cross-chain messages, and the query function is used to read the cross-chain messages in the message queue;
    接收单元,配置为,从所述至少一个背书节点分别接收所述第二交易的读写集,各个所述读写集中包括所述消息队列中的第一跨链消息。A receiving unit, configured to respectively receive read-write sets of the second transaction from the at least one endorsement node, each of the read-write sets including the first cross-chain message in the message queue.
  12. 根据权利要求11所述的装置,还包括,验证单元,配置为,在从所述至少一个对等节点分别接收所述第二交易的读写集之后,基于预定背书策略对各个所述读写集进行验证;第二发送单元,配置为,在验证通过之后,将第二交易的交易信息发送给所述Fabric区块链中的排序节点,所述第二交易的交易信息包括所述第二交易的交易提案和各个所述读写集。11. The apparatus of claim 11, further comprising a verification unit configured to, after respectively receiving the read-write set of the second transaction from the at least one peer node, perform a verification on each of the read-write based on a predetermined endorsement policy The second sending unit is configured to send the transaction information of the second transaction to the ordering node in the Fabric block chain after the verification is passed, and the transaction information of the second transaction includes the second transaction information. The transaction proposal for the transaction and each said read-write set.
  13. 根据权利要求11或12所述的装置,其中,所述第二交易中以查询参数为传入参数调用第一合约中的查询函数,所述查询参数用于指示所述第一跨链消息。The apparatus according to claim 11 or 12, wherein in the second transaction, a query function in the first contract is called with a query parameter as an incoming parameter, and the query parameter is used to indicate the first cross-chain message.
  14. 根据权利要求11或12所述的装置,其中,所述第一发送单元还配置为,向Fabric区块链的第一背书节点发送第二交易的交易提案,所述第一背书节点中包括TEE。The apparatus according to claim 11 or 12, wherein the first sending unit is further configured to send a transaction proposal of the second transaction to a first endorsement node of the Fabric blockchain, wherein the first endorsement node includes a TEE .
  15. 一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行权利要求1至3中任一项的所述的方法。A computer-readable storage medium on which a computer program is stored, when the computer program is executed in a computer, the computer is made to perform the method of any one of claims 1 to 3.
  16. 一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现权利要求1至3中任一项所述的方法。A computing device includes a memory and a processor, wherein executable codes are stored in the memory, and when the processor executes the executable codes, the method of any one of claims 1 to 3 is implemented.
  17. 一种计算机可读存储介质,其上存储有计算机程序,当所述计算机程序在计算机中执行时,令计算机执行权利要求4至7中任一项的所述的方法。A computer-readable storage medium on which a computer program is stored, when the computer program is executed in a computer, the computer is made to perform the method of any one of claims 4 to 7.
  18. 一种计算设备,包括存储器和处理器,所述存储器中存储有可执行代码,所述处理器执行所述可执行代码时,实现权利要求4至7中任一项所述的方法。A computing device includes a memory and a processor, wherein executable codes are stored in the memory, and when the processor executes the executable codes, the method of any one of claims 4 to 7 is implemented.
PCT/CN2022/082018 2021-03-30 2022-03-21 Method and apparatus for providing cross-chain messages WO2022206454A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110339820.3 2021-03-30
CN202110339820.3A CN112737782B (en) 2021-03-30 2021-03-30 Method and apparatus for providing cross-chain messages

Publications (1)

Publication Number Publication Date
WO2022206454A1 true WO2022206454A1 (en) 2022-10-06

Family

ID=75596142

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/082018 WO2022206454A1 (en) 2021-03-30 2022-03-21 Method and apparatus for providing cross-chain messages

Country Status (2)

Country Link
CN (1) CN112737782B (en)
WO (1) WO2022206454A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112737782B (en) * 2021-03-30 2021-06-25 支付宝(杭州)信息技术有限公司 Method and apparatus for providing cross-chain messages
CN113220745B (en) * 2021-05-19 2024-02-09 中国科学技术大学 Transaction processing method and device based on blockchain and electronic equipment
CN113743950B (en) * 2021-11-04 2022-08-09 支付宝(杭州)信息技术有限公司 Method, node and blockchain system for performing transactions in blockchain system
CN114579595B (en) * 2022-05-06 2022-08-12 中国信息通信研究院 Data writing method and device, computer readable storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110033244A (en) * 2019-03-15 2019-07-19 阿里巴巴集团控股有限公司 Intelligent contract based on block chain executes method and device and electronic equipment
US20190278852A1 (en) * 2018-03-06 2019-09-12 International Business Machines Corporation Customized endorsement logic for blockchain
CN111629039A (en) * 2020-05-20 2020-09-04 中国银联股份有限公司 Block chain consensus method, client, endorsement node and sequencing node
CN112737782A (en) * 2021-03-30 2021-04-30 支付宝(杭州)信息技术有限公司 Method and apparatus for providing cross-chain messages

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108288159A (en) * 2018-03-07 2018-07-17 物数(上海)信息科技有限公司 Across chain method of commerce, system, equipment and storage medium based on multi-tiling chain
CN108848119B (en) * 2018-04-03 2020-04-28 阿里巴巴集团控股有限公司 Cross-block-chain interaction method, device, system and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190278852A1 (en) * 2018-03-06 2019-09-12 International Business Machines Corporation Customized endorsement logic for blockchain
CN110033244A (en) * 2019-03-15 2019-07-19 阿里巴巴集团控股有限公司 Intelligent contract based on block chain executes method and device and electronic equipment
CN111629039A (en) * 2020-05-20 2020-09-04 中国银联股份有限公司 Block chain consensus method, client, endorsement node and sequencing node
CN112737782A (en) * 2021-03-30 2021-04-30 支付宝(杭州)信息技术有限公司 Method and apparatus for providing cross-chain messages

Also Published As

Publication number Publication date
CN112737782B (en) 2021-06-25
CN112737782A (en) 2021-04-30

Similar Documents

Publication Publication Date Title
WO2022206454A1 (en) Method and apparatus for providing cross-chain messages
EP3776208B1 (en) Runtime self-correction for blockchain ledgers
US10581613B2 (en) Cryptographically verifiable data structure having multi-hop forward and backwards links and associated systems and methods
US20220277301A1 (en) Secure tracking and transfer of items using a blockchain
EP3804217B1 (en) Efficient validation for blockchain
WO2020134942A1 (en) Identity verification method and system therefor
US11095433B2 (en) On-chain governance of blockchain
Nikitin et al. {CHAINIAC}: Proactive {Software-Update} transparency via collectively signed skipchains and verified builds
US20200013025A1 (en) Conditional deferred transactions for blockchain
US10985907B2 (en) Identifying faults in a blockchain ordering service
US11693840B2 (en) Database storing authenticated skill-based attributes
US11296864B2 (en) Identifying faults in a blockchain ordering service
US20200007581A1 (en) On-chain governance of blockchain
US20200007313A1 (en) On-chain governance of blockchain
US11888992B2 (en) System and method for generating digital marks
JP2020511017A (en) System and method for implementing blockchain-based digital certificates
US20200007315A1 (en) On-chain governance of blockchain
Tate et al. Multi-user dynamic proofs of data possession using trusted hardware
KR20220044306A (en) Partially-aligned blockchain
US20200220881A1 (en) Weighted verification of entity data blocks on a blockchain
CN113656780B (en) Cross-chain access control method and device
WO2022206437A1 (en) Method and apparatus for querying ledger data of fabric blockchain
WO2022206439A1 (en) Method and apparatus for providing cross-chain message
WO2022206431A1 (en) Method and apparatus for querying ledger data of fabric blockchain
US20200145230A1 (en) System and method for generating digital marks

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22778637

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22778637

Country of ref document: EP

Kind code of ref document: A1