[go: up one dir, main page]

WO2019042101A1 - 一种跨链交易方法及装置 - Google Patents

一种跨链交易方法及装置 Download PDF

Info

Publication number
WO2019042101A1
WO2019042101A1 PCT/CN2018/099348 CN2018099348W WO2019042101A1 WO 2019042101 A1 WO2019042101 A1 WO 2019042101A1 CN 2018099348 W CN2018099348 W CN 2018099348W WO 2019042101 A1 WO2019042101 A1 WO 2019042101A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
anchor
node
blockchain
transactions
Prior art date
Application number
PCT/CN2018/099348
Other languages
English (en)
French (fr)
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 华为技术有限公司
Priority to EP18850286.8A priority Critical patent/EP3627431B1/en
Publication of WO2019042101A1 publication Critical patent/WO2019042101A1/zh
Priority to US16/787,669 priority patent/US11347726B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2379Updates performed during online database operations; commit processing
    • 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
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/02Payment architectures, schemes or protocols involving a neutral party, e.g. certification authority, notary or trusted third party [TTP]
    • G06Q20/027Payment architectures, schemes or protocols involving a neutral party, e.g. certification authority, notary or trusted third party [TTP] involving a payment switch or gateway
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • 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
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/389Keeping log of transactions for guaranteeing non-repudiation of a transaction
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/405Establishing or using transaction specific rules
    • 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
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • 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
    • G06Q2220/00Business processing using cryptography

Definitions

  • the present invention relates to the field of blockchain technology, and in particular, to a cross-chain transaction method and apparatus.
  • the blockchain system In the blockchain system, data is stored in the block, and the newly written data forms a new block, which is added at the end of the current blockchain. Each block saves the data, and also stores a unique number of data (usually the hash of all recorded data) of all the records in the previous block, thereby forming a chain. Therefore, the blockchain system can be considered as a system that is not fully trusted by the computers on the distributed network and maintains a set of traceable and non-tamperable chain data through consensus rules.
  • scenario 1 user A in blockchain 1 pays several assets to user B in blockchain 2; scenario 2, user E is in the block Transaction a and transaction b are initiated on chain 1 and blockchain 2, respectively, and transaction a and transaction b are two interrelated transactions.
  • the implementation solution in the prior art is: after user A and user B negotiate, determine a user C who has assets in both blockchains, and plays the role of an intermediary.
  • User A initiates a transaction (transfer asset) to Escrow in blockchain 1;
  • user C initiates a transaction to Escrow in blockchain 2, where Esrow has assets on both blockchains and has credibility, similar to one Neutral trader.
  • Escrow determines that both transactions have been completed, Escrow transfers the corresponding assets to User C and User B in the two blockchains.
  • Escrow needs to initiate payment transactions to User C and User B on the two blockchains respectively. If for some reason one of the transactions fails, the successful transaction needs to be revoked. However, successful transactions may not be revoked, thus failing to fundamentally solve the problem of atomic submission of interrelated transactions on two blockchains.
  • the present application provides a cross-chain transaction method for solving the problem of atomic commits of interconnected transactions on multiple blockchains.
  • the application provides a cross-chain transaction, the method comprising:
  • the node receives the associated transaction sent by the consensus node;
  • the associated transaction includes the transaction content of the plurality of transactions, the identifier of the blockchain to which the plurality of transactions belong, and the identifier of the anchor transaction;
  • the node is the first blockchain Any one of the nodes, the first blockchain is any one of the blockchains to which the plurality of transactions belong;
  • the node according to the identifier of the anchor transaction, if it is determined that the anchor transaction is a valid transaction, according to the identifier of the blockchain to which the plurality of transactions belong, the associated blockchain is the first zone A blockchain transaction is written to the first blockchain.
  • the node needs to be anchored according to the associated transaction after receiving the associated transaction sent by the consensus node.
  • the identifier of the transaction determining whether the anchor transaction is a valid transaction, and if the anchor transaction is a valid transaction, according to the identifier of the blockchain to which the plurality of transactions belong, the block chain belongs to the transaction of the first blockchain.
  • the first blockchain is written, so that multiple transactions associated with each other in multiple blockchains can be successfully submitted at the same time, effectively avoiding multiple transactions in the prior art failing to be submitted simultaneously, and successful transactions may not be revoked. The problem.
  • the node abandons writing the associated transaction if it determines that the anchor transaction is an invalid transaction.
  • the method before the node determines that the anchor transaction is an invalid transaction, the method further includes:
  • the node sets the anchor transaction as an invalid transaction based on the invalid anchor transaction.
  • the method before the node receives the associated transaction sent by the consensus node, the method further includes:
  • the node receives the anchor transaction sent by the consensus node and writes the anchor transaction to the first blockchain.
  • the node is a node shared in a blockchain to which the plurality of transactions belong;
  • the method further includes:
  • the anchor transaction corresponding to the plurality of transactions to the consensus node, where the anchor transaction includes a data identifier of the plurality of transactions, and an identifier of a blockchain to which the plurality of transactions belong And anchor version number;
  • the node After the node determines that the anchor transaction is successful, the node sends an associated transaction to the consensus node.
  • the node sends the anchor transaction to the consensus node, including:
  • the node sends an anchor request corresponding to the multiple transactions to the notarization node, where the anchor request is used to request the notarization node to generate the anchor transaction and send the anchor transaction to the consensus node.
  • sending the associated transaction to the consensus node including:
  • the node receives anchor indication information sent by the notarization node, where the anchor indication information is used to indicate that the anchor transaction is successful, and the anchor indication information includes an identifier of the anchor transaction and the anchor The identification of the request;
  • the present application provides a cross-chain transaction method, the method comprising:
  • the consensus node receives an anchor transaction sent by the node, where the anchor transaction includes a data identifier of the plurality of transactions, and an identifier of a blockchain to which the plurality of transactions belong;
  • the consensus node monitors data corresponding to the data identifier, and if it is monitored that the data corresponding to the data identifier is modified, broadcasting an invalid anchor transaction to each node in the blockchain to which the plurality of transactions belong,
  • the invalid anchor transaction includes identification information of the anchor transaction, and the invalid anchor transaction is used to indicate that the anchor transaction is an invalid transaction.
  • the consensus node monitors the data corresponding to the data identifier in the anchor transaction by receiving the anchor transaction sent by the node, and notifies the monitoring result to each node after the monitored data is modified, so that each node can monitor according to the monitoring.
  • multiple transactions that are associated with each other fail to commit at the same time, making multiple transactions atomic.
  • the anchor transaction also includes an anchor version number
  • the consensus node monitors that the data is modified, including:
  • the consensus node receives other transactions, the other transactions are transactions that are not associated with the plurality of transactions, and the other transactions include a version number of data corresponding to the data identifier;
  • the consensus node monitors that the data is modified if it is determined that the version number included in the other transaction is different from the anchor version number.
  • the method further includes:
  • the consensus node broadcasts the anchor transaction to each node in the blockchain in which the anchor data is located according to the identifier of the blockchain to which the plurality of transactions belong.
  • the method further includes:
  • the consensus node receives the associated transaction sent by the node, where the associated transaction includes the transaction content of the plurality of transactions, the identifier of the blockchain to which the plurality of transactions belong, and the identifier of the anchor transaction;
  • the consensus node broadcasts an associated transaction to each node in the blockchain to which the plurality of transactions belong according to the identifier of the blockchain to which the plurality of transactions belong.
  • the present application provides a cross-chain transaction system, where the cross-chain transaction system includes a plurality of consensus nodes and nodes on a blockchain to which a plurality of transactions associated with each other belong; the plurality of transactions associated with each other
  • the node on the associated blockchain includes a connection node, and the connection node is a node shared by the blockchain to which the plurality of related transactions belong;
  • connection node is configured to send an anchor transaction to the consensus node, where the anchor transaction includes a data identifier of the plurality of transactions, an identifier of the blockchain to which the plurality of transactions belong, and an anchor version number;
  • the consensus node is configured to receive an anchor transaction sent by the node, and monitor data corresponding to the data identifier, and if the data corresponding to the data identifier is monitored, to the blockchain to which the plurality of transactions belong
  • Each of the nodes in the broadcast broadcasts an invalid anchor transaction, the invalid anchor transaction includes identification information of the anchor transaction, and the invalid anchor transaction is used to indicate that the anchor transaction is an invalid transaction;
  • connection node is further configured to send an associated transaction to the consensus node, where the associated transaction includes a transaction content of the plurality of transactions, an identifier of the blockchain to which the plurality of transactions belong, and an identifier of the anchor transaction;
  • the consensus node is further configured to receive an associated transaction sent by the node, and broadcast an associated transaction to each node in the blockchain to which the plurality of transactions belong according to the identifier of the blockchain to which the plurality of transactions belong ;
  • Each node in the blockchain to which the plurality of transactions belong is used to receive the associated transaction, and according to the identifier of the anchor transaction, if the anchor transaction is determined to be a valid transaction, the associated transaction is Write to the blockchain maintained by each node.
  • the application provides a server, where the server is a server where any node on the first blockchain is located, and the server includes:
  • a transceiver module configured to receive an associated transaction sent by the consensus node;
  • the associated transaction includes a transaction content of the plurality of transactions, an identifier of the blockchain to which the plurality of transactions belong, and an identifier of the anchor transaction;
  • the first area a blockchain is any blockchain in a blockchain to which the plurality of transactions belong;
  • a processing module configured to determine, according to the identifier of the anchor transaction, if the anchor transaction is a valid transaction, according to the identifier of the blockchain to which the plurality of transactions belong, the associated blockchain is the A blockchain transaction is written to the first blockchain.
  • the server abandons writing the associated transaction if it determines that the anchor transaction is an invalid transaction.
  • the transceiver module is further configured to: receive an invalid anchor transaction sent by the consensus node, where the invalid anchor transaction includes an identifier of the anchor transaction;
  • the processing module is specifically configured to: set the anchor transaction as an invalid transaction according to the invalid anchor transaction.
  • the transceiver module before receiving the associated transaction sent by the consensus node, is further configured to: receive the anchor transaction sent by the consensus node;
  • the processing module is further configured to write the anchor transaction into the first blockchain.
  • the server is a server where a node shared by the blockchain to which the plurality of transactions belong is located;
  • the transceiver module Before receiving the associated transaction sent by the consensus node, the transceiver module is further configured to: send the anchor transaction corresponding to the multiple transactions to the consensus node, where the anchor transaction includes the multiple transactions a data identifier, an identifier of the blockchain to which the plurality of transactions belong, and an anchor version number; and, after determining that the anchor transaction is successful, sending the associated transaction to the consensus node.
  • the transceiver module is further configured to: send, by the node, an anchor request corresponding to the multiple transactions to a notarization node, where the anchor request is used to request the notarized node to generate the anchor The transaction is scheduled and sent to the consensus node.
  • the transceiver module is specifically configured to:
  • the anchoring indication information is used to indicate that the anchoring transaction is successful, and the anchoring indication information includes an identifier of the anchoring transaction and the anchoring request Identification
  • the application provides a server, where the server is a server where a consensus node is located, and the server includes:
  • a transceiver module configured to receive an anchor transaction sent by the node, where the anchor transaction includes a data identifier of the plurality of transactions, and an identifier of a blockchain to which the plurality of transactions belong;
  • a processing module configured to monitor data corresponding to the data identifier, and if the data corresponding to the data identifier is monitored, the transceiver module broadcasts to each node in the blockchain to which the multiple transactions belong Anchoring the transaction, the invalid anchor transaction includes identification information of the anchor transaction, and the invalid anchor transaction is used to indicate that the anchor transaction is an invalid transaction.
  • the anchor transaction also includes an anchor version number
  • the transceiver module is further configured to:
  • Receiving other transactions the other transactions being transactions that are not associated with the plurality of transactions, the other transactions including a version number of data corresponding to the data identifier;
  • the processing module is specifically configured to:
  • monitoring data corresponding to the data identifier is modified.
  • the transceiver module after receiving the anchor transaction sent by the node, the transceiver module is further used to:
  • the method further includes:
  • the associated transaction includes a transaction content of the plurality of transactions, an identifier of a blockchain to which the plurality of transactions belong, and an identifier of the anchor transaction;
  • the related transaction is broadcast to each node in the blockchain to which the plurality of transactions belong.
  • the application further provides a server, where the server has a function in implementing the foregoing method example in the fourth aspect;
  • the communication device includes: a communication module, a processor;
  • the communication module is configured to perform communication interaction with other devices;
  • the communication module may be an RF circuit, a WiFi module, a communication interface, a Bluetooth module, or the like;
  • the processor is configured to implement the functions of the processing module in the fourth aspect above.
  • the communication device may further include: a memory for storing a program or the like.
  • the program can include program code, the program code including instructions.
  • the memory may contain RAM and may also include non-volatile memory, such as at least one disk storage.
  • the processor executes the application stored in the memory, so that the server implements the above functions.
  • the communication module, the processor and the memory can be connected to each other through the bus;
  • the bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (extended industry standard architecture). EISA) bus and so on.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into an address bus, a data bus, a control bus, and the like.
  • the application further provides a server, the server having the function of implementing the foregoing method in the fifth aspect;
  • the communication device includes: a communication module, a processor;
  • the communication module is configured to perform communication interaction with other devices;
  • the communication module may be an RF circuit, a WiFi module, a communication interface, a Bluetooth module, or the like;
  • the processor is configured to implement the functions of the processing module in the fifth aspect above.
  • the communication device may further include: a memory for storing a program or the like.
  • the program can include program code, the program code including instructions.
  • the memory may contain RAM and may also include non-volatile memory, such as at least one disk storage.
  • the processor executes the application stored in the memory, so that the server implements the above functions.
  • the communication module, the processor and the memory can be connected to each other through the bus;
  • the bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (extended industry standard architecture). EISA) bus and so on.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the bus can be divided into an address bus, a data bus, a control bus, and the like.
  • the present application also provides a computer readable storage medium storing instructions that, when executed on a computer, cause the computer to implement a cross-chain transaction method provided by any of the above designs.
  • the present application also provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the cross-chain transaction method provided by any of the above designs.
  • the present application also provides a computer program that, when run on a computer, causes the computer to perform the cross-chain transaction method provided by any of the above designs.
  • FIG. 1 is a schematic diagram of a system architecture applicable to the present application
  • FIG. 2a is a schematic flowchart of a cross-chain transaction according to Embodiment 1 of the present application;
  • FIG. 2b is a schematic flowchart of another cross-chain transaction according to Embodiment 1 of the present application.
  • FIG. 3 is a schematic diagram of monitoring a consensus node in the present application.
  • FIG. 4a is a schematic flowchart of a cross-chain transaction according to Embodiment 2 of the present application.
  • FIG. 4b is a schematic flowchart of another cross-chain transaction according to Embodiment 2 of the present application.
  • FIG. 5 is a schematic structural diagram of a first server provided by the present application.
  • FIG. 6 is a schematic structural diagram of a second server provided by the present application.
  • FIG. 7 is a schematic structural diagram of a third server provided by the present application.
  • FIG. 8 is a schematic structural diagram of a fourth server provided by the present application.
  • FIG. 1 is a schematic diagram of a system architecture applicable to the present application.
  • the system architecture may include a consensus service network, two or more blockchain networks, such as the first blockchain network and the second shown in FIG. 1.
  • the consensus service network may include a plurality of consensus nodes having a consensus function, such as the consensus node a1, the consensus node a2, the consensus node a3, and the consensus node a4 shown in FIG.
  • the first blockchain network and the second blockchain network share a consensus service provided by each consensus node in the consensus service network.
  • the blockchain network is a peer-to-peer (P2P) network composed of multiple nodes, and the P2P is an application layer protocol running on a transmission control protocol (TCP) protocol.
  • the nodes in the blockchain network are equal to each other, and there is no central node in the network, and each node can randomly connect other nodes.
  • a relatively fast consensus mechanism is proof of endorse (PoE).
  • PoE proof of endorse
  • the core of this consensus mechanism is that multiple endorsers in the blockchain network run smart contracts and endorse the endorsement of the contract (by signing the content of the contract run results of the endorsement node itself, the guarantee is The result of a specific endorsement node).
  • the user can set the endorsement node to be trusted by the smart contract and the endorse policy for the results of multiple contract operations according to actual needs. For example, a smart contract run request can be sent to three endorsement nodes.
  • the verification strategy can require that the content of the three contract runs must be consistent, or that the content of at least two contract runs must be consistent.
  • the contract operation results returned by the client device collection endorsement node are included in the transaction and broadcast to all nodes (including endorsement nodes) in the blockchain network through the consensus service network.
  • the node verifies the received transaction. If the transaction satisfies the verification policy, it accepts the modification of the data by the transaction and writes the blockchain.
  • the entire blockchain network is distributed, so that the synchronization of data will have time differences.
  • the data obtained by the endorsement node when running the smart contract code of a transaction is likely to be inconsistent with the data when the transaction is finally written into the blockchain, thereby invalidating the endorsement of the endorsement node.
  • the first blockchain network includes a node b1, a node b2, a node b3, a node b4, a node d1, and a node d2. These nodes jointly maintain a blockchain 1; the second blockchain network includes nodes. C1, node c2, node c3, node c4, node c5, node d1, node d2, which together maintain blockchain 2.
  • the blockchain stores the transaction list in units of blocks, and the blocks in the blockchain are generated in chronological order, and each block is used to record a list of transactions generated within a period of time.
  • the list of all transactions recorded on the blockchain is the ledger (Ledger).
  • the ledger recorded on blockchain 1 is Ledger1
  • the ledger recorded on blockchain 2 is Ledger2. In this application, it does not cause ambiguity.
  • the ledger and blockchain are equivalent concepts that can be substituted for each other.
  • one node in the blockchain network is on one physical machine (server), or multiple in multiple blockchain networks.
  • the nodes are on the same server.
  • One node may specifically refer to a process or a series of processes running in the server.
  • the node a1 in the first blockchain network and the node c1 in the second blockchain network may be Two processes running on one server.
  • the node described in this application may refer to the server where the node is located.
  • one or more clients can communicate with the node by accessing the network. For example, if user A has an asset in blockchain 1, user A can communicate with any node in the first blockchain network through client a, thereby initiating a transaction in blockchain 1; if user B is If there is an asset in the blockchain 2, the user B can communicate with any node in the second blockchain network through the client b, thereby initiating a transaction in the blockchain 2; if the user C is in the blockchain 1 and the zone If there are assets in the blockchain 2, the user C can simultaneously communicate with any node in the first blockchain network and the second blockchain network through the client c, thereby being in the blockchain 1 or the blockchain 2 Initiate a transaction.
  • the client device may not be set.
  • the user may directly initiate a transaction in the blockchain through the node on the blockchain, which is not limited.
  • user A selects user C as an intermediary;
  • user C is a user in blockchain 1 and blockchain 2;
  • transaction 1 in blockchain 1, user A transfers the asset to Escrow (referred to as transaction 1), and the state of transaction 1 is the prepared state (Prepared);
  • transaction 2 in the blockchain 2, after seeing the transaction in which the user A transfers to the Escrow in the blockchain 1, the user C transfers the asset to the Escrow in the blockchain 2 (referred to as transaction 2).
  • the state of transaction 2 is the prepared state (Prepared);
  • a group of provers monitors whether the user B in the blockchain 2 has issued a receipt signature, and the group of certifiers themselves can form a collection signature for whether the user B has issued the specified expiration time through consensus.
  • Output consistent, credible results if the prover finds user B's receipt signature in blockchain 2, then inform blockchain 1 and blockchain 2 to transfer the assets in Escrow to the transaction object, ie notify the block Escrow in chain 1 sends the asset to the intermediary user C, and informs Escrow in blockchain 2 to send the asset to user B; otherwise, the asset held in Escrow is returned to the originator of the transaction, ie, Escrow in blockchain 1
  • Escrow in blockchain 2 is sent to user C.
  • the above scheme can be extended to asset payment through N blockchains (blockchain 1 ⁇ ... ⁇ blockchain N), and the prover informs all by observing whether the payment target of the blockchain N has received the receipt signature. Whether Escrow on the blockchain will send the managed asset to the trading target or return it to the originator of the transaction.
  • Escrow needs to initiate payment transactions to user C and user B on two blockchains respectively. If for some reason one of the transactions fails, the successful transaction needs to be revoked, but it has been successful. The transaction may not be revoked, resulting in a poor security of the transaction.
  • the present application provides a cross-chain transaction method for any node on the first blockchain in the blockchain to which the plurality of transactions associated with each other, after receiving the associated transaction sent by the consensus node. Determining whether the anchor transaction is a valid transaction according to the identifier of the anchor transaction included in the associated transaction, and if the anchor transaction is a valid transaction, according to the identifier of the blockchain to which the plurality of transactions belong, The blockchain writes the transaction of the first blockchain into the first blockchain, thereby ensuring that multiple transactions associated with each other in the plurality of blockchains are simultaneously submitted successfully, thereby effectively avoiding multiple transactions in the prior art failing simultaneously. A successful submission and a successful transaction may not be revoked.
  • a node that performs an associated transaction on a plurality of blockchains may be referred to as a connect peer, which may be A node that performs endorsement of data that is traded on multiple blockchains is called a notary peer.
  • the connection node and the notarization node are nodes shared by the blockchain 1 and the blockchain 2, and the notarization node is a node specified in advance from a plurality of nodes shared by the plurality of blockchains, and is used for performing third-party notarization, the notarization node Ability to receive transaction information for multiple blockchains.
  • FIG. 2 is a schematic flowchart of a cross-chain transaction method according to Embodiment 1 of the present application. As shown in Figure 2a, the method includes:
  • Step 201 The connection node generates an anchor transaction corresponding to the multiple transactions according to the multiple transactions associated with each other, and sends an anchor transaction to the consensus node, where the anchor transaction includes the data identifier of the multiple transactions, and the The identifier and anchor version number of the blockchain to which multiple transactions belong.
  • the plurality of transactions associated with each other may be two or more transactions associated with each other, and correspondingly, the blockchain to which the plurality of transactions belong is two or more blockchains, for example, blocks.
  • Chain 1, blockchain 2, ..., blockchain N, N are positive integers.
  • User A needs to use its assets in blockchain 1, pays users in several blockchains 2 to user B in blockchain 2, and selects users who have assets on both blockchains. For example, in the case of C as a middleman, User A, User B, and User C negotiate that: User A pays the user C in the blockchain 1 (the first transaction), and the user C goes to the user in the blockchain 2 B pays the assets (second transaction).
  • the first transaction and the second transaction are a plurality of transactions associated with each other.
  • the blockchain to which the first transaction belongs is the blockchain 1
  • the blockchain to which the second transaction belongs is the blockchain 2.
  • the data identifier of the plurality of transactions refers to a variable of data to be accessed by calling the smart contract request on the blockchain to which the plurality of transactions belong, and the data corresponding to the data identifier of the plurality of transactions is the block to which the plurality of transactions belong.
  • the data to be accessed by the smart contract request is called on the chain.
  • the data identifier of the first transaction may be the identifier of the user A and the identifier of the user C.
  • the data corresponding to the identifier of the user A is the asset data of the user A in the blockchain 1
  • the identifier of the user C is the asset data of the user C in the blockchain 1.
  • the anchor version number refers to the version number of the data to be accessed by calling the smart contract request on the blockchain to which the plurality of transactions belong.
  • the identifier of the blockchain may be information for uniquely identifying the blockchain, for example, the number of the blockchain, which is not limited.
  • multiple transactions associated with each other may carry the same associated identifier.
  • the connection node After the connection node generates the anchor transaction corresponding to the multiple transactions, the correspondence between the identifier of the anchor transaction and the association identifier carried by the multiple transactions may be established and stored.
  • Table 1 Examples of correspondence between association identifiers of multiple transactions and identifiers of anchor transactions
  • Step 202 The consensus node receives the anchor transaction and monitors data corresponding to the data identifier.
  • the consensus node can be implemented by maintaining a local data monitoring table: the consensus node adds the anchor transaction to the data monitoring table every time an anchor transaction is sent. When the data corresponding to the monitored data identifier is modified, the anchor transaction is removed from the data monitoring table.
  • the consensus node can be implemented by a middleware of a message queue, and receives an anchor transaction sent by each connection node from a unified interface.
  • the consensus node records the transaction information to different partitions according to the identifier of the blockchain to which the plurality of transactions belong in the anchor transaction, for example, partition0, partition1, and partition2, and different partitions correspond to different regions.
  • Trading on the blockchain For example, partition0 corresponds to a transaction on blockchain 1, partition1 corresponds to a transaction on blockchain 2, and partition3 corresponds to a transaction on blockchain 3.
  • partition0 corresponds to a transaction on blockchain 1
  • partition1 corresponds to a transaction on blockchain 2
  • partition3 corresponds to a transaction on blockchain 3.
  • partition0 the numbers (0, 1, 2, ..., 11, 12, ...) in the partition are used to represent each transaction on the blockchain 1 that needs to be monitored.
  • the consensus node may package the transaction information in the different partitions into blocks for sending to the corresponding blockchain according to the identifier of the blockchain.
  • Step 203 If the consensus node monitors that the data corresponding to the data identifier is modified, broadcasting an invalid anchor transaction to each node in the blockchain to which the plurality of transactions belong, where the invalid anchor transaction includes the Anchoring the identification information of the transaction, the invalid anchor transaction is used to indicate that the anchor transaction is an invalid transaction.
  • the consensus node receives the third transaction (user A pays the user D in the blockchain 1), because the third transaction is for the user.
  • the asset data of A has been changed, resulting in the data corresponding to the data identifier being modified.
  • the third transaction includes the version number of the data corresponding to the data identifier
  • the consensus node determines that the version number included in the third transaction is different from the anchor version number in the anchor transaction, it determines that the data identifier is monitored.
  • the corresponding data is modified; the third transaction does not include the version number, and if the consensus node determines that the data corresponding to the data identifier is written in the third transaction, it is determined that the data corresponding to the monitored data identifier is modified.
  • the consensus node After receiving the third transaction, the consensus node detects that the third transaction modifies the data corresponding to the data identifier in the anchor transaction (specifically, the asset data of user A in blockchain 1), and then records the third transaction into the block.
  • the transaction queue to be broadcasted in chain 1 and immediately add invalid anchor transactions in the to-be broadcast transaction queues of blockchain 1 and blockchain 2, and update the local monitoring data table to anchor the transaction from the monitoring data table. Delete, no longer continue to monitor the anchor data.
  • Step 204 The node on the blockchain to which the plurality of transactions belong receives the invalid anchor transaction sent by the consensus node.
  • Step 205 The connection node sends a related transaction to the consensus node, where the associated transaction includes the transaction content of the plurality of transactions, the identifier of the blockchain to which the plurality of transactions belong, and the identifier of the anchor transaction.
  • Step 206 The consensus node receives the associated transaction, and sends the associated transaction to the node on the blockchain to which the plurality of transactions belong according to the identifier of the blockchain to which the plurality of transactions belong.
  • the consensus node may send the related transaction according to the identifier of the blockchain 1 to which the first transaction belongs and the identifier of the blockchain 2 to which the second transaction belongs in the associated transaction.
  • the consensus node may send the related transaction according to the identifier of the blockchain 1 to which the first transaction belongs and the identifier of the blockchain 2 to which the second transaction belongs in the associated transaction.
  • Step 207 For any node on the first blockchain in the blockchain to which the plurality of transactions belong, after receiving the associated transaction, the node determines, according to the identifier of the anchor transaction included in the associated transaction, that the anchor transaction is Invalid transaction and abandoning the associated transaction.
  • the node also needs to perform local verification on the transaction format, signature, etc. of the associated transaction, and if the local verification is passed and the anchor transaction is a valid transaction, the associated blockchain can be the first blockchain. The transaction is written to the first blockchain.
  • the specific content of the local authentication of the transaction format, the signature, and the like of the associated transaction may refer to the prior art, and details are not described herein again.
  • the present application does not limit the order of local verification and anchor transaction verification.
  • One possible implementation manner is that the node can first verify whether the anchor transaction is a valid transaction, and if the anchor transaction is an invalid transaction, Write-off is directly aborted without the need for validity verification, saving the processing burden.
  • the first blockchain is any blockchain in a blockchain to which a plurality of transactions belong, for example, blockchain 1 or blockchain 2.
  • the anchor is determined according to the identifier of the anchor transaction included in the associated transaction and the invalid anchor transaction received in step 204.
  • the associated transaction is aborted.
  • the first transaction and the second transaction in the associated transaction fail to be submitted at the same time.
  • step 207 after receiving the associated transaction, the node on the blockchain to which the plurality of transactions belong determines that the anchor transaction is a valid transaction, and writes the associated transaction into the corresponding blockchain.
  • the node on the blockchain 1 determines that the anchor transaction is a valid transaction, and writes the first transaction into the blockchain 1; after receiving the associated transaction, the node on the blockchain 2 receives the associated transaction Determining that the anchor transaction is a valid transaction and writing the second transaction into the blockchain 2; and, after the connection node (the node shared by the blockchain 1 and the blockchain 2) receives the associated transaction, determines the anchor transaction For a valid transaction, the first transaction is written into blockchain 1, and the second transaction is written into blockchain 2. At this time, the first transaction and the second transaction in the associated transaction are simultaneously submitted successfully.
  • FIG. 2b results in different execution results due to different monitoring results of the consensus nodes.
  • the relevant steps in FIG. 2b can be referred to the description in FIG. 2a, and details are not described herein again.
  • a corresponding timer may be started when the consensus node receives the anchor transaction and starts monitoring, and if the timer reaches the set duration, the data is not monitored. If you modify it, you can broadcast an invalid anchor transaction and no longer monitor it.
  • the set duration can be set by a person skilled in the art according to actual conditions. In a possible scenario, the consensus node does not monitor the data to be modified within the set duration. When the timer reaches the set duration, the associated transaction has been submitted successfully. At this time, the consensus node does not need to monitor the anchor transaction, but to avoid the subsequent anchor. The transaction is maliciously used, and the consensus node can broadcast an invalid anchor transaction to each node on the blockchain to which the plurality of transactions belong.
  • Step 203 and step 204 may occur at any time after step 202 and before step 207, and are not specifically limited.
  • Figure 2a and Figure 2b take only two blockchains (blockchain 1 and blockchain 2) as an example. In the specific implementation, there may be more than two blockchains (blockchain 1, zone 2). Block chain 2, ..., block chain N), the implementation process of more than two blockchains can be referred to the above description.
  • FIG. 4a is a schematic flowchart of a cross-chain transaction method provided by the present application. As shown in Figure 4a, the method includes:
  • Step 401 The connection node generates an anchor request corresponding to the multiple transactions according to the multiple transactions associated with each other, and sends an anchor request to the notarization node, where the anchor request includes the data identifier of the multiple transactions, and the The identifier and anchor version number of the blockchain to which multiple transactions belong.
  • multiple transactions associated with each other may carry the same associated identification.
  • the connection node After the connection node generates the anchor request corresponding to the multiple transactions, the correspondence between the identifier of the anchor request and the associated identifier carried by the multiple transactions may be established and stored.
  • Table 2 Example of correspondence between association identifiers of multiple transactions and identifiers of anchor requests
  • Step 402 After receiving the anchor request sent by the connection node, the notarization node generates an anchor transaction corresponding to the anchor request, and sends the anchor transaction to the consensus node; the anchor transaction includes the multiple The data identification of the transactions, the identification of the blockchain to which the plurality of transactions belong, and the anchor version number.
  • the notarization node can verify whether the anchor version number in the anchor request is the same as the local account book. If they are the same, generate an anchor transaction corresponding to the anchor request, and execute the subsequent process, if different , then return a message with invalid data to the connection node and end the process.
  • the correspondence between the identifier of the anchor request and the identifier of the anchor transaction may be established and stored, as shown in Table 3.
  • Anchor request identifier Anchoring the identity of the transaction Anchor request 1 Anchor transaction 1 Anchor request 2 Anchor transaction 2 ;
  • Step 403 The consensus node receives the anchor transaction, and sends the anchor transaction to the node on the blockchain to which the plurality of transactions belong according to the identifier of the blockchain to which the plurality of transactions belong, and monitors the The data identifies the corresponding data.
  • Step 404 If the consensus node monitors that the data corresponding to the data identifier is modified, broadcasting an invalid anchor transaction to each node in the blockchain to which the plurality of transactions belong, where the invalid anchor transaction includes the Anchoring the identification information of the transaction, the invalid anchor transaction is used to indicate that the anchor transaction is an invalid transaction.
  • Step 405 The node on the blockchain to which the plurality of transactions belong receives the invalid anchor transaction sent by the consensus node, and sets the anchor transaction as an invalid transaction.
  • the node setting the anchor transaction as an invalid transaction may mean that the node sets an invalid identifier for the anchor transaction, and the invalid identifier indicates that the anchor transaction is an invalid transaction, or may be set by other means, specifically Make a limit.
  • the node may locally maintain a list of anchor transactions, including the identifier of the anchor transaction and whether the anchor transaction is an invalid identifier of the invalid transaction, and the anchor transaction with the invalid identifier is an invalid transaction.
  • Anchor transactions without an invalid identifier are valid transactions. In this way, the anchor list can be quickly determined to be a valid transaction or an invalid transaction by querying the list.
  • the node setting the anchor transaction as an invalid transaction may also mean directly deleting the invalid anchor transaction from the list.
  • the node query list if it fails to find the anchor transaction from the list, determines that the anchor transaction is an invalid transaction, and if the anchor transaction can be found from the list, then the anchor transaction is determined to be a valid transaction.
  • Step 406 After receiving the anchor transaction sent by the consensus node in step 403, the notarization node sends anchor indication information to the intermediate node, where the anchor indication information is used to indicate that the anchor transaction is successful, the anchor The indication information includes an identifier of the anchor transaction and an identifier of an anchor request corresponding to the anchor transaction.
  • the notarization node may determine the identifier of the corresponding anchor request according to the identifier of the anchor transaction and the correspondence between the identifier of the anchor transaction and the identifier of the anchor request, and then The node sends anchor indication information.
  • Step 407 The connection node receives the anchor indication information sent by the notarization node, determines the corresponding association identifier according to the identifier of the anchor request, and further generates a related transaction according to the multiple transactions carrying the association identifier, and the related transaction.
  • Step 408 The consensus node receives the associated transaction, and sends the associated transaction to the node on the blockchain to which the plurality of transactions belong according to the identifier of the blockchain to which the plurality of transactions belong.
  • Step 409 For any node on the first blockchain in the blockchain to which the plurality of transactions belong, after receiving the associated transaction, the node determines, according to the identifier of the anchor transaction included in the associated transaction, that the anchor transaction is Invalid transaction and abandoning the associated transaction.
  • step 409 after receiving the associated transaction, the node on the blockchain to which the plurality of transactions belong determines that the anchor transaction is a valid transaction and writes the associated transaction into the corresponding blockchain.
  • the node on the blockchain 1 determines that the anchor transaction is a valid transaction, and writes the first transaction into the blockchain 1; after receiving the associated transaction, the node on the blockchain 2 receives the associated transaction Determining that the anchor transaction is a valid transaction and writing the second transaction into the blockchain 2; and that the fair node and the connected node (both nodes shared by blockchain 1 and blockchain 2) are receiving the associated transaction Thereafter, it is determined that the anchor transaction is a valid transaction, and the first transaction is written into the blockchain 1, and the second transaction is written into the blockchain 2.
  • the specific process in this case can be seen in Figure 4b.
  • the flow shown in FIG. 4b is different from that of FIG. 4a, and the monitoring results of the consensus nodes are different, which leads to different execution results.
  • the relevant steps in FIG. 4b can be referred to the description in FIG. 4a, and details are not described herein again.
  • a corresponding timer may be started when the consensus node receives the anchor transaction and starts monitoring, and if the timer reaches the set duration, the data is not monitored. If you modify it, you can broadcast an invalid anchor transaction and no longer monitor it.
  • the set duration can be set by a person skilled in the art according to actual conditions.
  • the node can verify the anchor transaction, and if the node receives the anchor transaction, the anchor transaction The anchor version number is different from the node book, indicating that the anchor version number has expired.
  • the node can directly set the anchor transaction as an invalid transaction; and for the consensus node, by setting the set duration, the consensus can be made.
  • the node broadcasts an invalid anchor transaction to each node in the blockchain to which the multiple transactions belong, and no longer monitors the anchor transaction.
  • Step 404 and step 405 may occur at any time after step 403 and before step 409, and are not specifically limited.
  • the anchor request sent by the connection node to the notary node includes only the data identifier of the plurality of transactions and the block to which the plurality of transactions belong. The identification of the chain, and then the notarized node obtains the anchor version number according to the anchor request, and generates an anchor transaction to send to the consensus node.
  • Figure 4a and Figure 4b take only two blockchains (blockchain 1 and blockchain 2) as an example. In the specific implementation, there may be more than two blockchains (blockchain 1, zone). Block chain 2, ..., block chain N), the implementation process of more than two blockchains can be referred to the above description.
  • the difference between the second embodiment and the first embodiment is that: (1) the second embodiment involves a notarized node, that is, the connection node initiates the associated transaction. Previously, an anchor request is sent to the notary node, and then the notarization node sends an anchor transaction to the consensus node. By introducing an authoritative notarization node, the notarization node verifies the anchor version number, and generates an anchor after the verification is passed. The transaction ensures the validity of the anchor version number.
  • the consensus node after receiving the anchor transaction, the consensus node broadcasts the anchor transaction to the node on the blockchain to which the plurality of transactions belong according to the identifier of the blockchain to which the plurality of transactions belong, thereby making the area
  • the node on the blockchain can effectively record the implementation process of the transaction by receiving the anchor transaction; in addition, when the implementation method in the first embodiment is used, if the consensus node maliciously broadcasts the invalid anchor transaction, the nodes on the blockchain are Only the invalid anchor transaction is received, therefore, the malicious invalid anchor transaction cannot be identified, and the transaction fails.
  • each node on the blockchain first receives the anchor transaction. Therefore, it is possible to identify whether the invalid anchor transaction is malicious according to the anchor transaction, and effectively ensure the reliable realization of the transaction.
  • the scenario of this embodiment is that user A in blockchain 1 (Chain1) wishes to pay the money in blockchain 2 to user B in blockchain 2 (Chain2).
  • the currency type in blockchain 1 is Coin1
  • the currency type in blockchain 2 is Coin2.
  • User A finds user C, who has assets in both blockchain 1 and blockchain 2, as an intermediary.
  • the assets of each role are shown in Table 4a and Table 4b before the transaction begins.
  • Table 4a Assets of User A and User C in Blockchain 1
  • Table 4b Assets of User B and User C in Blockchain 2
  • Table 5a Assets of User A and User C in Blockchain 1
  • Table 5b Assets of User B and User C in Blockchain 2
  • connection node generates a corresponding anchor request according to the interrelated transaction 1 and transaction 2, and sends an anchor request to the notary node, where the anchor request includes the data identifiers of transaction 1 and transaction 2 ( Key), the name of the blockchain to which transaction 1 and transaction 2 belong, and the anchor version number.
  • the specific content contained in the anchor request is shown in Table 6.
  • the notarization node After receiving the anchor request, the notarization node verifies whether the anchor version number in the anchor request is the same as the local account book. If it is different, returns a message with invalid data to the connection node and ends the process. If it is valid, it is anchored according to the anchor.
  • the request generates an anchor transaction (Tx1) corresponding to the anchor request and sends an anchor transaction to the consensus node.
  • the anchor transaction includes the data identification (key) of transaction 1 and transaction 2, the chain name of the transaction chain 1 and the block chain to which the transaction 2 belongs, and the anchor version number (version).
  • the specific content contained in the anchor transaction is shown in Table 7.
  • the consensus node After receiving the anchor transaction, the consensus node starts monitoring the write operation of the data corresponding to the data identifier in the subsequent transaction, and broadcasts the anchor transaction to all the nodes in the blockchain 1 and the blockchain 2.
  • the notarization node After receiving the anchor transaction broadcasted by the consensus node, the notarization node sends the anchor indication information to the connection node, where the anchor indication information includes the identifier of the anchor transaction and the identifier of the anchor request corresponding to the anchor transaction, and signature.
  • connection node After receiving the anchor indication information, the connection node obtains transaction 1 and transaction 2 corresponding to the anchor request according to the identifier of the anchor request, and then generates a related transaction (Tx2) according to transaction 1 and transaction 2 to send to the consensus node. .
  • Tx2 a related transaction
  • Table 8 The specific contents of the related party transactions are shown in Table 8.
  • the consensus node broadcasts the associated transaction to all nodes on blockchain 1 and blockchain 2.
  • the nodes in blockchain 1 and blockchain 2 receive the associated transaction, except for normal verification, such as transaction format, signature, etc. (nodes of each blockchain only verify the block to which the node belongs) Chain related content), also need to verify whether the anchor transaction corresponding to the associated transaction is a valid transaction. If the anchor transaction is a valid transaction, the node in blockchain 1 writes transaction 1 to blockchain 1, blockchain The node in 2 writes transaction 2 to blockchain 2.
  • Type TRANSACTION Content Chain1 invoke transfer(A,D,10)
  • Chain1 D 1 (here is the version number) Chain1 D 1 WriteSet Chain1 A 290 (value here) Chain1 D 110
  • the consensus node receives the transaction 3 (Tx3), and detects that the transaction 3 modifies the anchored data Chain1/A in the anchor transaction, then immediately after the transaction 3 is entered into the to-be-broadcast transaction queue of the blockchain 1
  • a transaction 4 (Tx4) of an invalid anchor transaction is added to each of the blockchain 1 and the blockchain 2 involved in the anchor transaction, and the format of the transaction 4 is as shown in Table 10.
  • the consensus node updates the local monitoring data table, deletes the anchor transaction (Tx1) from the monitoring data table, and does not continue to monitor the data change for the anchor transaction.
  • the node receives the associated transaction (Tx2) sent by the consensus node, queries the list of the anchor transaction according to the identifier of the anchor transaction (Tx1) included in the associated transaction, determines that the anchor transaction is an invalid transaction, and then abandons the associated transaction. Write to the blockchain maintained by the node. At this point, transaction 1 and transaction 2 failed to submit at the same time.
  • the application further provides a server, and the specific implementation of the server may refer to the foregoing method flow.
  • the present application provides a first type of server for implementing a node on a connection node, a node on a blockchain 1, and a node on a blockchain 2 in the method embodiment shown in FIGS. 2a, 2b, 4a, and 4b. , ..., the process or step performed by any of the nodes on the blockchain N.
  • the server 500 may include: a transceiver module 501, a processing module 502;
  • the transceiver module 501 is configured to receive an associated transaction sent by the consensus node; the associated transaction includes a transaction content of the plurality of transactions, an identifier of the blockchain to which the plurality of transactions belong, and an identifier of the anchor transaction;
  • the first blockchain is any blockchain in the blockchain to which the plurality of transactions belong;
  • the processing module 502 is configured to determine, according to the identifier of the anchor transaction, if the anchor transaction is a valid transaction, according to the identifier of the blockchain to which the plurality of transactions belong, the associated blockchain is The transaction of the first blockchain is written to the first blockchain.
  • the server 600 may include: a transceiver module 601, a processing module 602;
  • the transceiver module 601 is configured to receive an anchor transaction sent by the node, where the anchor transaction includes a data identifier of the plurality of transactions, an identifier of a blockchain to which the plurality of transactions belong, and an anchor version number;
  • the processing module 602 is configured to monitor data corresponding to the data identifier, and if the data corresponding to the data identifier is monitored, the transceiver module broadcasts to each node in the blockchain to which the multiple transactions belong. Invalid anchor transaction, the invalid anchor transaction includes identification information of the anchor transaction, and the invalid anchor transaction is used to indicate that the anchor transaction is an invalid transaction.
  • the division of the module in the embodiment of the present application is schematic, and is only a logical function division, and the actual implementation may have another division manner.
  • the functional modules in the embodiments of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
  • the integrated modules if implemented in the form of software functional modules and sold or used as separate products, may be stored in a computer readable storage medium.
  • a computer readable storage medium A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the methods described in various embodiments of the present application.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .
  • the present application provides a third server for implementing the connection node, the node on the blockchain 1, and the node on the blockchain 2 in the method embodiment shown in FIG. 2a, FIG. 2b, FIG. 4a and FIG. 4b. , ..., the process or step performed by any of the nodes on the blockchain N.
  • the server has the function of implementing the server 500 shown in FIG. 5; as shown in FIG. 7, the communication device 700 includes: a communication module 701, a processor 702;
  • the communication module 701 is configured to perform communication interaction with other devices;
  • the communication module 1001 may be an RF circuit, a WiFi module, a communication interface, a Bluetooth module, or the like;
  • the processor 702 is configured to implement the functions of the processing module in FIG. 5 above.
  • the communication device may further include: the memory 704, configured to store a program or the like.
  • the program can include program code, the program code including instructions.
  • Memory 704 may include RAM and may also include non-volatile memory, such as at least one disk storage.
  • the processor 702 executes the application stored in the memory 704 to implement the above functions.
  • the communication module 701, the processor 702, and the memory 704 can be connected to each other through the bus 703;
  • the bus 703 can be a peripheral component interconnect (PCI) bus or an extended industry standard structure ( Extended industry standard architecture, EISA) bus.
  • PCI peripheral component interconnect
  • EISA Extended industry standard architecture
  • the bus 703 can be divided into an address bus, a data bus, a control bus, and the like.
  • the present application also provides a fourth server for implementing the processes or steps performed by the consensus node in the method embodiment shown in Figures 2a, 2b, 4a, and 4b.
  • the server has the function of implementing the server 600 shown in FIG. 6; as shown in FIG. 8, the communication device 800 includes: a communication module 801, a processor 802;
  • the communication module 801 is configured to perform communication interaction with other devices;
  • the communication module 1001 may be an RF circuit, a WiFi module, a communication interface, a Bluetooth module, or the like;
  • the processor 802 is configured to implement the functions of the processing module in FIG. 6 above.
  • the communication device may further include: the memory 804, configured to store a program or the like.
  • the program can include program code, the program code including instructions.
  • Memory 804 may include RAM and may also include non-volatile memory, such as at least one disk storage.
  • the processor 802 executes the application stored in the memory 804 to implement the above functions.
  • the communication module 801, the processor 802, and the memory 804 can be connected to each other through the bus 803;
  • the bus 803 can be a peripheral component interconnect (PCI) bus or an extended industry standard structure ( Extended industry standard architecture, EISA) bus.
  • PCI peripheral component interconnect
  • EISA Extended industry standard architecture
  • the bus 803 can be divided into an address bus, a data bus, a control bus, and the like.
  • embodiments of the invention may be provided as a method, system, or computer program product.
  • embodiments of the invention may be in the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware.
  • embodiments of the invention may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • Embodiments of the invention are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
  • These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that instructions are executed by a processor of a computer or other programmable data processing device Means for implementing the functions specified in one or more flows of the flowchart or in a block or blocks of the flowchart.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Finance (AREA)
  • Economics (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Marketing (AREA)
  • Development Economics (AREA)
  • General Engineering & Computer Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Human Resources & Organizations (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Technology Law (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

一种跨链交易的方法及装置,该方法中,针对于相互关联的多个交易所属的区块链中第一区块链上的任一节点,该节点在接收到共识节点发送的关联交易后,需要根据关联交易中所包括的锚定交易的标识,确定锚定交易是否为有效交易,若锚定交易为有效交易,则根据所述多个交易所属的区块链的标识,将所属的区块链为第一区块链的交易写入第一区块链,从而能够保证多个区块链上相互关联的多个交易同时提交成功,有效避免现有技术中多个交易未能同时提交成功,已经成功的交易可能无法撤销的问题。且由于多个交易具有原子性,因此无需根据具体的业务类型涉及中间状态和回退交易。

Description

一种跨链交易方法及装置
本申请要求于2017年8月29日提交中国专利局、申请号为201710756457.9,发明名称为“一种跨链交易方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及区块链技术领域,特别涉及一种跨链交易方法及装置。
背景技术
区块链(Blockchain)系统中,数据均保存在区块中,新写入的数据组成新的区块,添加在当前区块链末端。每个区块在保存数据的同时,还要保存前一个区块中所有记录的数据唯一对应的一个数(往往是所有记录的数据的哈希值),从而形成链。因此,区块链系统可以认为是由分布式网络上的互相不完全信任的计算机,通过共识规则,共同维护一套可追溯、不可篡改的链式数据的系统。
区块链间的跨链交易有多种可能的场景,例如:场景1,区块链1中的用户A向在区块链2中的用户B支付若干资产;场景2,用户E在区块链1和区块链2上分别发起交易a和交易b,交易a和交易b为两个相互关联的交易。
以场景1为例,现有技术中的实现方案为:用户A和用户B协商后,确定一个在两个区块链上都有资产的用户C,扮演中间人的角色。用户A在区块链1中向Escrow发起交易(转移资产);用户C在区块链2中向Escrow发起交易,其中,Esrow在两个区块链上都有资产,且有公信力,类似一个中立的交易人。Escrow确定两笔交易都完成以后,再由Escrow在两个区块链中分别把相应的资产转移给用户C和用户B。然而,由于该方案的实现依赖中间人,Escrow需要在两个区块链上分别向用户C和用户B发起付款交易,如果因为某些原因而导致其中一笔交易失败,则需要撤销已经成功的交易,然而已经成功的交易可能会无法撤销,从而未能从根本上解决相互关联的交易在两个区块链上进行原子性提交的问题。
综上,目前亟需一种跨链交易方法,用于解决相互关联的交易在多个区块链上进行原子性提交的问题。
发明内容
本申请提供一种跨链交易方法,用于解决相互关联的交易在多个区块链上进行原子性提交的问题。
第一方面,本申请提供一种跨链交易,所述方法包括:
节点接收共识节点发送的关联交易;所述关联交易中包括多个交易的交易内容、所述多个交易所属的区块链的标识和锚定交易的标识;所述节点为第一区块链上的任一节点,所述第一区块链为所述多个交易所属的区块链中的任一区块链;
所述节点根据所述锚定交易的标识,若确定所述锚定交易为有效交易,则根据所述多个交易所属的区块链的标识,将所属的区块链为所述第一区块链的交易写入所述第一区块链。
如此,针对于相互关联的多个交易所属的区块链中第一区块链上的任一节点,该节点在接收到共识节点发送的关联交易后,需要根据关联交易中所包括的锚定交易的标识,确定锚定交易是否为有效交易,若锚定交易为有效交易,则根据所述多个交易所属的区块链的标识, 将所属的区块链为第一区块链的交易写入第一区块链,从而能够保证多个区块链上相互关联的多个交易同时提交成功,有效避免现有技术中多个交易未能同时提交成功,且已经成功的交易可能无法撤销的问题。且,采用本申请中的方法,由于多个交易具有原子性,因此无需根据具体的业务类型涉及中间状态和回退交易,能够有效解决现有技术中针对于业务逻辑比较复杂的情形难以设计中间状态和回退交易的问题。
在一种可能的设计中,所述节点若确定所述锚定交易为无效交易,则放弃写入所述关联交易。
在一种可能的设计中,所述节点确定所述锚定交易为无效交易之前,还包括:
所述节点接收所述共识节点发送的无效锚定交易,所述无效锚定交易中包括所述锚定交易的标识;
所述节点根据所述无效锚定交易,将所述锚定交易设置为无效交易。
在一种可能的设计中,所述节点接收共识节点发送的关联交易之前,还包括:
所述节点接收所述共识节点发送的所述锚定交易,并将所述锚定交易写入所述第一区块链。
在一种可能的设计中,所述节点为所述多个交易所属的区块链中共有的节点;
所述节点接收共识节点发送的关联交易之前,还包括:
所述节点向所述共识节点发送所述多个交易对应的所述锚定交易,所述锚定交易中包括所述多个交易的数据标识、所述多个交易所属的区块链的标识和锚定版本号;
所述节点确定所述锚定交易成功后,向所述共识节点发送关联交易。
在一种可能的设计中,所述节点向所述共识节点发送所述锚定交易,包括:
所述节点向公证节点发送所述多个交易对应的锚定请求,所述锚定请求用于请求所述公证节点生成所述锚定交易并发送给所述共识节点。
在一种可能的设计中,所述节点确定所述锚定交易成功后,向所述共识节点发送关联交易,包括:
所述节点接收所述公证节点发送的锚定指示信息,所述锚定指示信息用于指示所述锚定交易成功,所述锚定指示信息中包括所述锚定交易的标识和所述锚定请求的标识;
所述节点根据所述锚定请求的标识,确定所述锚定请求对应的所述多个交易,并根据所述多个交易,向所述共识节点发送所述关联交易。
第二方面,本申请提供一种跨链交易方法,所述方法包括:
共识节点接收节点发送的锚定交易,所述锚定交易中包括所述多个交易的数据标识、所述多个交易所属的区块链的标识;
所述共识节点监控所述数据标识对应的数据,若监控到所述数据标识对应的数据被修改,则向所述多个交易所属的区块链中的各个节点广播无效锚定交易,所述无效锚定交易中包括所述锚定交易的标识信息,所述无效锚定交易用于指示所述锚定交易为无效交易。
如此,共识节点通过接收节点发送的锚定交易,并对锚定交易中数据标识对应的数据进行监控,并在监控到数据被修改后,将监控结果通知给各个节点,以便于各个节点根据监控结果,将相互关联的多个交易同时提交失败,使得多个交易具有原子性。
在一种可能的设计中,所述锚定交易中还包括锚定版本号;
所述共识节点监控到所述数据被修改,包括:
所述共识节点接收其它交易,所述其它交易为不与所述多个交易相关联的交易,所述其 它交易中包括所述数据标识对应的数据的版本号;
所述共识节点若确定所述其它交易中包括的所述版本号不同于所述锚定版本号,则监控到所述数据被修改。
在一种可能的设计中,所述共识节点接收节点发送的锚定交易之后,还包括:
所述共识节点根据所述多个交易所属的区块链的标识,向所述锚定数据所在的区块链中的各个节点广播所述锚定交易。
在一种可能的设计中,所述共识节点向所述多个交易所属的区块链中的各个节点广播所述锚定交易之后,还包括:
所述共识节点接收所述节点发送的关联交易,所述关联交易中包括所述多个交易的交易内容、所述多个交易所属的区块链的标识和所述锚定交易的标识;
所述共识节点根据所述多个交易所属的区块链的标识,向所述多个交易所属的区块链中的各个节点广播关联交易。
第三方面,本申请提供一种跨链交易系统,所述跨链交易系统中包括多个共识节点和相互关联的多个交易所属的区块链上的节点;所述相互关联的多个交易所属的区块链上的节点包括连接节点,所述连接节点为所述相互关联的多个交易所属的区块链共有的节点;
所述连接节点,用于向所述共识节点发送锚定交易,所述锚定交易中包括多个交易的数据标识、所述多个交易所属的区块链的标识和锚定版本号;
所述共识节点,用于接收节点发送的锚定交易,并监控所述数据标识对应的数据,若监控到所述数据标识对应的数据被修改,则向所述多个交易所属的区块链中的各个节点广播无效锚定交易,所述无效锚定交易中包括所述锚定交易的标识信息,所述无效锚定交易用于指示所述锚定交易为无效交易;
所述连接节点,还用于向共识节点发送关联交易,所述关联交易中包括多个交易的交易内容、所述多个交易所属的区块链的标识和锚定交易的标识;
所述共识节点,还用于接收所述节点发送的关联交易,并根据所述多个交易所属的区块链的标识,向所述多个交易所属的区块链中的各个节点广播关联交易;
所述多个交易所属的区块链中的各个节点,用于接收所述关联交易,并根据所述锚定交易的标识,若确定所述锚定交易为有效交易,则将所述关联交易写入所述各个节点维护的区块链。
第四方面,本申请提供一种服务器,所述服务器为第一区块链上的任一节点所在的服务器,所述服务器包括:
收发模块,用于接收共识节点发送的关联交易;所述关联交易中包括多个交易的交易内容、所述多个交易所属的区块链的标识和锚定交易的标识;所述第一区块链为所述多个交易所属的区块链中的任一区块链;
处理模块,用于根据所述锚定交易的标识,若确定所述锚定交易为有效交易,则根据所述多个交易所属的区块链的标识,将所属的区块链为所述第一区块链的交易写入所述第一区块链。
在一种可能的设计中,所述服务器若确定所述锚定交易为无效交易,则放弃写入所述关联交易。
在一种可能的设计中,所述收发模块还用于:接收所述共识节点发送的无效锚定交易,所述无效锚定交易中包括所述锚定交易的标识;
所述处理模块具体用于:根据所述无效锚定交易,将所述锚定交易设置为无效交易。
在一种可能的设计中,所述收发模块接收共识节点发送的关联交易之前,还用于:接收所述共识节点发送的所述锚定交易;
所述处理模块,还用于将所述锚定交易写入所述第一区块链。
在一种可能的设计中,所述服务器为所述多个交易所属的区块链中共有的节点所在的服务器;
所述收发模块在接收共识节点发送的关联交易之前,还用于:向所述共识节点发送所述多个交易对应的所述锚定交易,所述锚定交易中包括所述多个交易的数据标识、所述多个交易所属的区块链的标识和锚定版本号;以及,确定所述锚定交易成功后,向所述共识节点发送关联交易。
在一种可能的设计中,所述收发模块还用于:所述节点向公证节点发送所述多个交易对应的锚定请求,所述锚定请求用于请求所述公证节点生成所述锚定交易并发送给所述共识节点。
在一种可能的设计中,所述收发模块具体用于:
接收所述公证节点发送的锚定指示信息,所述锚定指示信息用于指示所述锚定交易成功,所述锚定指示信息中包括所述锚定交易的标识和所述锚定请求的标识;
根据所述锚定请求的标识,确定所述锚定请求对应的所述多个交易,并根据所述多个交易,向所述共识节点发送所述关联交易。
第五方面,本申请提供一种服务器,所述服务器为共识节点所在的服务器,所述服务器包括:
收发模块,用于接收节点发送的锚定交易,所述锚定交易中包括所述多个交易的数据标识、所述多个交易所属的区块链的标识;
处理模块,用于监控所述数据标识对应的数据,若监控到所述数据标识对应的数据被修改,则通过所述收发模块向所述多个交易所属的区块链中的各个节点广播无效锚定交易,所述无效锚定交易中包括所述锚定交易的标识信息,所述无效锚定交易用于指示所述锚定交易为无效交易。
在一种可能的设计中,所述锚定交易中还包括锚定版本号;
所述收发模块还用于:
接收其它交易,所述其它交易为不与所述多个交易相关联的交易,所述其它交易中包括所述数据标识对应的数据的版本号;
所述处理模块具体用于:
若确定所述其它交易中包括的所述版本号不同于所述锚定版本号,则监控到所述数据标识对应的数据被修改。
在一种可能的设计中,所述收发模块接收节点发送的锚定交易之后,还用于:
根据所述多个交易所属的区块链的标识,向所述锚定数据所在的区块链中的各个节点广播所述锚定交易。
在一种可能的设计中,所述收发模块向所述多个交易所属的区块链中的各个节点广播所述锚定交易之后,还包括:
接收所述节点发送的关联交易,所述关联交易中包括所述多个交易的交易内容、所述多个交易所属的区块链的标识和所述锚定交易的标识;
根据所述多个交易所属的区块链的标识,向所述多个交易所属的区块链中的各个节点广播关联交易。
第六方面,本申请还提供一种服务器,该服务器具有实现上述第四方面方法示例中的功能;所述通信装置包括:通信模块、处理器;
所述通信模块,用于与其他设备进行通信交互;所述通信模块可以为RF电路、WiFi模块、通信接口、蓝牙模块等;
所述处理器,用于实现上述第四方面中处理模块的功能。
可选的,通信装置还可以包括:存储器,用于存放程序等。具体地,程序可以包括程序代码,该程序代码包括指令。存储器可能包含RAM,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。处理器执行存储器所存放的应用程序,使得服务器实现上述功能。
一种可能的方式中,通信模块、处理器和存储器可以通过所述总线相互连接;总线可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。
第七方面,本申请还提供一种服务器,该服务器具有实现上述第五方面方法示例中的功能;所述通信装置包括:通信模块、处理器;
所述通信模块,用于与其他设备进行通信交互;所述通信模块可以为RF电路、WiFi模块、通信接口、蓝牙模块等;
所述处理器,用于实现上述第五方面中处理模块的功能。
可选的,通信装置还可以包括:存储器,用于存放程序等。具体地,程序可以包括程序代码,该程序代码包括指令。存储器可能包含RAM,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。处理器执行存储器所存放的应用程序,使得服务器实现上述功能。
一种可能的方式中,通信模块、处理器和存储器可以通过所述总线相互连接;总线可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。所述总线可以分为地址总线、数据总线、控制总线等。
本申请还提供了一种计算机可读存储介质,所述存储介质存储有指令,当所述指令在计算机上运行时,使得计算机实现执行上述任意一种设计提供的跨链交易方法。
本申请还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述任意一种设计提供的跨链交易方法。
本申请还提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述任意一种设计提供的跨链交易方法。
附图说明
图1为本申请适用的一种系统架构示意图;
图2a为本申请实施例一提供的一种跨链交易的流程示意图;
图2b为本申请实施例一提供的另一种跨链交易的流程示意图;
图3为本申请中共识节点的监控示意图;
图4a为本申请实施例二提供的一种跨链交易的流程示意图;
图4b为本申请实施例二提供的另一种跨链交易的流程示意图;
图5为本申请提供的第一种服务器的结构示意图;
图6为本申请提供的第二种服务器的结构示意图;
图7为本申请提供的第三种服务器的结构示意图;
图8为本申请提供的第四种服务器的结构示意图。
具体实施方式
下面结合说明书附图对本申请进行具体说明。
本申请中的跨链交易方法可适用于多种系统架构。图1为本申请适用的一种系统架构示意图,该系统架构中可包括共识服务网络、两个或两个以上区块链网络,例如图1所示出的第一区块链网络和第二区块链网络。其中,共识服务网络中可以包括多个具有共识功能的共识节点,例如图1所示出的共识节点a1、共识节点a2、共识节点a3和共识节点a4。在图1所示的架构中,第一区块链网络和第二区块链网络共用由共识服务网络中的各个共识节点提供的共识服务。
具体来说,区块链网络是由多个节点组成的点对点(peer to peer,P2P)网络,P2P是一种运行在传输控制协议(transmission control protocol,TCP)协议之上的应用层协议,在区块链网络中的节点彼此对等,网络中不存在中心节点,每个节点都可以随机连接其它节点。
由于区块链网络是一个P2P的分布式网络,校验交易记录并在众多节点之间共识是一个比较慢的过程,但在实际应用中,很多场景需要较快的交易速度。一种比较快速的共识机制为背书证明(proof of endorse,PoE)。这种共识机制的核心在于区块链网络中的多个背书节点(endorser)运行智能合约并对合约运行结果(endorsement)进行背书(通过对背书节点本身的合约运行结果内容进行签名,保证是由特定背书节点发出的结果)。用户可以根据实际需求设置自己的智能合约要信任的背书节点及对多个合约运行结果的验证策略(endorse policy)。例如,可以向3个背书节点发送智能合约运行请求(proposal),验证策略可以要求3个合约运行结果的内容必须一致,也可以要求至少两个合约运行结果的内容一致。客户端设备收集背书节点返回的合约运行结果包含在交易中,并通过共识服务网络广播到区块链网络中所有节点(包括背书节点)。节点校验接收到的交易,若交易满足验证策略,则接受该交易对数据的修改,写入区块链。
实际运行过程中,整个区块链网络是分布式的,从而使得数据的同步会有时间上的差异。背书节点在运行某条交易的智能合约代码时获取的数据,与交易最终要写入区块链时的数据很有可能会不一致,进而使得背书节点的背书失效。为解决这一问题,可以为智能合约的每个数据设置自增的版本号,并在更新数据时对数据的版本号同时进行更新。
如图1所示,第一区块链网络中包括节点b1、节点b2、节点b3、节点b4、节点d1、节点d2,这些节点共同维护区块链1;第二区块链网络中包括节点c1、节点c2、节点c3、节点c4、节点c5、节点d1、节点d2,这些节点共同维护区块链2。其中,区块链是以区块为单位存储交易清单,区块链中的区块按照时间顺序生成,每个区块用于记录一段时间内产生的交易清单。区块链上所记录的所有交易清单即为账本(Ledger),例如,区块链1上记录的账本为Ledger1,区块链2上记录的账本为Ledger2,本申请中,在不引起歧义的情况下,账本和区块链是可以互相替代的同等概念。
需要说明的是,上述系统架构仅为一种逻辑上的示意;在物理上,区块链网络中的一个节点在一台物理机(服务器)上,或者,多个区块链网络中的多个节点在同一个服务器上,一个节点具体可以是指服务器中运行的一个进程或者一系列进程,例如,第一区块链网络中的节点a1和第二区块链网络中的节点c1可以为一个服务器上运行的两个进程。
本申请中所描述的节点可以是指节点所在的服务器。
进一步地,一个或一个以上的客户端可以通过接入网络而与节点进行通信。例如,若用户A在区块链1中有资产,则用户A可通过客户端a与第一区块链网络中的任意节点进行通信,从而在区块链1中发起交易;若用户B在区块链2中有资产,则用户B可通过客户端b与第二区块链网络中的任意节点进行通信,从而在区块链2中发起交易;若用户C在区块链1和区块链2中均有资产,则用户C可通过客户端c同时在第一区块链网络和第二区块链网络中的任意节点进行通信,从而在区块链1或区块链2中发起交易。
需要说明的是,本申请中,也可以不设置客户端设备,此时,用户可直接通过区块链上的节点而在区块链中发起交易,具体不做限定。
基于图1所示出的架构,在进行区块链间的资产交易时,以区块链1中的用户A要给区块链2中的用户B支付100单位资产的场景为例,现有技术中的实现方式为,在每个区块链中引入了一个Escrow角色,类似一个中立的交易人,两个区块链中分别先向Esrow发起交易,而在Escrow确定两笔交易都完成以后,再由Escrow分别把资产转移给各个区块链中的参与者。具体流程如下:
S1,用户A选择用户C作为中间人;用户C为区块链1和区块链2中的用户;
S2,在区块链1中,用户A把资产转给Escrow(称为交易1),此时交易1的状态是准备状态(Prepared);
S3,在区块链2中,用户C在看到区块链1中用户A转给Escrow的交易之后(Prepared),把资产转给区块链2中的Escrow(称为交易2),此时交易2的状态是准备状态(Prepared);
S4,区块链2中的用户B看到交易2的状态是准备状态后签发一个收款签名;
S5,由一组证明人(Notary)来监视区块链2中用户B是否签发了收款签名,这组证明人本身可以通过共识形成对用户B是否在规定的过期时间内签发了收款签名输出一致、可信的结果;如果证明人发现用户B在区块链2中的收款签名,则通知区块链1和区块链2将Escrow中的资产转移给交易对象,即通知区块链1中的Escrow向中间人用户C发送资产,以及通知区块链2中的Escrow向用户B发送资产;否则,将Escrow中保管的资产退回给交易的发起者,即区块链1中Escrow发送给用户A,区块链2中Escrow发送给用户C。
上述方案可以扩展到通过N个区块链的资产支付(区块链1→…→区块链N),证明人通过观察区块链N的支付目标是否收签发了收款签名,来通知所有区块链上的Escrow是否将代管的资产发给交易目标或是退还给交易的发起者。
上述实现方式中,Escrow需要在两个区块链上分别向用户C和用户B发起付款交易,如果因为某些原因而导致其中一笔交易失败,则需要撤销已经成功的交易,然而已经成功的交易可能会无法撤销,从而导致交易的安全保障性较差。
基于此,本申请提供一种跨链交易方法,针对于相互关联的多个交易所属的区块链中第一区块链上的任一节点,该节点在接收到共识节点发送的关联交易后,需要根据关联交易中所包括的锚定交易的标识,确定锚定交易是否为有效交易,若锚定交易为有效交易,则根据所述多个交易所属的区块链的标识,将所属的区块链为第一区块链的交易写入第一区块链, 从而能够保证多个区块链上相互关联的多个交易同时提交成功,有效避免现有技术中多个交易未能同时提交成功,且已经成功的交易可能无法撤销的问题。且,采用本申请中的方法,由于多个交易具有原子性,因此无需根据具体的业务类型涉及中间状态和回退交易,能够有效解决现有技术中针对于业务逻辑比较复杂的情形难以设计中间状态和回退交易的问题。
为便于清楚地描述本申请,可将在多个区块链(如图1中的区块链1和区块链2)上执行关联交易的节点称为连接节点(connect peer),可将为多个区块链上交易的数据执行背书的节点称为公证节点(notary peer)。其中,连接节点和公证节点均为区块链1和区块链2共有的节点,公证节点为预先从多个区块链共有的节点中指定的节点,用于执行第三方公证作用,公证节点能够接收到多个区块链的交易信息。
实施例一
基于图1所示的系统架构,图2a为本申请实施例一提供的一种跨链交易方法所对应的流程示意图。如图2a所示,该方法包括:
步骤201,连接节点根据相互关联的多个交易,生成所述多个交易对应的锚定交易,并向共识节点发送锚定交易,锚定交易中包括所述多个交易的数据标识、所述多个交易所属的区块链的标识和锚定版本号。
此处,相互关联的多个交易可以为相互关联的两个或两个以上的交易,相应地,多个交易所属的区块链为两个或两个以上的区块链,例如,区块链1、区块链2、……、区块链N,N为正整数。
以“用户A需要使用其在区块链1中的资产,向在区块链2中的用户B支付若干区块链2中的资产,并选择在两个区块链上都有资产的用户C作为中间人”的场景为例,用户A、用户B和用户C协商:由用户A在区块链1中向用户C支付资产(第一交易),由用户C在区块链2中向用户B支付资产(第二交易)。第一交易和第二交易为相互关联的多个交易。第一交易所属的区块链为区块链1,第二交易所属的区块链为区块链2。
其中,多个交易的数据标识是指在多个交易所属的区块链上调用智能合约请求所要访问的数据的变量,多个交易的数据标识对应的数据即为在多个交易所属的区块链上调用智能合约请求所要访问的数据。例如,第一交易的数据标识可以为用户A的标识、用户C的标识。用户A的标识对应的数据即为用户A在区块链1中的资产数据,用户C的标识即为用户C在区块链1中的资产数据。
锚定版本号是指在多个交易所属的区块链上调用智能合约请求所要访问的数据的版本号。
区块链的标识可以为用于唯一标识区块链的信息,例如,区块链的编号,具体不做限定。
进一步地,本申请中,相互关联的多个交易可以携带有相同的关联标识。连接节点生成多个交易对应的锚定交易后,可建立锚定交易的标识与多个交易携带的关联标识的对应关系并存储。具体的存储方式可以有多种,例如,采用数据表的形式存储,如表1所示。
表1:多个交易的关联标识与锚定交易的标识的对应关系示例
关联标识 锚定交易的标识
关联标识1 锚定交易1
关联标识2 锚定交易2
…… ……
步骤202,共识节点接收锚定交易,并监控所述数据标识对应的数据。
本申请中,共识节点的监控方式有多种,例如,共识节点可以通过维护一个本地数据监控表来实现:共识节点每发送出一个锚定交易,便将该锚定交易加入到数据监控表,当监控到数据标识对应的数据被修改时,将该锚定交易从数据监控表中移除。
具体来说,共识节点可以用一个消息队列的中间件来实现,从统一的接口接收各个连接节点发送来的锚定交易。如图3所示,共识节点根据锚定交易中多个交易所属的区块链的标识,将交易信息记录到不同的分区(partition),例如,partition0、partition1和partition2,不同分区对应不同的区块链上的交易。例如,partition0对应区块链1上的交易,partition1对应区块链2上的交易,partition3对应区块链3上的交易。以partition0为例,分区中的编号(0、1、2、……、11、12……)用于表示区块链1上各个需要监控的交易。共识节点可以根据区块链的标识,将不同分区中的交易信息打包成区块(block)发送给对应的区块链的节点。
步骤203,共识节点若监控到所述数据标识对应的数据被修改,则向所述多个交易所属的区块链中的各个节点广播无效锚定交易,所述无效锚定交易中包括所述锚定交易的标识信息,所述无效锚定交易用于指示所述锚定交易为无效交易。
本申请中,导致数据标识对应的数据被修改的情形可以有多种,例如,共识节点接收到第三交易(用户A在区块链1中向用户D支付资产),由于第三交易对用户A的资产数据进行了更改,从而导致数据标识对应的数据被修改。具体来说,第三交易中包含数据标识对应的数据的版本号时,共识节点若判断发现第三交易中包含的版本号不同于锚定交易中的锚定版本号,则确定监控到数据标识对应的数据被修改;第三交易中不包含版本号,共识节点若判断发现第三交易中对数据标识对应的数据进行写操作,则确定监控到数据标识对应的数据被修改。
共识节点接收到第三交易后,检测第三交易修改了锚定交易中的数据标识对应的数据(具体为用户A在区块链1中的资产数据),则将第三交易记入区块链1中的待广播交易队列,并立即在区块链1和区块链2的待广播交易队列中加入无效锚定交易,以及更新本地的监控数据表,把锚定交易从监控数据表中删除,不再继续监控锚定数据。
步骤204,多个交易所属的区块链上的节点接收共识节点发送的无效锚定交易。
步骤205,连接节点向共识节点发送关联交易,关联交易中包括多个交易的交易内容、所述多个交易所属的区块链的标识和锚定交易的标识。
步骤206,共识节点接收关联交易,根据多个交易所属的区块链的标识,将关联交易发送给多个交易所属的区块链上的节点。
此处,针对于上述场景,共识节点接收关联交易后,根据关联交易中所包括第一交易所属的区块链1的标识和第二交易所属的区块链2的标识,可将关联交易发送给区块链1中的各个节点和区块链2中的各个节点。
步骤207,针对于多个交易所属的区块链中第一区块链上的任一节点,该节点接收到关联交易后,根据关联交易中包括的锚定交易的标识,确定锚定交易为无效交易,并放弃写入所述关联交易。
本申请中,节点还需要对关联交易的交易格式、签名等进行本地验证,并在本地验证通过且锚定交易为有效交易的情况下,方可将所属的区块链为第一区块链的交易写入第一区块 链。对关联交易的交易格式、签名等进行本地验证的具体内容可参照现有技术,此处不再赘述。进一步地,本申请对本地验证和锚定交易验证的先后顺序不做限定,一种可能的实现方式为,节点可以先验证锚定交易是否为有效交易,若锚定交易为无效交易,则可直接放弃写入,而无需再进行有效性验证,从而节省处理负担。
此处,第一区块链为多个交易所属的区块链中的任一区块链,例如,区块链1或区块链2。具体来说,区块链1上的节点和区块链2上的节点接收到关联交易后,根据关联交易中包括的锚定交易的标识以及步骤204中接收到的无效锚定交易,确定锚定交易为无效交易后,放弃写入关联交易,此时,关联交易中的第一交易和第二交易同时提交失败。
需要说明的是,本申请中,若在步骤203中,共识节点未监控到所述数据标识对应的数据被修改,则可以不做处理,如此,多个交易所属的区块链上的节点也不会接收到无效锚定交易。相应地,在步骤207中,多个交易所属的区块链上的节点接收到关联交易后,确定锚定交易为有效交易,并将关联交易写入相应的区块链中。具体来说,区块链1上的节点接收到关联交易后,确定锚定交易为有效交易,并将第一交易写入区块链1中;区块链2上的节点接收到关联交易后,确定锚定交易为有效交易,并将第二交易写入区块链2中;以及,连接节点(区块链1和区块链2共有的节点)接收到关联交易后,确定锚定交易为有效交易,并将第一交易写入区块链1中,将第二交易写入区块链2中。此时,关联交易中的第一交易和第二交易同时提交成功。此种情形下的具体流程可参见图2b。图2b所示出的流程与图2a相比,由于共识节点的监控结果不同,进而导致了不同的执行结果。图2b中的相关步骤均可参照图2a中的描述,具体不再赘述。
进一步地,在上述步骤203中,为降低共识节点的处理负担,可在共识节点接收到锚定交易并开始监控时启动一个相应的计时器,若定时器到达设定时长仍未监控到数据被修改,则可广播无效锚定交易,并不再继续监控。其中,设定时长可由本领域技术人员根据实际情况进行设定。一种可能的场景中,共识节点在设定时长内未监控到数据被修改,定时器到达设定时长时关联交易已经提交成功,此时共识节点无需再监控锚定交易,而为了避免后续锚定交易被恶意使用,共识节点可以向多个交易所属的区块链上的各个节点广播无效锚定交易。
需要说明的是:(1)上述步骤编号仅为执行过程的一种示例性表示,本申请对各个步骤的先后顺序不做具体限定。(2)步骤203和步骤204可以发生在步骤202之后和步骤207之前的任何时间,具体不做限定。(3)图2a和图2b仅以两个区块链(区块链1和区块链2)为例,具体实施中,也可以有两个以上的区块链(区块链1、区块链2、……、区块链N),两个以上区块链的实现过程可参照上述描述。
实施例二
图4a为本申请提供的一种跨链交易方法所对应的流程示意图。如图4a所示,该方法包括:
步骤401,连接节点根据相互关联的多个交易,生成所述多个交易对应的锚定请求,并向公证节点发送锚定请求,锚定请求中包括所述多个交易的数据标识、所述多个交易所属的区块链的标识和锚定版本号。
本申请中,相互关联的多个交易可以携带有相同的关联标识。连接节点生成多个交易对应的锚定请求后,可建立锚定请求的标识与多个交易携带的关联标识的对应关系并存储。具 体的存储方式可以有多种,例如,采用数据表的形式存储,如表2所示。
表2:多个交易的关联标识与锚定请求的标识的对应关系示例
关联标识 锚定交易的标识
关联标识1 锚定请求1
关联标识2 锚定请求2
…… ……
步骤402,公证节点接收到连接节点发送的锚定请求后,生成所述锚定请求对应的锚定交易,并将所述锚定交易发送给共识节点;所述锚定交易中包括所述多个交易的数据标识、所述多个交易所属的区块链的标识和锚定版本号。
此处,公证节点接收到锚定请求后,可以验证锚定请求中的锚定版本号是否与本地账本相同,若相同,则生成锚定请求对应的锚定交易,并执行后续流程,若不同,则向连接节点返回数据无效的消息并结束流程。
本申请中,公证节点生成所述锚定请求对应的锚定交易后,可建立锚定请求的标识与锚定交易的标识之间的对应关系并存储,如表3所示。
表3:锚定请求的标识与锚定交易的标识的对应关系示例
锚定请求的标识 锚定交易的标识
锚定请求1 锚定交易1
锚定请求2 锚定交易2
…… ……
步骤403,共识节点接收锚定交易,根据所述多个交易所属的区块链的标识,将所述锚定交易发送给所述多个交易所属的区块链上的节点,并监控所述数据标识对应的数据。
步骤404,共识节点若监控到所述数据标识对应的数据被修改,则向所述多个交易所属的区块链中的各个节点广播无效锚定交易,所述无效锚定交易中包括所述锚定交易的标识信息,所述无效锚定交易用于指示所述锚定交易为无效交易。
步骤405,多个交易所属的区块链上的节点接收共识节点发送的无效锚定交易,并将锚定交易设置为无效交易。
具体来说,节点将锚定交易设置为无效交易可以是指节点为锚定交易设置一个无效标识,该无效标识表示锚定交易为无效交易,或者,也可以是通过其它方式来设置,具体不做限定。
本申请中,节点可以在本地维护一个锚定交易的列表,列表中包括锚定交易的标识以及锚定交易是否为无效交易的无效标识,带有无效标识的锚定交易均为无效交易,而不带有无效标识的锚定交易均为有效交易。如此,可通过查询列表快速确定出锚定交易为有效交易或无效交易。
需要说明的是,节点将锚定交易设置为无效交易也可以是指:直接将无效的锚定交易从列表中删除。如此,节点查询列表,若未能从列表中找到锚定交易,则确定该锚定交易为无效交易,若能够从列表中找到锚定交易,则确定该锚定交易为有效交易。
步骤406,公证节点接收到共识节点在步骤403中发送的所述锚定交易后,向中间节点发送锚定指示信息,所述锚定指示信息用于指示所述锚定交易成功,所述锚定指示信息中包 括所述锚定交易的标识和所述锚定交易对应的锚定请求的标识。
此处,公证节点接收到锚定交易后,根据锚定交易的标识以及锚定交易的标识和锚定请求的标识之间的对应关系,可确定出对应的锚定请求的标识,进而向中间节点发送锚定指示信息。
步骤407,连接节点接收公证节点发送的锚定指示信息,根据所述锚定请求的标识,确定对应的关联标识,进而根据携带该关联标识的多个交易生成关联交易,以及将所述关联交易发送给共识节点;所述关联交易包括所述多个交易的交易内容、所述多个交易所属的区块链的标识和所述锚定交易的标识。
步骤408,共识节点接收关联交易,根据多个交易所属的区块链的标识,将关联交易发送给多个交易所属的区块链上的节点。
步骤409,针对于多个交易所属的区块链中第一区块链上的任一节点,该节点接收到关联交易后,根据关联交易中包括的锚定交易的标识,确定锚定交易为无效交易,并放弃写入所述关联交易。
需要说明的是,本申请中,若在步骤404中,共识节点未监控到所述数据标识对应的数据被修改,则可以不做处理。如此,在步骤409中,多个交易所属的区块链上的节点接收到关联交易后,确定锚定交易为有效交易,并将关联交易写入相应的区块链中。具体来说,区块链1上的节点接收到关联交易后,确定锚定交易为有效交易,并将第一交易写入区块链1中;区块链2上的节点接收到关联交易后,确定锚定交易为有效交易,并将第二交易写入区块链2中;以及,公正节点和连接节点(均为区块链1和区块链2共有的节点)在接收到关联交易后,确定锚定交易为有效交易,并将第一交易写入区块链1中,将第二交易写入区块链2中。此种情形下的具体流程可参见图4b。图4b所示出的流程与图4a相比,由于共识节点的监控结果不同,进而导致了不同的执行结果。图4b中的相关步骤均可参照图4a中的描述,具体不再赘述。
进一步地,在上述步骤404中,为降低共识节点的处理负担,可在共识节点接收到锚定交易并开始监控时启动一个相应的计时器,若定时器到达设定时长仍未监控到数据被修改,则可广播无效锚定交易,并不再继续监控。其中,设定时长可由本领域技术人员根据实际情况进行设定。一种可能的场景中,共识节点向多个交易所属的区块链上的各个节点广播锚定交易后,节点可以对锚定交易进行验证,如果节点接收到锚定交易时,锚定交易中的锚定版本号与节点账本中不同,则说明锚定版本号已经失效,此时,节点可直接将锚定交易设置为无效交易;而针对于共识节点,通过设置设定时长,可使得共识节点在定时器到达设定时长后,向多个交易所属的区块链中的各个节点广播无效锚定交易,并不再监控锚定交易。
需要说明的是:(1)上述步骤编号仅为执行过程的一种示例性表示,本申请对各个步骤的先后顺序不做具体限定。(2)步骤404和步骤405可以发生在步骤403之后和步骤409之前的任何时间,具体不做限定。(3)针对于上述步骤401和步骤402,另一种可能的实现方式为:连接节点向公证节点发送的锚定请求中仅包括多个交易的数据标识和所述多个交易所属的区块链的标识,进而由公证节点根据锚定请求获取锚定版本号,并生成锚定交易发送给共识节点。(4)图4a和图4b仅以两个区块链(区块链1和区块链2)为例,具体实施中,也可以有两个以上的区块链(区块链1、区块链2、……、区块链N),两个以上区块链的实现过程可参照上述描述。
针对于上述实施例一和实施例二的具体实现过程可知,实施例二相比于实施例一来说,差异在于:(1)实施例二中涉及有公证节点,即连接节点在发起关联交易之前,先向公证节点发送锚定请求,进而由公证节点向共识节点发送锚定交易,通过引入具有权威的公证节点,由公证节点对锚定版本号进行验证,并在验证通过后生成锚定交易,从而能够保证锚定版本号的有效性。(2)实施例二中,共识节点接收到锚定交易后,根据多个交易所属的区块链的标识,将锚定交易广播给多个交易所属的区块链上的节点,从而使得区块链上的节点通过接收锚定交易,能够有效记录交易的实现过程;此外,采用实施例一中的实现方式时,若共识节点恶意广播无效锚定交易,则由于区块链上的各个节点仅是接收无效锚定交易,因此,无法识别出恶意的无效锚定交易,进而导致交易失败,而采用实施例二中的实现方式时,由于区块链上的各个节点先接收到了锚定交易,因此可根据锚定交易对无效锚定交易是否恶意进行识别,有效保证交易的可靠实现。
除上述描述的差异之外,实施例二中各个步骤的具体实现方式可参照实施例一中的相应步骤。
实施例三
下面结合一个具体实施例(采用实施例二中的实现流程)对本申请中的跨链交易方法进行说明。
该实施例的场景为:区块链1(Chain1)中的用户A希望向在区块链2(Chain2)中的用户B支付区块链2中的货币。其中,区块链1中的货币类型是Coin1,区块链2中的货币类型是Coin2。用户A找到在区块链1和区块链2中都有资产的用户C作为中间人,交易开始前,各角色的资产情况如表4a和表4b所示。
表4a:用户A和用户C在区块链1中的资产情况
用户 资产数据 版本号
A 300 Coin1 1
C 2000 Coin2 1
表4b:用户B和用户C在区块链2中的资产情况
用户 资产数据 版本号
B 500 Coin1 1
C 3000 Coin2 1
用户A、用户B和用户C协商后,用户C所需做的是:在区块链1上向用户A收取10Coin1(称为交易1),在区块链2上向B支付20 Coin2(称为交易2)。转账交易的函数为transfer,智能合约函数的伪代码如下:
Figure PCTCN2018099348-appb-000001
Figure PCTCN2018099348-appb-000002
最终交易完成后,想要达到的效果如表5a和表5b所示。
表5a:用户A和用户C在区块链1中的资产情况
用户 资产数据 版本号
A 290 Coin1 2
C 2010 Coin2 2
表5b:用户B和用户C在区块链2中的资产情况
用户 资产数据 版本号
B 520 Coin1 2
C 2980 Coin2 2
下面具体描述关联交易的实现过程:
(1)连接节点根据所述相互关联的交易1和交易2,生成对应的锚定请求(anchor request)并向公证节点发送锚定请求,锚定请求中包括交易1和交易2的数据标识(key)、交易1和交易2所属的区块链的标识(chain name)和锚定版本号(version)。锚定请求中包含的具体内容如表6所示。
表6:锚定请求内容示例
Figure PCTCN2018099348-appb-000003
(2)公证节点收到锚定请求后,验证锚定请求中的锚定版本号是否与本地账本相同,如果不同,向连接节点返回数据无效的消息并结束流程,若有效,则根据锚定请求生成锚定请求对应的锚定交易(Tx1),并向共识节点发送锚定交易。锚定交易中包括交易1和交易2的数据标识(key)、交易1和交易2所属的区块链的标识(chain name)和锚定版本号(version)。锚定交易中包含的具体内容如表7所示。
表7:锚定交易内容示例
Figure PCTCN2018099348-appb-000004
Figure PCTCN2018099348-appb-000005
(4)共识节点接收到锚定交易后,开始监控后续交易中对数据标识对应的数据的写操作,并广播锚定交易到区块链1和区块链2中的所有节点。
(5)公证节点接收到从共识节点广播的锚定交易后,向连接节点发送锚定指示信息,锚定指示信息中包括锚定交易的标识和锚定交易对应的锚定请求的标识,并签名。
(6)连接节点接收到锚定指示信息后,根据锚定请求的标识,得到与锚定请求对应的交易1和交易2,进而根据交易1和交易2生成关联交易(Tx2)发送给共识节点。关联交易中的具体内容如表8所示。
表8:关联交易内容示例
Figure PCTCN2018099348-appb-000006
(7)共识节点广播关联交易到区块链1和区块链2上的所有节点。
(8)区块链1和区块链2中的节点在接收到关联交易,除了进行正常的验证,例如交易格式、签名等(每个区块链的节点只验证与该节点所属的区块链相关的内容),还需要验证关联交易对应的锚定交易是否为有效交易,若锚定交易为有效交易,则区块链1中的节点将交易1写入区块链1,区块链2中的节点将交易2写入区块链2。
至此,交易1和交易2同时提交成功。
在上述过程中,由于共识节点在后续交易中未监控到对锚定数据的写操作,因此,交易1和交易2同时提交成功。假如在上述(5)至(8)之间,存在另外一个与关联交易有冲突的交易3(即修改同一数据),并且交易3先于关联交易到达共识节点进行广播。交易3的格式如表9所示。
表9:交易3的格式示例
TxID xxxxxxxxxxxxxxxxx0003
Type TRANSACTION
Content Chain1 invoke transfer(A,D,10)
ReadSet Chain1 A 1(此处为版本号)
  Chain1 D 1
WriteSet Chain1 A 290(此处为值)
  Chain1 D 110
如此,则在上述步骤(4)之后,相应的流程为:
(4a)共识节点收到交易3(Tx3),检测到交易3修改了锚定交易中锚定的数据Chain1/A,则在将交易3记入区块链1的待广播交易队列之后,立即向锚定交易涉及的区块链1和区块链2中各加入一个无效锚定交易的交易4(Tx4),交易4的格式如表10所示。
表10:交易4的格式示例
TxID invalidxxxx0004
Type IVALIDANCHOR
ANCHORTX anchorxxxxxxxxxxx0001
同时,共识节点更新本地的监控数据表,把锚定交易(Tx1)从监控数据表中删除,不再继续为锚定交易监控数据变化。
(4b)区块链1和区块链1上的节点在收到交易4(Tx4)之后,根据交易4中包括的锚定交易的标识(Tx1),从本地维护的锚定交易列表中找到Tx1,将其标记为无效(或从列表中删除)。
(4c)节点接收共识节点发送的关联交易(Tx2),根据关联交易中包括的锚定交易(Tx1)的标识,查询锚定交易的列表,确定锚定交易为无效交易,进而放弃将关联交易写入节点维护的区块链。此时,交易1和交易2同时提交失败。
针对上述方法流程,本申请还提供一种服务器,该服务器的具体实现可参照上述方法流程。
本申请提供第一种服务器,该服务器用于实现图2a、图2b、图4a和图4b中所示方法实施例中由连接节点、区块链1上的节点、区块链2上的节点、……、区块链N上的节点中任一项所执行的流程或者步骤。参阅图5所示,服务器500可以包括:收发模块501、处理模块502;
所述收发模块501,用于接收共识节点发送的关联交易;所述关联交易中包括多个交易的交易内容、所述多个交易所属的区块链的标识和锚定交易的标识;所述第一区块链为所述多个交易所属的区块链中的任一区块链;
所述处理模块502,用于根据所述锚定交易的标识,若确定所述锚定交易为有效交易,则根据所述多个交易所属的区块链的标识,将所属的区块链为所述第一区块链的交易写入所述第一区块链。
本申请提供第二种服务器,该服务器用于实现图2a、图2b、图4a和图4b中所示方法实施例中由共识节点所执行的流程或者步骤。参阅图6所示,服务器600可以包括:收发模块601、处理模块602;
收发模块601,用于接收节点发送的锚定交易,所述锚定交易中包括所述多个交易的数据标识、所述多个交易所属的区块链的标识和锚定版本号;
处理模块602,用于监控所述数据标识对应的数据,若监控到所述数据标识对应的数据被修改,则通过所述收发模块向所述多个交易所属的区块链中的各个节点广播无效锚定交易,所述无效锚定交易中包括所述锚定交易的标识信息,所述无效锚定交易用于指示所述锚定交易为无效交易。
需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。在本申请的实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
本申请提供第三种服务器,该服务器用于实现图2a、图2b、图4a和图4b中所示方法实施例中由连接节点、区块链1上的节点、区块链2上的节点、……、区块链N上的节点中任一项所执行的流程或者步骤。该服务器具有实现上述图5所示的服务器500的功能;如图7所示,通信装置700包括:通信模块701、处理器702;
所述通信模块701,用于与其他设备进行通信交互;所述通信模块1001可以为RF电路、WiFi模块、通信接口、蓝牙模块等;
所述处理器702,用于实现上述图5中处理模块的功能。
可选的,通信装置还可以包括:所述存储器704,用于存放程序等。具体地,程序可以包括程序代码,该程序代码包括指令。存储器704可能包含RAM,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。处理器702执行存储器704所存放的应用程序,实现上述功能。
一种可能的方式中,通信模块701、处理器702和存储器704可以通过所述总线703相互连接;总线703可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。所述总线703可以分为地址总线、数据总线、控制总线等。
本申请还提供第四种服务器,该服务器用于实现图2a、图2b、图4a和图4b中所示方法实施例中由共识节点所执行的流程或者步骤。该服务器具有实现上述图6所示的服务器600的功能;如图8所示,通信装置800包括:通信模块801、处理器802;
所述通信模块801,用于与其他设备进行通信交互;所述通信模块1001可以为RF电路、WiFi模块、通信接口、蓝牙模块等;
所述处理器802,用于实现上述图6中处理模块的功能。
可选的,通信装置还可以包括:所述存储器804,用于存放程序等。具体地,程序可以包括程序代码,该程序代码包括指令。存储器804可能包含RAM,也可能还包括非易失性 存储器(non-volatile memory),例如至少一个磁盘存储器。处理器802执行存储器804所存放的应用程序,实现上述功能。
一种可能的方式中,通信模块801、处理器802和存储器804可以通过所述总线803相互连接;总线803可以是外设部件互连标准(peripheral component interconnect,PCI)总线或扩展工业标准结构(extended industry standard architecture,EISA)总线等。所述总线803可以分为地址总线、数据总线、控制总线等。
本领域内的技术人员应明白,本发明实施例可提供为方法、系统、或计算机程序产品。因此,本发明实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明实施例是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,本领域的技术人员可以对本发明实施例进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本发明实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。

Claims (24)

  1. 一种跨链交易方法,其特征在于,所述方法包括:
    节点接收共识节点发送的关联交易;所述关联交易中包括多个交易的交易内容、所述多个交易所属的区块链的标识和锚定交易的标识;所述节点为第一区块链上的任一节点,所述第一区块链为所述多个交易所属的区块链中的任一区块链;
    所述节点根据所述锚定交易的标识,若确定所述锚定交易为有效交易,则根据所述多个交易所属的区块链的标识,将所属的区块链为所述第一区块链的交易写入所述第一区块链。
  2. 根据权利要求1所述的方法,其特征在于,所述节点若确定所述锚定交易为无效交易,则放弃写入所述关联交易。
  3. 根据权利要求2所述的方法,其特征在于,所述节点确定所述锚定交易为无效交易之前,还包括:
    所述节点接收所述共识节点发送的无效锚定交易,所述无效锚定交易中包括所述锚定交易的标识;
    所述节点根据所述无效锚定交易,将所述锚定交易设置为无效交易。
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述节点接收共识节点发送的关联交易之前,还包括:
    所述节点接收所述共识节点发送的所述锚定交易,并将所述锚定交易写入所述第一区块链。
  5. 根据权利要求4所述的方法,其特征在于,所述节点为所述多个交易所属的区块链中共有的节点;
    所述节点接收共识节点发送的关联交易之前,还包括:
    所述节点向所述共识节点发送所述多个交易对应的所述锚定交易,所述锚定交易中包括所述多个交易的数据标识、所述多个交易所属的区块链的标识和锚定版本号;
    所述节点确定所述锚定交易成功后,向所述共识节点发送关联交易。
  6. 根据权利要求5所述的方法,其特征在于,所述节点向所述共识节点发送所述锚定交易,包括:
    所述节点向公证节点发送所述多个交易对应的锚定请求,所述锚定请求用于请求所述公证节点生成所述锚定交易并发送给所述共识节点。
  7. 根据权利要求6所述的方法,其特征在于,所述节点确定所述锚定交易成功后,向所述共识节点发送关联交易,包括:
    所述节点接收所述公证节点发送的锚定指示信息,所述锚定指示信息用于指示所述锚定交易成功,所述锚定指示信息中包括所述锚定交易的标识和所述锚定请求的标识;
    所述节点根据所述锚定请求的标识,确定所述锚定请求对应的所述多个交易,并根据所述多个交易,向所述共识节点发送所述关联交易。
  8. 一种跨链交易方法,其特征在于,所述方法包括:
    共识节点接收节点发送的锚定交易,所述锚定交易中包括所述多个交易的数据标识、所述多个交易所属的区块链的标识;
    所述共识节点监控所述数据标识对应的数据,若监控到所述数据标识对应的数据被修改,则向所述多个交易所属的区块链中的各个节点广播无效锚定交易,所述无效锚定交易中 包括所述锚定交易的标识信息,所述无效锚定交易用于指示所述锚定交易为无效交易。
  9. 根据权利要求8所述的方法,其特征在于,所述锚定交易中还包括锚定版本号;
    所述共识节点监控到所述数据被修改,包括:
    所述共识节点接收其它交易,所述其它交易为不与所述多个交易相关联的交易,所述其它交易中包括所述数据标识对应的数据的版本号;
    所述共识节点若确定所述其它交易中包括的所述版本号不同于所述锚定版本号,则监控到所述数据被修改。
  10. 根据权利要求8或9所述的方法,其特征在于,所述共识节点接收节点发送的锚定交易之后,还包括:
    所述共识节点根据所述多个交易所属的区块链的标识,向所述锚定数据所在的区块链中的各个节点广播所述锚定交易。
  11. 根据权利要求10所述的方法,其特征在于,所述共识节点向所述多个交易所属的区块链中的各个节点广播所述锚定交易之后,还包括:
    所述共识节点接收所述节点发送的关联交易,所述关联交易中包括所述多个交易的交易内容、所述多个交易所属的区块链的标识和所述锚定交易的标识;
    所述共识节点根据所述多个交易所属的区块链的标识,向所述多个交易所属的区块链中的各个节点广播关联交易。
  12. 一种跨链交易系统,其特征在于,所述跨链交易系统中包括多个共识节点和相互关联的多个交易所属的区块链上的节点;所述相互关联的多个交易所属的区块链上的节点包括连接节点,所述连接节点为所述相互关联的多个交易所属的区块链共有的节点;
    所述连接节点,用于向所述共识节点发送锚定交易,所述锚定交易中包括多个交易的数据标识、所述多个交易所属的区块链的标识和锚定版本号;
    所述共识节点,用于接收节点发送的锚定交易,并监控所述数据标识对应的数据,若监控到所述数据标识对应的数据被修改,则向所述多个交易所属的区块链中的各个节点广播无效锚定交易,所述无效锚定交易中包括所述锚定交易的标识信息,所述无效锚定交易用于指示所述锚定交易为无效交易;
    所述连接节点,还用于向共识节点发送关联交易,所述关联交易中包括多个交易的交易内容、所述多个交易所属的区块链的标识和锚定交易的标识;
    所述共识节点,还用于接收所述节点发送的关联交易,并根据所述多个交易所属的区块链的标识,向所述多个交易所属的区块链中的各个节点广播关联交易;
    所述多个交易所属的区块链中的各个节点,用于接收所述关联交易,并根据所述锚定交易的标识,若确定所述锚定交易为有效交易,则将所述关联交易写入所述各个节点维护的区块链。
  13. 一种服务器,其特征在于,所述服务器为第一区块链上的任一节点所在的服务器,所述服务器包括:
    收发模块,用于接收共识节点发送的关联交易;所述关联交易中包括多个交易的交易内容、所述多个交易所属的区块链的标识和锚定交易的标识;所述第一区块链为所述多个交易所属的区块链中的任一区块链;
    处理模块,用于根据所述锚定交易的标识,若确定所述锚定交易为有效交易,则根据所述多个交易所属的区块链的标识,将所属的区块链为所述第一区块链的交易写入所述第一区 块链。
  14. 根据权利要求13所述的服务器,其特征在于,所述服务器若确定所述锚定交易为无效交易,则放弃写入所述关联交易。
  15. 根据权利要求14所述的服务器,其特征在于,所述收发模块还用于:接收所述共识节点发送的无效锚定交易,所述无效锚定交易中包括所述锚定交易的标识;
    所述处理模块具体用于:根据所述无效锚定交易,将所述锚定交易设置为无效交易。
  16. 根据权利要求13至15中任一项所述的服务器,其特征在于,所述收发模块接收共识节点发送的关联交易之前,还用于:接收所述共识节点发送的所述锚定交易;
    所述处理模块,还用于将所述锚定交易写入所述第一区块链。
  17. 根据权利要求16所述的服务器,其特征在于,所述服务器为所述多个交易所属的区块链中共有的节点所在的服务器;
    所述收发模块在接收共识节点发送的关联交易之前,还用于:向所述共识节点发送所述多个交易对应的所述锚定交易,所述锚定交易中包括所述多个交易的数据标识、所述多个交易所属的区块链的标识和锚定版本号;以及,确定所述锚定交易成功后,向所述共识节点发送关联交易。
  18. 根据权利要求17所述的服务器,其特征在于,所述收发模块还用于:所述节点向公证节点发送所述多个交易对应的锚定请求,所述锚定请求用于请求所述公证节点生成所述锚定交易并发送给所述共识节点。
  19. 根据权利要求18所述的服务器,其特征在于,所述收发模块具体用于:
    接收所述公证节点发送的锚定指示信息,所述锚定指示信息用于指示所述锚定交易成功,所述锚定指示信息中包括所述锚定交易的标识和所述锚定请求的标识;
    根据所述锚定请求的标识,确定所述锚定请求对应的所述多个交易,并根据所述多个交易,向所述共识节点发送所述关联交易。
  20. 一种服务器,其特征在于,所述服务器为共识节点所在的服务器,所述服务器包括:
    收发模块,用于接收节点发送的锚定交易,所述锚定交易中包括所述多个交易的数据标识、所述多个交易所属的区块链的标识和锚定版本号;
    处理模块,用于监控所述数据标识对应的数据,若监控到所述数据标识对应的数据被修改,则通过所述收发模块向所述多个交易所属的区块链中的各个节点广播无效锚定交易,所述无效锚定交易中包括所述锚定交易的标识信息,所述无效锚定交易用于指示所述锚定交易为无效交易。
  21. 根据权利要求20所述的服务器,其特征在于,所述锚定交易中还包括锚定版本号;
    所述收发模块还用于:
    接收其它交易,所述其它交易为不与所述多个交易相关联的交易,所述其它交易中包括所述数据标识对应的数据的版本号;
    所述处理模块具体用于:
    若确定所述其它交易中包括的所述版本号不同于所述锚定版本号,则监控到所述数据标识对应的数据被修改。
  22. 根据权利要求20或21所述的服务器,其特征在于,所述收发模块接收节点发送的锚定交易之后,还用于:
    根据所述多个交易所属的区块链的标识,向所述锚定数据所在的区块链中的各个节点广 播所述锚定交易。
  23. 根据权利要求22所述的服务器,其特征在于,所述收发模块向所述多个交易所属的区块链中的各个节点广播所述锚定交易之后,还包括:
    接收所述节点发送的关联交易,所述关联交易中包括所述多个交易的交易内容、所述多个交易所属的区块链的标识和所述锚定交易的标识;
    根据所述多个交易所属的区块链的标识,向所述多个交易所属的区块链中的各个节点广播关联交易。
  24. 一种计算机可读存储介质,其特征在于,所述存储介质存储有指令,当所述指令在计算机上运行时,使得计算机实现执行权利要求1-11中任一项所述的方法。
PCT/CN2018/099348 2017-08-29 2018-08-08 一种跨链交易方法及装置 WO2019042101A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP18850286.8A EP3627431B1 (en) 2017-08-29 2018-08-08 Cross-chain trading method and apparatus
US16/787,669 US11347726B2 (en) 2017-08-29 2020-02-11 Cross-chain transaction method and apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710756457.9 2017-08-29
CN201710756457.9A CN109426949B (zh) 2017-08-29 2017-08-29 一种跨链交易方法及装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/787,669 Continuation US11347726B2 (en) 2017-08-29 2020-02-11 Cross-chain transaction method and apparatus

Publications (1)

Publication Number Publication Date
WO2019042101A1 true WO2019042101A1 (zh) 2019-03-07

Family

ID=65503391

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/099348 WO2019042101A1 (zh) 2017-08-29 2018-08-08 一种跨链交易方法及装置

Country Status (4)

Country Link
US (1) US11347726B2 (zh)
EP (1) EP3627431B1 (zh)
CN (1) CN109426949B (zh)
WO (1) WO2019042101A1 (zh)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190102736A1 (en) * 2017-10-02 2019-04-04 R3 Ltd. Settling obligations via netting transactions
WO2019120316A2 (en) 2019-03-26 2019-06-27 Alibaba Group Holding Limited System and method for implementing different types of blockchain contracts
CN110278264A (zh) * 2019-06-20 2019-09-24 深圳前海微众银行股份有限公司 一种基于区块链的跨链通信的方法、装置及交易系统
CN111125187A (zh) * 2019-11-29 2020-05-08 立旃(上海)科技有限公司 基于区块链的数据管理方法及装置
US10733152B2 (en) 2018-12-29 2020-08-04 Alibaba Group Holding Limited System and method for implementing native contract on blockchain
US20200349564A1 (en) * 2019-04-30 2020-11-05 Salesforce.Com, Inc. System and method of providing interoperable distributed and decentralized ledgers using consensus on consensus and delegated consensus
CN112417049A (zh) * 2020-11-24 2021-02-26 杭州云象网络技术有限公司 一种基于区块链一体机的跨链交互方法与系统
WO2021109735A1 (zh) * 2019-12-05 2021-06-10 深圳前海微众银行股份有限公司 一种基于跨链网络的资源处理方法及装置
CN113051008A (zh) * 2021-04-01 2021-06-29 金蝶软件(中国)有限公司 接口请求处理方法、装置、计算机设备和存储介质
US11086847B2 (en) 2018-12-29 2021-08-10 Advanced New Technologies Co., Ltd. System and method for implementing native contract on blockchain

Families Citing this family (45)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110019516B (zh) 2017-11-10 2021-08-20 华为技术有限公司 一种信息管理方法、装置及系统
US11676142B2 (en) 2018-09-05 2023-06-13 Atrium Separate Ip Holdings Number 4, Llc Blockchain architecture, system, method and device for automated cybersecurity and data privacy law compliance with proprietary off-chain storage mechanism
US11557011B1 (en) * 2018-09-06 2023-01-17 Side, Inc. Blockchain-based system and method for document transformation and accountability
US10901983B2 (en) * 2019-03-01 2021-01-26 Wanchain Ltd. System and method for universal blockchain interoperability
US11132344B2 (en) * 2019-03-15 2021-09-28 Boardwalktech, Inc. Correlating and referencing blockchains
CN110033271B (zh) * 2019-03-22 2023-12-22 湖南天河国云科技有限公司 一种跨链交易方法、系统及计算机可读存储介质
CN110086856B (zh) * 2019-04-01 2022-02-01 达闼机器人有限公司 区块链节点的控制方法、装置、存储介质及电子设备
US10924280B1 (en) * 2019-04-15 2021-02-16 Sprint Communications Company L.P. Digital notary use in distributed ledger technology (DLT) for block construction and verification
US11507948B2 (en) 2019-04-22 2022-11-22 Atrium Separate Ip Holdings Number 4, Llc Blockchain architecture, system, method and device for automated cybersecurity and data privacy law compliance with delayed block posting protocol
CN110321384B (zh) * 2019-06-04 2023-07-28 创新先进技术有限公司 一种基于区块链的数据记录方法、装置及电子设备
US10742415B2 (en) 2019-06-28 2020-08-11 Alibaba Group Holding Limited Method and apparatus for inter-blockchain transmission of authenticable message
CN110417742B (zh) * 2019-06-28 2020-11-06 创新先进技术有限公司 跨链发送、中转、接收可认证消息的方法、装置及存储介质
CN110430066B (zh) * 2019-07-15 2021-07-06 杭州复杂美科技有限公司 用于减少区块链交易重复广播的方法、设备及存储介质
CN112308713A (zh) * 2019-07-26 2021-02-02 华为技术有限公司 一种跨链交易方法和装置
EP3996028B1 (en) 2019-07-26 2025-01-29 Huawei Technologies Co., Ltd. Cross-chain transaction method and apparatus
CN110532239B (zh) * 2019-09-09 2022-05-06 东吴证券股份有限公司 文件系统管理方法、装置、设备及存储介质
US12211041B2 (en) 2019-09-19 2025-01-28 Atrium Separate Ip Holdings Number 4, Llc Blockchain architecture, system, method and device for automated cybersecurity and data privacy law compliance with a streamlined block structure
US11636195B2 (en) 2019-09-19 2023-04-25 Atrium Separate Ip Holdings Number 4, Llc Dynamic biometric identity verification system, method and device
US11968256B2 (en) 2019-09-19 2024-04-23 Atrium Separate Ip Holdings Number 4, Llc Blockchain architecture, system, method and device for automated cybersecurity and data privacy law compliance with a partitioned replication protocol
CN112561695B (zh) * 2019-09-25 2021-07-23 支付宝(杭州)信息技术有限公司 在区块链中并发执行交易的方法和装置
CN110689434B (zh) * 2019-09-26 2023-03-21 重庆邮电大学 一种基于公证人组的跨区块链交互方法
CN111010441B (zh) * 2019-12-18 2022-12-13 深圳市迅雷网络技术有限公司 一种区块链跨链方法、系统及电子设备
US11381401B2 (en) * 2020-01-07 2022-07-05 Seagate Technology Llc Blockchain transaction forwarding
CN111368003B (zh) * 2020-03-06 2020-10-16 安徽中科智链信息科技有限公司 一种多链锚定数据的管理方法
CN111090891B (zh) * 2020-03-23 2020-06-19 卓尔智联(武汉)研究院有限公司 一种基于区块链的公证人选取方法及系统
CN111399993B (zh) * 2020-03-25 2023-03-07 百度国际科技(深圳)有限公司 一种关联事务请求的跨链实现方法、装置、设备和介质
CN111464636B (zh) * 2020-03-31 2021-12-07 中国联合网络通信集团有限公司 资产交易方法和系统、存储介质
US12009073B2 (en) 2020-04-22 2024-06-11 Atrium Separate Ip Holdings Number 4, Llc Blockchain architecture, system, method and device for facilitating secure medical testing, data collection and controlled distribution using a decentralized health information platform and token ecosystem
US12008555B2 (en) 2020-04-22 2024-06-11 Atrium Separate Ip Holdings Number 4, Llc Blockchain architecture, system, method and device including a hybrid public-private iteration for facilitating secure data collection and controlled distribution using a decentralized transaction information platform and token ecosystem
US11996174B2 (en) 2020-04-22 2024-05-28 Atrium Separate Ip Holdings Number 4, Llc Blockchain architecture, system, method and device for facilitating electronic health record maintenance, sharing and monetization using a decentralized health information platform including a non-fungible token function and security protocols
CN111353175B (zh) * 2020-05-22 2021-01-22 腾讯科技(深圳)有限公司 数据处理方法、装置、设备、区块链系统及存储介质
CN113761179A (zh) 2020-06-03 2021-12-07 富泰华工业(深圳)有限公司 评论管控方法、服务器及可读存储介质
TWI799713B (zh) * 2020-06-03 2023-04-21 鴻海精密工業股份有限公司 評論管控方法、伺服器及可讀儲存介質
SG10202006466YA (en) 2020-07-03 2021-05-28 Alipay Labs Singapore Pte Ltd Managing transactions in multiple blockchain networks
SG10202006447VA (en) 2020-07-03 2021-04-29 Alipay Labs Singapore Pte Ltd Managing transactions in multiple blockchain networks
SG10202006451QA (en) 2020-07-03 2021-02-25 Alipay Labs Singapore Pte Ltd Managing transactions in multiple blockchain networks
CN112637127B (zh) * 2020-11-23 2022-05-13 北京邮电大学 一种跨区块链通信方法及装置
CN112598518A (zh) * 2020-12-24 2021-04-02 北京链化未来科技有限公司 一种支持跨链原子交易的处理方法
US11531649B1 (en) * 2021-01-04 2022-12-20 Sprint Communications Company Lp Method of building and searching a multi-dimensional cross-linked distributed ledger
US12222925B1 (en) * 2021-05-25 2025-02-11 Stripe, Inc. Systems and methods for ensuring quality of search system data
CN113923228B (zh) * 2021-06-02 2024-08-27 支付宝(杭州)信息技术有限公司 跨链交互方法及装置
CN113779155B (zh) * 2021-09-24 2024-08-09 支付宝(杭州)信息技术有限公司 区块链交易处理方法、装置及设备
CN113806335A (zh) * 2021-09-28 2021-12-17 杭州溪塔科技有限公司 一种应用于区块链的数据迁移方法及装置
CN113838543A (zh) * 2021-10-04 2021-12-24 上海边界智能科技有限公司 一种医疗信息的跨链共享方法、跨链共享平台及存储介质
CN113689216A (zh) * 2021-10-26 2021-11-23 腾讯科技(深圳)有限公司 跨链事务处理方法及装置、设备、存储介质、程序产品

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105976232A (zh) * 2016-06-24 2016-09-28 深圳前海微众银行股份有限公司 资产交易方法和装置
CN106780025A (zh) * 2016-11-30 2017-05-31 中国银行股份有限公司 区块链中数字资产的转移方法、装置及系统
US20170193464A1 (en) * 2015-12-18 2017-07-06 Justin SHER Protocol utilizing bitcoin blockchain for maintaining independently proposed and approved set contents
CN106936589A (zh) * 2017-04-21 2017-07-07 杭州秘猿科技有限公司 一种无中心的许可链平行分片方法及交易方法
CN106960388A (zh) * 2017-03-01 2017-07-18 中钞信用卡产业发展有限公司北京智能卡技术研究院 跨区块链的数字资产流转的方法和装置
CN107018125A (zh) * 2017-02-17 2017-08-04 阿里巴巴集团控股有限公司 一种区块链系统、数据存储方法及装置

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107660293B (zh) * 2015-04-20 2022-04-26 欧吉达克斯公司 物权电子凭证(edt)的分布式管理方法及其系统
KR101701131B1 (ko) * 2016-04-28 2017-02-13 주식회사 라피 이종간 블록체인 연결을 이용한 데이터 기록/검증 방법 및 시스템
US20170345011A1 (en) * 2016-05-26 2017-11-30 Hitfin, Inc. System and method executed on a blockchain network
US20190244227A1 (en) * 2016-07-28 2019-08-08 Nec Corporation Bulletin board information management system
US11907406B2 (en) * 2016-08-01 2024-02-20 Cryptowerk Corp. Computer-implemented method and system of tamper-evident recording of a plurality of service data items
US20180114218A1 (en) * 2016-10-26 2018-04-26 International Business Machines Corporation Blockchain: automatic fork protection
US10387684B2 (en) * 2016-12-09 2019-08-20 International Business Machines Corporation Interlocked blockchains to increase blockchain security
US20180285839A1 (en) * 2017-04-04 2018-10-04 Datient, Inc. Providing data provenance, permissioning, compliance, and access control for data storage systems using an immutable ledger overlay network
CN106899698B (zh) * 2017-04-11 2020-12-18 张铮文 一种区块链之间的跨链互操作方法
CN107085810A (zh) * 2017-04-19 2017-08-22 朱皞罡 一种区块链的跨链操作方法及区块链管理系统
US10594488B2 (en) * 2017-08-05 2020-03-17 Proclus Technologies Limited Method and system for implementing automatic transaction rebroadcasting for transient blockchains
US10834062B2 (en) * 2018-06-20 2020-11-10 International Business Machines Corporation Unlinking ownership of successive asset transfers on a blockchain

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170193464A1 (en) * 2015-12-18 2017-07-06 Justin SHER Protocol utilizing bitcoin blockchain for maintaining independently proposed and approved set contents
CN105976232A (zh) * 2016-06-24 2016-09-28 深圳前海微众银行股份有限公司 资产交易方法和装置
CN106780025A (zh) * 2016-11-30 2017-05-31 中国银行股份有限公司 区块链中数字资产的转移方法、装置及系统
CN107018125A (zh) * 2017-02-17 2017-08-04 阿里巴巴集团控股有限公司 一种区块链系统、数据存储方法及装置
CN106960388A (zh) * 2017-03-01 2017-07-18 中钞信用卡产业发展有限公司北京智能卡技术研究院 跨区块链的数字资产流转的方法和装置
CN106936589A (zh) * 2017-04-21 2017-07-07 杭州秘猿科技有限公司 一种无中心的许可链平行分片方法及交易方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3627431A4

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10810546B2 (en) * 2017-10-02 2020-10-20 R3 Ltd. Settling obligations via netting transactions
US11625680B2 (en) 2017-10-02 2023-04-11 R3 Ltd. Settling obligations via netting transactions
US20190102736A1 (en) * 2017-10-02 2019-04-04 R3 Ltd. Settling obligations via netting transactions
US11086847B2 (en) 2018-12-29 2021-08-10 Advanced New Technologies Co., Ltd. System and method for implementing native contract on blockchain
US10733152B2 (en) 2018-12-29 2020-08-04 Alibaba Group Holding Limited System and method for implementing native contract on blockchain
US11010184B2 (en) 2019-03-26 2021-05-18 Advanced New Technologies Co., Ltd. System and method for implementing different types of blockchain contracts
EP3612930A4 (en) * 2019-03-26 2020-06-24 Alibaba Group Holding Limited System and method for implementing different types of blockchain contracts
WO2019120316A2 (en) 2019-03-26 2019-06-27 Alibaba Group Holding Limited System and method for implementing different types of blockchain contracts
US10860350B2 (en) 2019-03-26 2020-12-08 Advanced New Technologies Co., Ltd. System and method for implementing different types of blockchain contracts
US10866823B2 (en) 2019-03-26 2020-12-15 Advanced New Technologies Co., Ltd. System and method for implementing different types of blockchain contracts
US10949231B2 (en) 2019-03-26 2021-03-16 Advanced New Technologies Co., Ltd. System and method for implementing different types of blockchain contracts
US20200349564A1 (en) * 2019-04-30 2020-11-05 Salesforce.Com, Inc. System and method of providing interoperable distributed and decentralized ledgers using consensus on consensus and delegated consensus
US11995647B2 (en) * 2019-04-30 2024-05-28 Salesforce, Inc. System and method of providing interoperable distributed and decentralized ledgers using consensus on consensus and delegated consensus
CN110278264A (zh) * 2019-06-20 2019-09-24 深圳前海微众银行股份有限公司 一种基于区块链的跨链通信的方法、装置及交易系统
CN110278264B (zh) * 2019-06-20 2023-02-21 深圳前海微众银行股份有限公司 一种基于区块链的跨链通信的方法、装置及交易系统
CN111125187A (zh) * 2019-11-29 2020-05-08 立旃(上海)科技有限公司 基于区块链的数据管理方法及装置
WO2021109735A1 (zh) * 2019-12-05 2021-06-10 深圳前海微众银行股份有限公司 一种基于跨链网络的资源处理方法及装置
CN112417049A (zh) * 2020-11-24 2021-02-26 杭州云象网络技术有限公司 一种基于区块链一体机的跨链交互方法与系统
CN112417049B (zh) * 2020-11-24 2024-03-12 杭州云象网络技术有限公司 一种基于区块链一体机的跨链交互方法与系统
CN113051008A (zh) * 2021-04-01 2021-06-29 金蝶软件(中国)有限公司 接口请求处理方法、装置、计算机设备和存储介质

Also Published As

Publication number Publication date
US11347726B2 (en) 2022-05-31
CN109426949A (zh) 2019-03-05
CN109426949B (zh) 2021-02-09
US20200175003A1 (en) 2020-06-04
EP3627431A4 (en) 2020-05-13
EP3627431A1 (en) 2020-03-25
EP3627431B1 (en) 2025-03-26

Similar Documents

Publication Publication Date Title
WO2019042101A1 (zh) 一种跨链交易方法及装置
CN110352445B (zh) 使用智能合约执行多方交易
US12243054B2 (en) Systems and methods for addressing security-related vulnerabilities arising in relation to off-blockchain channels in the event of failures in a network
US11461773B2 (en) Blockchain-based node management methods and apparatuses
JP7292783B2 (ja) 許可型ブロックチェーンにおける優先順位付け
EP3816910B1 (en) Blockchain-based transaction processing method and apparatus, and electronic device
US11070360B2 (en) Parallel transaction validation and block generation in a blockchain
TWI662435B (zh) 分散式系統及訊息處理方法
US12093247B2 (en) Blockchain system and method
JP7637456B2 (ja) 一対の結合ブロックチェーンを構成するバイナリブロックチェーンに関連するコンピュータ実装システム及び方法
US12118556B2 (en) Database configuration for asset transfers
US20190354518A1 (en) Chain mesh network for decentralized transaction systems
JP7228322B2 (ja) ブロックチェーン・ネットワークにおける自動コミット・トランザクション管理
TW202025045A (zh) 基於區塊鏈的發票報銷方法及裝置、電子設備
WO2023045620A1 (zh) 一种交易数据处理方法、装置、计算机设备以及存储介质
CN107993149A (zh) 账户信息管理方法、系统以及可读存储介质
TW201943250A (zh) 跨區塊鏈的認證方法及裝置、電子設備
WO2019001141A1 (zh) 一种跨链交易方法及装置
WO2020082892A1 (zh) 基于区块链的交易处理方法及装置、电子设备
US20210158310A1 (en) Blockchain-based transaction processing methods and apparatuses and electronic devices
WO2022121538A1 (zh) 基于区块链的数据同步方法、系统及相关设备
US12072866B2 (en) Data processing method and apparatus, computer device, and storage medium
JP2023515369A (ja) 分散型データベース
WO2023045617A1 (zh) 一种交易数据处理方法、装置、设备以及介质
Dinh et al. A blueprint for interoperable blockchains

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: 18850286

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2018850286

Country of ref document: EP

Effective date: 20191218

NENP Non-entry into the national phase

Ref country code: DE