WO2023116098A1 - 一种跨链事务处理方法、装置、计算设备和介质 - Google Patents

一种跨链事务处理方法、装置、计算设备和介质 Download PDF

Info

Publication number
WO2023116098A1
WO2023116098A1 PCT/CN2022/120865 CN2022120865W WO2023116098A1 WO 2023116098 A1 WO2023116098 A1 WO 2023116098A1 CN 2022120865 W CN2022120865 W CN 2022120865W WO 2023116098 A1 WO2023116098 A1 WO 2023116098A1
Authority
WO
WIPO (PCT)
Prior art keywords
chain
cross
transaction
source
value
Prior art date
Application number
PCT/CN2022/120865
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 杭州趣链科技有限公司
Publication of WO2023116098A1 publication Critical patent/WO2023116098A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing
    • 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/2358Change logging, detection, and notification
    • 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • the present application belongs to the technical field of blockchain, and in particular relates to a cross-chain transaction processing method, device, computing device and medium.
  • Cross-chain is to achieve trusted interoperability between different blockchains.
  • the atomicity of cross-chain transactions means that both the source chain and the destination chain of the cross-chain transaction are executed successfully, or both fail to execute. If the execution fails, it needs to be restored to the unexecuted state.
  • the existing cross-chain transaction processing mechanism is roughly divided into two types: Hash Time Locked Contract (HTLC for short), and a two-stage mechanism based on the relay chain.
  • the hash time locking mechanism is a decentralized cross-chain atomic swap protocol that does not require a trusted third-party intermediary.
  • the application scenarios of the hash locking mechanism are very limited, it is only used for asset exchange, and has a strict time limit. If one party cannot process cross-chain transactions within the upper limit of the clock due to problems such as network and equipment, the atomicity of cross-chain transactions cannot be fully guaranteed.
  • the two-stage mechanism based on the relay chain needs to freeze the relevant assets of the source chain and the destination chain in advance, and execute or roll back according to the transaction processing results returned by the relay chain. But this method needs to execute two transactions on the target chain.
  • the embodiment of the present application provides a cross-chain transaction processing method, device, computing device and medium, to ensure the atomicity in the process of cross-chain transaction processing, and simplify the cross-chain process of the target chain.
  • the first aspect of the embodiment of the present application provides a cross-chain transaction processing method, which is applied to the relay chain, and the method includes:
  • the third cross-chain transaction including the execution result of the target chain on the cross-chain transaction
  • the fourth cross-chain transaction includes the execution result and the transaction state of the cross-chain transaction
  • the second aspect of the embodiment of the present application provides a cross-chain transaction processing device, which is applied to the relay chain, and the device includes:
  • the transaction state table initialization module is used to initialize the transaction state table of the first cross-chain transaction when receiving the first cross-chain transaction initiated by the source chain, and the first cross-chain transaction has a corresponding cross-chain transaction;
  • a destination chain determination module configured to analyze the first cross-chain transaction and determine the destination chain of the first cross-chain transaction
  • the second cross-chain transaction building module is used to construct a second cross-chain according to the first cross-chain transaction and the transaction state table if the source chain and the destination chain have been registered in the relay chain trade;
  • a second cross-chain transaction sending module configured to send the second cross-chain transaction to the destination chain
  • the third cross-chain transaction receiving module is configured to receive the third cross-chain transaction returned by the target chain according to the second cross-chain transaction, the third cross-chain transaction includes the transaction of the target chain to the cross-chain transaction Results of the;
  • a transaction status table updating module configured to update the transaction status table according to the execution result
  • a fourth cross-chain transaction construction module configured to construct a fourth cross-chain transaction according to the third cross-chain transaction and the updated transaction state table, the fourth cross-chain transaction includes the execution result and the Transaction status of cross-chain transactions;
  • a fourth cross-chain transaction sending module configured to return the fourth cross-chain transaction to the source chain, so that the source chain can process the cross-chain transaction according to the execution result and the transaction state.
  • a third aspect of the embodiments of the present application provides a computing device, including a memory, a processor, and a computer program stored in the memory and operable on the processor, when the processor executes the computer program Implement the method as described in the first aspect above.
  • a fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the above-mentioned first aspect is implemented.
  • a fifth aspect of the embodiments of the present application provides a computer program product, which, when running on a computing device, causes the computing device to execute the method described in the first aspect above.
  • the cross-chain transaction between the source chain and the destination chain can be carried out through the relay chain.
  • the source chain initiates the first cross-chain transaction, and the first cross-chain transaction has a corresponding cross-chain transaction; the source chain sends the first cross-chain transaction to the relay chain through the cross-chain gateway; the relay chain receives the first cross-chain transaction After that, initialize the transaction status table of the first cross-chain transaction, and use the transaction status table to record the transaction status of the cross-chain transaction in the relay chain.
  • the relay chain analyzes the first cross-chain transaction to determine the destination chain of the cross-chain transaction; if the destination chain has been registered in the relay chain, the second cross-chain transaction can be constructed according to the first cross-chain transaction and transaction status table.
  • the destination chain can execute the cross-chain transaction, and then return the third cross-chain transaction according to the execution result of the cross-chain transaction; after receiving the third cross-chain transaction, the relay chain can The third cross-chain transaction obtains the execution result of the cross-chain transaction, updates the transaction state table according to the execution result, and then constructs the fourth cross-chain transaction according to the updated transaction state table and the third cross-chain transaction, and transfers the fourth cross-chain transaction through the cross-chain gateway Chain transactions are sent to the source chain.
  • the source link After the source link receives the fourth cross-chain transaction, it can analyze the fourth cross-chain transaction to determine the execution result of the cross-chain transaction, and the source chain updates the processing status of the cross-chain transaction according to the execution result.
  • the execution results of cross-chain transactions can be kept uniform, and the transaction atomicity of cross-chain transactions can be realized.
  • only one chain-up in the destination chain is required, which simplifies the cross-chain process of the destination chain.
  • Figure 1 is a schematic flow chart of the steps of a cross-chain transaction processing method provided by an embodiment of the present application
  • Figure 2 is a schematic diagram of the successful execution of a cross-chain transaction provided by an embodiment of the present application
  • Figure 3 is a schematic diagram of a cross-chain transaction execution failure provided by an embodiment of the present application.
  • Figure 4 is a schematic diagram of another cross-chain transaction execution failure provided by an embodiment of the present application.
  • Fig. 5 is a flowchart of another cross-chain transaction processing method provided by an embodiment of the present application.
  • Fig. 6 is a schematic diagram of a cross-chain transaction processing device provided by an embodiment of the present application.
  • Fig. 7 is a schematic diagram of a computing device provided by an embodiment of the present application.
  • the source chain refers to the source block chain that initiates the cross-chain transaction in the cross-chain transaction scenario.
  • the destination chain refers to the destination blockchain that receives the cross-chain transaction in the cross-chain transaction scenario.
  • the relay chain refers to the blockchain responsible for transferring the cross-chain transactions of the source chain to the destination chain in the cross-chain scenario.
  • FIG. 1 shows a schematic flow chart of the steps of a cross-chain transaction processing method provided by an embodiment of the present application, which may specifically include the following steps:
  • the relay chain When receiving the first cross-chain transaction initiated by the source chain, the relay chain initializes the transaction state table of the first cross-chain transaction, and the first cross-chain transaction has a corresponding cross-chain transaction.
  • the execution subject of this embodiment is the relay chain.
  • the source chain and the relay chain can communicate through a cross-chain gateway; the destination chain and the relay chain can communicate through a cross-chain gateway.
  • Cross-chain transactions To achieve trusted interoperability between different blockchains, a trusted third party can be used to conduct cross-chain transactions.
  • the relay chain can be a public chain, as a third party to protect different applications Chains can trust each other for cross-chain transactions.
  • both the source chain and the destination chain can deploy cross-chain smart contracts, and then call the cross-chain smart contracts to register on the relay chain.
  • the source chain can generate the first cross-chain transaction according to the cross-chain transaction.
  • the first cross-chain transaction can carry the source chain address, destination chain address, cross-chain transaction information and cross-chain related certification information, etc. .
  • the source chain throws the first cross-chain transaction according to the deployed cross-chain smart contract, and the cross-chain gateway can capture the first cross-chain transaction and construct the first cross-chain transaction as a public network protocol (Inter Blockchain Transfer Protocol, IBTP) format cross-chain transaction, and then send the first cross-chain transaction to the relay chain.
  • IBTP is a general message transmission protocol for cross-chain interaction.
  • the transaction state table can include the previous transaction state and the current transaction state of the cross-chain transaction.
  • the transaction status table may include a first status value and a second status value, the first status value is used to identify the previous transaction status of the cross-chain transaction, and the second status value is used to identify the current transaction status of the cross-chain transaction.
  • the first state value is updated to an initial value, which is used to identify that the cross-chain transaction has not started processing; the second state value is updated to a start value, which is used to mark that the cross-chain transaction has started processing. For example: when initializing, record the previous transaction state as INIT, the current transaction state as BEGIN, and the transaction state table as: INIT-->BEGIN.
  • the relay chain analyzes the first cross-chain transaction, and determines the destination chain of the first cross-chain transaction.
  • the relay chain can analyze the first cross-chain transaction to determine the source chain and destination chain of the cross-chain transaction.
  • the relay chain constructs a second cross-chain transaction according to the first cross-chain transaction and the transaction state table.
  • the relay chain can find the corresponding registration information.
  • the relay chain finds the registration information of the destination chain, it means that the destination chain has been registered in the relay chain, and the relay chain can process the cross-chain transaction.
  • the relay chain can construct the second cross-chain transaction according to the first cross-chain transaction and the transaction status table.
  • the second cross-chain transaction can include the address of the source chain, the address of the destination chain, the cross-chain transaction, the signature and The status of the updated cross-chain transaction.
  • the transaction status table can be updated, the first status value is updated to the start value; the second status value is updated to the start failure value; then the fifth cross-chain transaction is constructed according to the first cross-chain transaction and the updated transaction status table ; and send the fifth cross-chain transaction to the source chain.
  • the source link receives the fifth cross-chain transaction, it can be determined that the cross-chain transaction failed because the destination chain was not registered in the relay chain.
  • the source chain can roll back the cross-chain transaction and restore the source chain to previous state. For example: if the destination chain has not been registered in the relay chain, the transaction status table is updated to BEGIN--> BEGIN_FAILURE.
  • the source chain After the source chain rolls back the cross-chain transaction, the source chain needs to return the receipt to the relay chain; after the relay link receives the rollback receipt returned by the destination chain, it changes the transaction status of the cross-chain transaction from BEGIN_FAILURE to FAILURE . So far, the cross-chain transaction processing is completed.
  • the relay chain can notify the destination chain and the source chain.
  • the cross-chain gateway of the destination chain will add 1 to the index of the relay chain, which records the cross-chain transactions between the relay chain and the source chain. This prevents the gateway from missing some transactions when forwarding due to network downtime and other reasons. But because the status of the transaction is BEGIN_FAILURE, the first cross-chain transaction will still not be forwarded to the destination chain.
  • the relay chain cannot perform the cross-chain transaction.
  • the relay chain can directly return an error to the cross-chain gateway of the source chain. The relay chain will not upload the first cross-chain transaction to the chain, which means that this cross-chain transaction never existed.
  • the relay chain sends the second cross-chain transaction to the destination chain.
  • the relay chain can determine the cross-chain gateway of the destination chain according to the registration information of the destination chain; then the relay chain can send the second cross-chain transaction to the cross-chain gateway of the destination chain, and the cross-chain gateway of the destination chain will then send The second cross-chain transaction is sent to the destination chain.
  • the relay link receives the third cross-chain transaction returned by the destination chain according to the second cross-chain transaction, the third cross-chain transaction includes an execution result of the destination chain on the cross-chain transaction.
  • the destination link after the destination link receives the second cross-chain transaction, it can analyze the second cross-chain transaction to determine the cross-chain transaction corresponding to the second cross-chain transaction; and then execute the cross-chain transaction by calling related methods through the cross-chain smart contract , to get the execution result of the cross-chain transaction.
  • the execution results of cross-chain transactions include execution success and execution failure.
  • the execution success can be RECEIPT_SUCCESS, and the execution failure can be RECEIPT_FAILURE.
  • the destination chain can construct a third cross-chain transaction according to the execution result. Then send the third cross-chain transaction to the relay chain through the cross-chain gateway. After the relay link receives the third cross-chain transaction, it can analyze the third cross-chain transaction to obtain the execution result of the cross-chain transaction.
  • the relay chain updates the transaction state table according to the execution result.
  • the relay chain can update the transaction state table. Specifically, since the first state value is used to identify the previous processing state, the first state value may be set as the current second state value, and then the second state value may be updated according to the execution result. If the execution result is execution failure, update the second status value to a failure value. If the execution result is that the execution is successful, the second status value is updated to a success value.
  • the transaction status is: BEGIN--> FAILURE; if the execution of the cross-chain transaction is successful, the transaction status is BEGIN--> SUCCESS.
  • the relay chain constructs a fourth cross-chain transaction according to the third cross-chain transaction and the updated transaction state table, and the fourth cross-chain transaction includes an execution result and a transaction state of the cross-chain transaction.
  • the relay chain constructs the fourth cross-chain transaction based on the third cross-chain transaction and the updated transaction status.
  • the fourth cross-chain transaction center can include the address of the source chain, the address of the destination chain, the cross-chain transaction, the signature of the relay chain and the updated The status of cross-chain transactions.
  • the transaction status of cross-chain transactions can be derived from the transaction status table, and the transaction status can include: INIT-->BEGIN, BEGIN-->BEGIN_FAILURE, BEGIN-->FAILURE, BEGIN-->SUCCESS, BEGIN_FAILURE-->FAILURE .
  • INIT-->BEGIN is used to indicate that the cross-chain transaction starts processing; BEGIN--> BEGIN_FAILURE is used to indicate that the cross-chain transaction cannot be sent to the destination chain, and BEGIN-->FAILURE is used to indicate that the cross-chain transaction is executed on the destination chain Failed, BEGIN-->SUCCESS is used to indicate that the cross-chain transaction was successfully executed on the destination chain, BEGIN_FAILURE-->FAILURE is used to indicate that the cross-chain transaction was not sent to the destination chain, the execution of the cross-chain transaction failed, and the source chain has returned Roll over.
  • the relay chain returns the fourth cross-chain transaction to the source chain, so that the source chain can process the cross-chain transaction according to the execution result and transaction state.
  • the relay chain can determine the cross-chain gateway of the source chain according to the registration information of the source chain; and then send the fourth cross-chain transaction to the source chain through the cross-chain gateway of the source chain.
  • the source link After the source link receives the fourth cross-chain transaction, it can analyze the fourth cross-chain transaction to obtain the execution result of the cross-chain transaction. If the execution result is execution failure, the source chain will roll back the cross-chain transaction. If the execution result is successful, the source chain completes the cross-chain transaction.
  • the source chain After the source chain rolls back the cross-chain transaction, it can also send a rollback receipt to the relay chain. After the relay link receives the rollback receipt, it can update the transaction status table to BEGIN_FAILURE-->FAILURE to determine the cross-chain transaction. The execution of the chain transaction is completed, and the execution fails.
  • the processing result of the cross-chain transaction in the target chain is the same as that in the source chain, which ensures the atomicity in the process of cross-chain transaction processing.
  • the transaction state table includes the previous transaction state and the current transaction state
  • the information sent by the relay chain to the source chain and the destination chain includes the information in the transaction state table, so that the source chain and the transaction chain can clearly The processing status of the current transaction; in addition, when the execution of the cross-chain transaction fails, the source chain can also determine that the failure is due to the destination chain not being registered in the relay chain according to the previous transaction state and the current transaction state in the transaction state table; Or because the destination chain failed to execute the transaction.
  • This embodiment optimizes the two-stage mechanism based on the relay chain, selects the multi-chain transaction state table scheme, and realizes the transaction management of cross-chain transactions through the built-in relay chain transaction management contract.
  • the two transactions on the target chain are simplified into one, which simplifies the on-chain process of the target chain.
  • the methods in this application are described with specific examples.
  • the background of this example is: the source chain is the A chain, and the destination chain is the B chain.
  • Account Alice in chain A wants to obtain data dataB of Bob in chain B.
  • FIG. 2 is a schematic diagram of a successful execution of a cross-chain transaction provided by an embodiment of the present application.
  • the A chain and the B chain need to deploy smart contracts for cross-chain, record the cross-chain smart contract of the A chain as SCa, and the cross-chain smart contract of the B chain as SCb.
  • chain A and chain B can call the register method of the deployed cross-chain smart contract to register in the relay chain.
  • Tx1 is a cross-chain transaction encapsulated by the cross-chain gateway into a cross-chain universal IBTP network protocol format , the content includes: cross-chain transaction type, source chain address, destination chain address, cross-chain related certification information, specific content of cross-chain transactions, etc.
  • the relay chain receives the cross-chain transaction Tx1, and initializes the transaction state table of Tx1 as INIT-->BEGIN, where INIT is the previous transaction state of the cross-chain transaction, and BEGIN is the current transaction state of the cross-chain transaction. Then analyze the cross-chain transaction Tx1, and check whether A chain and B chain are registered in the relay chain.
  • the relay chain encapsulates the cross-chain transaction Tx2 and submits Tx2 to the destination chain.
  • the target chain successfully executes the cross-chain transaction, and the returned content is dataB of the B chain, the type is RECEIPT_SUCCESS, and the format is the cross-chain transaction Tx3 of the general network protocol IBTP. And submit Tx3 to the relay chain.
  • the relay chain analyzes the received cross-chain transaction Tx3, and updates the transaction status to BEGIN-->SUCCESS according to the RECEIPT_SUCCESS type of Tx3. Then construct the cross-chain transaction Tx4 and submit it to the source chain.
  • the source chain analyzes the received cross-chain transaction Tx4, and finds that the transaction type is RECEIPT_SUCCESS, and the transaction status is BEGIN-->SUCCESS, execute the transaction content, obtain data dataB, and complete the cross-chain transaction operation.
  • FIG. 3 is a schematic diagram of a cross-chain transaction execution failure provided by an embodiment of this application.
  • FIG. 2 is a schematic diagram of a successful execution of a cross-chain transaction provided by an embodiment of the present application.
  • the A chain and the B chain need to deploy smart contracts for cross-chain, record the cross-chain smart contract of the A chain as SCa, and the cross-chain smart contract of the B chain as SCb.
  • chain A and chain B can call the register method of the deployed cross-chain smart contract to register in the relay chain.
  • Tx1 is a cross-chain transaction encapsulated by the cross-chain gateway into a cross-chain universal IBTP network protocol format , the content includes: cross-chain transaction type, source chain address, destination chain address, cross-chain related certification information, specific content of cross-chain transactions, etc.
  • the relay chain receives the cross-chain transaction Tx1, and initializes the transaction state of Tx1 as INIT-->BEGIN, where INIT is the previous transaction state of the cross-chain transaction, and BEGIN is the current transaction state of the cross-chain transaction. Analyze the cross-chain transaction Tx1, and check whether A chain and B chain are registered in the relay chain.
  • the relay chain encapsulates the cross-chain transaction Tx2 and submits it to the destination chain.
  • the target chain failed to execute the cross-chain transaction, because Bob does not have dataB, the returned content is empty, the type is RECEIPT_FAILURE, and the format is the cross-chain transaction Tx3 of the general network protocol IBTP. And submit Tx3 to the relay chain.
  • the relay chain analyzes the received cross-chain transaction Tx3, and updates the transaction status to BEGIN-->FAILURE according to the RECEIPT_FAILURE type of Tx3.
  • the relay chain constructs a cross-chain transaction Tx4 and submits it to the source chain.
  • the source chain analyzes the received cross-chain transaction Tx4, and finds that the transaction type is RECEIPT_SUCCESS, and the transaction status is BEGIN--> FAILURE, indicating that the execution of the cross-chain transaction failed, and the cross-chain transaction is rolled back.
  • the cross-chain transaction operation is completed.
  • Fig. 4 is a schematic diagram of another cross-chain transaction execution failure provided by an embodiment of the present application.
  • Tx1 is a cross-chain transaction encapsulated by the cross-chain gateway into a cross-chain universal IBTP network protocol format , the content includes: cross-chain transaction type, source chain address, destination chain address, cross-chain related certification information, specific content of cross-chain transactions, etc.
  • the relay chain analyzes the cross-chain transaction Tx1, initializes the transaction status of Tx1 to INIT-->BEGIN, checks whether the A chain and the B chain are registered in the relay chain, finds that the B chain is not registered, and updates the transaction status to BEGIN-->BEGIN_FAILURE .
  • the relay chain transaction manager constructs a cross-chain transaction Tx2, the cross-chain transaction type is INTERCHAIN, and submits it to the source chain A chain.
  • Chain A receives the cross-chain transaction Tx2.
  • the transaction status is BEGIN_FAILURE, it means that the execution of the cross-chain transaction failed, and the cross-chain transaction needs to be rolled back.
  • the cross-chain transaction operation is completed. After the source chain rolls back the cross-chain transaction, the source chain needs to return the receipt to the relay chain; after the relay link receives the rollback receipt returned by the destination chain, it changes the transaction status of the cross-chain transaction from BEGIN_FAILURE to FAILURE . So far, the cross-chain transaction processing is completed.
  • Fig. 5 is a flowchart of another cross-chain transaction processing method provided by an embodiment of the present application. Referring to Fig. 5, the source chain and the destination chain deploy cross-chain contracts, and call related methods of cross-chain contracts to register in the relay chain.
  • the source chain When performing a cross-chain transaction, the source chain initiates a cross-chain transaction, the cross-chain contract SC1 deployed by the source chain throws a cross-chain transaction according to the transaction request, and the cross-chain gateway captures the cross-chain transaction and constructs it as the first A cross-chain transaction Tx1 is transmitted to the relay chain.
  • the relay chain receives the first cross-chain transaction Tx1, conducts transaction inspection, transaction packaging, transaction execution, and initializes the transaction state table before the transaction execution starts.
  • the transaction state table maintains the previous transaction state and the current transaction state, and records the previous state during initialization
  • a transaction state is INIT and the current transaction state is BEGIN.
  • the relay chain After the first cross-chain transaction Tx1 is successfully uploaded to the relay chain, the relay chain checks the relevant information of the destination chain and updates the transaction status. If the destination chain is not registered in the relay chain, go to step 5.1. If the destination chain is registered, go to step 5.1. 5.2.
  • the relay chain changes the cross-chain transaction status from BEGIN to BEGIN_FAILURE, and the relay chain transaction manager will construct the fifth cross-chain transaction Tx2.1 and notify the source chain to roll back.
  • the relay chain transaction manager constructs the second cross-chain transaction Tx2.2 according to the content of the first cross-chain transaction Tx1, and routes the second cross-chain transaction Tx2.2 to the destination chain through the cross-chain gateway.
  • the second cross-chain transaction Tx2.2 includes the source chain address, destination chain address, cross-chain transaction, relay chain signature and updated cross-chain transaction status.
  • the destination chain After the destination chain receives the second cross-chain transaction Tx2.2, it analyzes the cross-chain transaction, and calls related methods through the cross-chain contract SC2 to execute the cross-chain transaction.
  • the execution result of the cross-chain transaction is sent to the relay chain by constructing the third cross-chain transaction Tx3.
  • the third cross-chain transaction Tx3 contains the result of cross-chain transaction execution.
  • the execution results of cross-chain transactions are divided into two categories: RECEIPT_SUCCESS is returned if the execution is successful, and RECIPT_FAILURE is returned if the execution fails.
  • the relay chain changes the transaction status according to whether the execution result of the received cross-chain transaction Tx3 is successful.
  • the successful execution result will update the transaction status from BEGIN to SUCCESS, and the failed execution result will update the transaction status from BEGIN to FAILURE; construct the fourth cross-chain transaction Tx4 according to the third cross-chain transaction Tx3, and forward the fourth cross-chain transaction Tx4 to source chain.
  • the source chain performs relevant operations according to the transaction status of the fourth cross-chain transaction Tx4 received.
  • the smart contract SC1 of the source chain calls related methods to execute cross-chain transactions. If the received transaction is a cross-chain receipt transaction and the transaction status is SUCCESS, it means that the cross-chain transaction is executed normally. If the received transaction is a cross-chain receipt transaction and the transaction status is SUCCESS If the transaction status is FAILURE, it means that the execution of the cross-chain transaction failed, and the cross-chain transaction needs to be rolled back. rollback.
  • the source chain After the source chain rolls back the cross-chain transaction, the source chain needs to return the receipt to the relay chain; after the relay link receives the rollback receipt returned by the destination chain, it changes the transaction status of the cross-chain transaction from BEGIN_FAILURE to FAILURE . So far, a cross-chain transaction process is over, and this method ensures the atomicity of cross-chain transactions.
  • FIG. 6 it shows a schematic diagram of a cross-chain transaction processing device according to an embodiment of the present application, which may specifically include a transaction state table initialization module 61, a destination chain determination module 62, a second cross-chain transaction construction module 63, a second Cross-chain transaction sending module 64, third cross-chain transaction receiving module 65, transaction status table update module 66, fourth cross-chain transaction construction module 67 and fourth cross-chain transaction sending module 68, wherein:
  • the transaction state table initialization module 61 is used to initialize the transaction state table of the first cross-chain transaction when receiving the first cross-chain transaction initiated by the source chain, and the first cross-chain transaction has a corresponding cross-chain transaction;
  • a destination chain determination module 62 configured to analyze the first cross-chain transaction and determine the destination chain of the first cross-chain transaction
  • the second cross-chain transaction construction module 63 is used to construct a second cross-chain transaction according to the first cross-chain transaction and the transaction state table if the source chain and the destination chain have been registered in the relay chain. chain transaction;
  • a second cross-chain transaction sending module 64 configured to send the second cross-chain transaction to the destination chain
  • the third cross-chain transaction receiving module 65 is configured to receive the third cross-chain transaction returned by the target chain according to the second cross-chain transaction, the third cross-chain transaction includes the pair of the target chain to the cross-chain transaction execution results;
  • a transaction status table update module 66 configured to update the transaction status table according to the execution result
  • the fourth cross-chain transaction construction module 67 is configured to construct a fourth cross-chain transaction according to the third cross-chain transaction and the updated transaction state table, the fourth cross-chain transaction includes the execution result and the Describe the transaction status of cross-chain transactions;
  • the fourth cross-chain transaction sending module 68 is configured to return the fourth cross-chain transaction to the source chain, so that the source chain can process the cross-chain transaction according to the execution result and the transaction status.
  • the transaction state table initialization module 61 includes:
  • a first initialization submodule configured to update the first state value to an initial value, where the first state value is used to identify a previous transaction state of the cross-chain transaction;
  • the second initialization submodule is configured to update the second state value to a start value, and the second state value is used to identify the current transaction state of the cross-chain transaction.
  • the above cross-chain transaction processing device further includes:
  • a first update module configured to update the first state value to a start value if the destination chain is not registered in the relay chain; update the second state value to a start failure value, the The start failure value is used to represent that the destination chain has not been sent to the destination chain;
  • a second updating module configured to construct a fifth cross-chain transaction according to the first cross-chain transaction and the updated transaction state table
  • a fifth cross-chain transaction sending module configured to send the fifth cross-chain transaction to the source chain, so that the source chain can roll back the cross-chain transaction according to the fifth cross-chain transaction;
  • the rollback receipt receiving submodule is used to receive the rollback receipt returned by the source chain
  • the third update submodule is configured to update the second status value of the transaction status table to a failure value according to the rollback receipt, and the failure value is used to indicate that the execution of the cross-chain transaction fails.
  • the above-mentioned second cross-chain transaction sending module 64 includes:
  • the target cross-chain gateway determination submodule is used to determine the cross-chain gateway of the target chain according to the registration information of the target chain;
  • the second cross-chain transaction sending sub-module is used to send the second cross-chain transaction to the cross-chain gateway of the destination chain, and the cross-chain gateway of the destination chain is used to send the second cross-chain transaction to The destination chain.
  • the transaction status table update module 66 includes:
  • a fourth updating submodule configured to update the first status value to the second status value and update the second status value to a failure value if the execution result is execution failure.
  • the fourth cross-chain transaction sending module 68 includes:
  • the first source cross-chain gateway determination submodule is used to determine the cross-chain gateway of the source chain
  • the first sending sub-module is configured to send the fourth cross-chain transaction to the source chain through the cross-chain gateway of the source chain, so that the source chain can send the fourth cross-chain transaction to the source chain according to the fourth cross-chain transaction.
  • the cross-chain transaction is rolled back in the source chain.
  • the transaction status table update module 66 also includes:
  • the fifth updating submodule is configured to update the first status value to the second status value and update the second status value to a success value if the execution result is execution success.
  • the fourth cross-chain transaction sending module 68 includes:
  • the second source cross-chain gateway determination submodule is used to determine the cross-chain gateway of the source chain
  • the second sending sub-module is configured to send the fourth cross-chain transaction to the source chain through the cross-chain gateway of the source chain, so that the source chain can send the fourth cross-chain transaction to the source chain according to the fourth cross-chain transaction.
  • the cross-chain transaction is completed in the source chain.
  • the description is relatively simple, and for related details, please refer to the description of the method embodiment.
  • FIG. 7 is a schematic structural diagram of a computing device provided by an embodiment of the present application.
  • the computing device 7 of this embodiment includes: at least one processor 70 (only one is shown in FIG. 7 ), a processor, a memory 71, and a A computer program 72 running on the processor 70, when the processor 70 executes the computer program 72, implements the steps in any of the above-mentioned method embodiments.
  • the computing device 7 may be a computing device such as a desktop computer, a notebook, a palmtop computer, or a cloud server.
  • the computing device may include, but is not limited to, a processor 70 and a memory 71 .
  • FIG. 7 is only an example of the computing device 7 and does not constitute a limitation to the computing device 7. It may include more or less components than those shown in the illustration, or combine certain components, or different components. , for example, may also include input and output devices, network access devices, and so on.
  • the so-called processor 70 can be a central processing unit (Central Processing Unit, CPU), and the processor 70 can also be other general-purpose processors, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the memory 71 may be an internal storage unit of the computing device 7 in some embodiments, such as a hard disk or memory of the computing device 7 .
  • the memory 71 may also be an external storage device of the computing device 7 in other embodiments, such as a plug-in hard disk equipped on the computing device 7, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc.
  • the memory 71 may also include both an internal storage unit of the computing device 7 and an external storage device.
  • the memory 71 is used to store operating system, application program, boot loader (BootLoader), data and other programs, such as the program code of the computer program.
  • the memory 71 can also be used to temporarily store data that has been output or will be output.
  • the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in each of the foregoing method embodiments can be realized.
  • An embodiment of the present application provides a computer program product, which, when the computer program product is run on a computing device, enables the computing device to implement the steps in the foregoing method embodiments when executed.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请实施例适用于区块链技术领域,提供了一种跨链事务处理方法、装置、计算设备和介质,该方法包括:来源链和目的链需要在中继链中进行注册;当中继链接收到来源链发起的第一跨链交易时,可以初始化第一跨链交易的事务状态表,第一跨链交易包含对应的跨链事务;中继链可以确定第一跨链交易的目的链;若目的链在中继链中注册过,则中继链可以根据第一跨链交易和事务状态表构建并向目的链发送第二跨链交易;当中继链接收到目的链根据第二跨链交易返回的执行结果时,可以将执行结果返回至来源链,来源链可以根据执行结果更新跨链事务。通过上述方法,能够保障跨链事务执行过程中的原子性,并简化跨链流程。

Description

一种跨链事务处理方法、装置、计算设备和介质
本申请申明享有2021年12月23日递交的申请号为202111590196.0、名称为“一种跨链事务处理方法、装置、计算设备和介质”中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本申请属于区块链技术领域,特别是涉及一种跨链事务处理方法、装置、计算设备和介质。
背景技术
跨链是在不同区块链之间实现可信互操作。跨链事务的原子性是指跨链交易的来源链与目的链要么都执行成功,要么都执行失败,如执行失败还需要恢复到未执行的状态。
现有的跨链事务处理机制大致分为两种:哈希时间锁定机制(Hash Time Locked Contract,简称HTLC)、基于中继链的二阶段机制。哈希时间锁定机制是一种去中心化、无需受信任的第三方中介的跨链原子交换协议。但是哈希锁定机制的应用场景十分受限,仅用作资产交换,并且有着严格的时间时钟上限。如果一方因为网络、设备等问题,无法在时钟上限内处理跨链事务,无法完全保证跨链交易事务的原子性。基于中继链的二阶段机制需要提前冻结来源链与目的链的相关资产,根据中继链返回的事务处理结果执行或回滚。但这种方式需要在目的链执行两次交易上链。
技术问题
有鉴于此,本申请实施例提供了一种跨链事务处理方法、装置、计算设备和介质,用以保障跨链事务处理过程中的原子性,并简化了目的链的跨链流程。
技术解决方案
本申请实施例的第一方面提供了一种跨链事务处理方法,应用于中继链,所述方法包括:
当接收到来源链发起的第一跨链交易时,初始化所述第一跨链交易的事务状态表,所述第一跨链交易具有对应的跨链事务;
对所述第一跨链交易进行解析,确定所述第一跨链交易的目的链;
若所述来源链与所述目的链在所述中继链中注册过,则根据所述第一跨链交易和所述事务状态表构建第二跨链交易;
将所述第二跨链交易发送至所述目的链;
接收所述目的链根据所述第二跨链交易返回的第三跨链交易,所述第三跨链交易包括所述目的链对所述跨链事务的执行结果;
根据所述执行结果更新所述事务状态表;
根据所述第三跨链交易和更新后的所述事务状态表构建第四跨链交易,所述第四跨链交易中包括所述执行结果和所述跨链事务的事务状态;
将所述第四跨链交易返回至所述来源链,以供所述来源链根据所述执行结果和所述事务状态处理所述跨链事务。
本申请实施例的第二方面提供了一种跨链事务处理装置,应用于中继链,所述装置包括:
事务状态表初始化模块,用于当接收到来源链发起的第一跨链交易时,初始化所述第一跨链交易的事务状态表,所述第一跨链交易具有对应的跨链事务;
目的链确定模块,用于对所述第一跨链交易进行解析,确定所述第一跨链交易的目的链;
第二跨链交易构建模块,用于若所述来源链和所述目的链在所述中继链中注册过,则根据所述第一跨链交易和所述事务状态表构建第二跨链交易;
第二跨链交易发送模块,用于将所述第二跨链交易发送至所述目的链;
第三跨链交易接收模块,用于接收所述目的链根据所述第二跨链交易返回的第三跨链交易,所述第三跨链交易包括所述目的链对所述跨链事务的执行结果;
事务状态表更新模块,用于根据所述执行结果更新所述事务状态表;
第四跨链交易构建模块,用于根据所述第三跨链交易和更新后的所述事务状态表构建第四跨链交易,所述第四跨链交易中包括所述执行结果和所述跨链事务的事务状态;
第四跨链交易发送模块,用于将所述第四跨链交易返回至所述来源链,以供所述来源链根据所述执行结果和所述事务状态处理所述跨链事务。
本申请实施例的第三方面提供了一种计算设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面所述的方法。
本申请实施例的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如上述第一方面所述的方法。
本申请实施例的第五方面提供了一种计算机程序产品,当所述计算机程序产品在计算设备上运行时,使得所述计算设备执行上述第一方面所述的方法。
有益效果
本申请实施例,来源链和目的链之间的跨链事务可以通过中继链来进行。来源链发起第一跨链交易,第一跨链交易具有对应的跨链事务;来源链通过跨链网关将第一跨链交易发送至中继链;中继链在接收到第一跨链交易后,初始化该第一跨链交易的事务状态表,采用该事务状态表可以在中继链中记录跨链事务的事务状态。中继链对该第一跨链交易进行解析,确定跨链交易的目的链;若该目的链在中继链中注册过,则可以根据该第一跨链交易和事务状态表构第二跨链交易,然后通过跨链网关将第二跨链交易发送至目的链。目的链在接收到第二跨链交易后,可以执行跨链事务,然后将根据跨链事务的执行结果返回第三跨链交易;中继链在接收到第三跨链交易后,可以根据第三跨链交易获取跨链事务的执行结果,根据执行结果更新事务状态表,然后根据更新后的事务状态表和第三跨链交易构建第四跨链交易,并通过跨链网关将第四跨链交易发送至来源链。来源链接收到第四跨链交易后可以对第四跨链交易进行解析,从而确定跨链事务的执行结果,来源链根据执行结果更新跨链事务的处理状态。在本申请实施例中,目的链、中继链和来源链中,可以保持跨链事务的执行结果是统一的,实现了跨链交易的事务原子性。同时,在跨链事务的执行过程中,只需要在目的链中进行一次上链,简化了目的链的跨链流程。
附图说明
图1是本申请一个实施例提供的一种跨链事务处理方法的步骤流程示意图;
图2是本申请一个实施例提供的一种跨链交易执行成功的示意图;
图3是本申请一个实施例提供的一种跨链交易执行失败的示意图;
图4是本申请一个实施例提供的另一种跨链交易执行失败的示意图;
图5是本申请一个实施例提供的另一种跨链事务处理方法的流程图;
图6是本申请一个实施例提供的一种跨链事务处理装置的示意图;
图7是本申请一个实施例提供的一种计算设备的示意图。
本发明的实施方式
本申请实施例中,来源链是指跨链交易场景中,发起跨链交易的来源区块链。目的链是指跨链交易场景中,接收跨链交易的目的区块链。中继链是指跨链场景中,负责将来源链的跨链交易中转到目的链的区块链。
参照图1,示出了本申请一个实施例提供的一种跨链事务处理方法的步骤流程示意图,具体可以包括如下步骤:
S101,当接收到来源链发起的第一跨链交易时,中继链初始化第一跨链交易的事务状态表,第一跨链交易具有对应的跨链事务。
本实施例的执行主体为中继链。在本实施例中,来源链和中继链之间可以通过跨链网关进行通信;目的链和中继链之间可以通过跨链网关进行通信。跨链事务要实现不同区块链之间的可信互操作,可以借助具有公信力的第三方来进行跨链交易,本实施例中,中继链可以为公有链,作为第三方来保障不同应用链之间的可以互相信任的进行跨链交易。
在本申请实施例中,来源链和目的链均可部署跨链智能合约,然后可以调用跨链智能合约在中继链上进行注册。
当需要处理跨链事务时,来源链可以根据跨链事务生成第一跨链交易,第一跨链交易中可以携带有来源链地址、目的链地址、跨链事务信息和跨链相关证明信息等。来源链根据部署的跨链智能合约抛出第一跨链交易,跨链网关可以捕捉到该第一跨链交易,并将第一跨链交易构造为采用公共网络协议(Inter Blockchain Transfer Protocol,IBTP)的格式的跨链交易,然后将该第一跨链交易发送至中继链。IBTP是一种通用的跨链交互的消息传输协议。
中继链接收到跨链交易后,初始化事务状态表,事务状态表中可以包括该跨链事务的前一个事务状态和当前的事务状态。事务状态表可以包括第一状态值和第二状态值,第一状态值用于标识跨链事务的前一个事务状态,第二状态值用于标识跨链事务的当前事务状态。在初始化时将第一状态值更新为初始值,初始值用于标识跨链事务还未开始处理;将第二状态值更新为开始值,开始值用于标识跨链事务开始处理。例如:初始化时记录前一个事务状态为INIT,当前事务状态为BEGIN,事务状态表为:INIT-->BEGIN。
S102,中继链对第一跨链交易进行解析,确定第一跨链交易的目的链。
由于第一跨链交易中包括来源链地址和目的链地址,因而中继链可以对第一跨链交易进行解析,从而确定跨链事务的来源链和目的链。
S103,若来源链和目的链在中继链中注册过,则中继链根据第一跨链交易和事务状态表构建第二跨链交易。
具体地,若目的链或者来源链在中继链中注册过,则中继链可以查找到对应的注册信息。
若中继链查找到目的链的注册信息,则表明目的链在中继链中注册过,中继链可以对该跨链事务进行处理。此时,中继链可以根据第一跨链交易和事务状态表构建第二跨链交易,第二跨链交易中可以包括来源链地址、目的链地址、跨链事务、中继链的签名与更新后的跨链事务的状态。
若中继链中未查找到目的链的注册信息,则表明目的链未在中继链中注册过,中继链无法将跨链事务信息发送至目的链,也就无法对该跨链事务进行处理。此时,可以更新事务状态表,将第一状态值更新为开始值;将第二状态值更新为开始失败值;然后根据第一跨链交易和更新后的事务状态表构建第五跨链交易;并将第五跨链交易发送至来源链。来源链接收到该第五跨链交易后,可以确定出该跨链事务是由于目的链未在中继链中注册而导致失败,来源链可以对跨链事务进行回滚,将来源链恢复到之前的状态。例如:若目的链未在中继链中注册过,则事务状态表更新为BEGIN--> BEGIN_FAILURE。
来源链在对跨链事务回滚完毕后,来源链需要将回执返回给中继链;中继链接收到目的链返回的回滚的回执以后,将跨链事务的事务状态从BEGIN_FAILURE变为FAILURE。至此,跨链事务处理完成。
在一种可能的实现方式中,若目的链未在中继链中注册过,中继链可通知目的链与来源链。当目的链注册完成时,目的链的跨链网关将会对中继链的index进行+1,index记录了中继链与来源链的跨链交易。从而防止网关因为网络宕机等原因转发时遗漏了部分交易。但因为交易的状态是BEGIN_FAILURE,该第一跨链交易还是不会转发给目的链。
当然,若来源链未在中继链中注册过,则中继链也无法进行该跨链事务。在一种可能的实现方式中,若来源链没有在中继链中注册,中继链可以直接返回错误给来源链的跨链网关。中继链将不会把该第一跨链交易上链,可以相当于这笔跨链事务没存在过。
S104,中继链将第二跨链交易发送至目的链。
具体地,中继链可以根据目的链的注册信息,确定目的链的跨链网关;然后中继链可以将第二跨链交易发送至目的链的跨链网关,目的链的跨链网关再将第二跨链交易发送至目的链。
S105,中继链接收目的链根据第二跨链交易返回的第三跨链交易,第三跨链交易包括目的链对跨链事务的执行结果。
具体地,目的链接收到第二跨链交易后,可以对第二跨链交易进行解析,确定该第二跨链交易对应的跨链事务;然后通过跨链智能合约调用相关方法执行跨链事务,得到跨链事务的执行结果。跨链事务的执行结果包括执行成功和执行失败。执行成功可以为RECEIPT_SUCCESS,执行失败可以为RECEIPT_FAILURE。
目的链根据执行结果,可以构建第三跨链交易。然后通过跨链网关将该第三跨链交易发送至中继链。中继链接收到第三跨链交易后,可以对该第三跨链交易进行解析,得到跨链事务的执行结果。
S106,中继链根据执行结果更新事务状态表。
根据跨链事务的执行结果,中继链可以更新事务状态表。具体地,由于第一状态值用于标识前一个处理状态,故可以将第一状态值设置为当前第二状态值,然后根据执行结果更新第二状态值。若执行结果为执行失败,则将第二状态值更新为失败值。若执行结果为执行成功,则将所述第二状态值更新为成功值。
例如,若跨链事务执行失败,则事务状态为:BEGIN--> FAILURE;若跨链事务执行成功,则事务状态为BEGIN--> SUCCESS。
S107,中继链根据第三跨链交易和更新后的事务状态表构建第四跨链交易,第四跨链交易中包括执行结果和跨链事务的事务状态。
中继链根据第三跨链交易和更新后的事务状态构建第四跨链交易,第四跨链交易中心可以包括来源链地址、目的链地址、跨链事务、中继链的签名与更新后的跨链事务的状态。
具体地,跨链事务的事务状态可以来源于事务状态表,事务状态可以包括:INIT-->BEGIN,BEGIN--> BEGIN_FAILURE ,BEGIN--> FAILURE,BEGIN--> SUCCESS,BEGIN_FAILURE-->FAILURE。INIT-->BEGIN用于表示该跨链事务开始处理;BEGIN--> BEGIN_FAILURE 用于表示该跨链事务无法发送至目的链,BEGIN--> FAILURE用于表示该跨链事务在目的链上执行失败,BEGIN--> SUCCESS用于表示该跨链事务在目的链上执行成功,BEGIN_FAILURE-->FAILURE用于表示该跨链事务未发送至目的链,跨链事务执行失败,在来源链已经回滚完毕。
S108,中继链将第四跨链交易返回至来源链,以供来源链根据执行结果和事务状态处理跨链事务。
中继链可以根据来源链的注册信息确定来源链的跨链网关;然后通过来源链的跨链网关,将第四跨链交易发送至来源链。
来源链接收到第四跨链交易后,可以对第四跨链交易进行解析,获取跨链交易的执行结果。若执行结果为执行失败,则来源链对跨链事务进行回滚。若执行结果为执行成功,则来源链完成所述跨链事务。
来源链在对跨链事务进行回滚后,还可以向中继链发送回滚回执,中继链接收到回滚回执后,可以将事务状态表更新为BEGIN_FAILURE-->FAILURE,从而确定该跨链事务执行完毕,执行失败。
此时,目的链中的跨链事务的处理结果和来源链中的跨链事务处理结果是相同的,保障了跨链事务处理过程中的原子性。
本实施例中,事务状态表中包括前一个事务状态和当前事务状态,而中继链发送至来源链和目的链的信息中包括了事务状态表中的信息,使得来源链和事务链能够清楚当前事务的处理状态;另外,当跨链事务执行失败时,来源链也可以根据事务状态表中的前一个事务状态和当前事务状态,确定是由于目的链未在中继链中注册而失败;还是由于目的链执行事务失败。
本实施例在基于中继链的二阶段机制上进行优化,选用多链事务状态表的方案,通过内置中继链事务管理合约实现跨链交易的事务管理。在跨链流程中将目的链的两次交易上链简化为一次,简化了目的链的上链流程。
需要说明的是,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
以具体的实例对本申请中的方法进行说明。该实例的背景为:来源链为A链,目的链为B链。A链的账户Alice想要获取位于B链的Bob的数据dataB。
A链的账户Alice成功获取位于B链的Bob的数据dataB的执行过程可以为图2所示。图2是本申请一个实施例提供的一种跨链交易执行成功的示意图。
首先A链与B链需要部署用于跨链的智能合约,记A链的跨链智能合约为SCa,B链的跨链智能合约为SCb。
然后,A链与B链可以调用已部署的跨链智能合约的register方法在中继链进行注册。
当A链的账户Alice想要获取位于B链的Bob的数据dataB时,A链根据该跨链事务构建交易Tx1,Tx1是由跨链网关封装成跨链通用的IBTP网络协议格式的跨链交易,内容包括:跨链交易类型、来源链地址、目的链地址、跨链相关证明信息、跨链事务具体内容等。
中继链收到跨链交易Tx1,将Tx1的事务状态表初始化为INIT-->BEGIN,INIT为跨链事务前一个的事务状态,BEGIN为跨链事务当前的事务状态。然后解析跨链交易Tx1,检查A链与B链是否在中继链注册。
如A链与B链均已经在中继链中注册,则中继链封装跨链交易Tx2,将Tx2提交至目的链。
目的链成功执行跨链交易,返回内容为B链的dataB,类型为RECEIPT_SUCCESS,格式为通用网络协议IBTP的跨链交易Tx3。并将Tx3提交至中继链。
中继链解析收到的跨链交易Tx3,根据Tx3的RECEIPT_SUCCESS类型更新事务状态为BEGIN-->SUCCESS。然后构造跨链交易Tx4提交到来源链。
来源链解析收到的跨链交易Tx4,发现交易的类型为RECEIPT_SUCCESS类型,事务状态是BEGIN-->SUCCESS,执行交易内容,获取数据dataB,跨链事务操作完成。
由于B链执行失败而导致A链的账户Alice不能获取位于B链的Bob的数据dataB的执行过程可以为图3所示。3是本申请一个实施例提供的一种跨链交易执行失败的示意图。
A链的账户Alice成功获取位于B链的Bob的数据dataB的执行过程可以为图2所示。图2是本申请一个实施例提供的一种跨链交易执行成功的示意图。
首先A链与B链需要部署用于跨链的智能合约,记A链的跨链智能合约为SCa,B链的跨链智能合约为SCb。
然后,A链与B链可以调用已部署的跨链智能合约的register方法在中继链进行注册。
当A链的账户Alice想要获取位于B链的Bob的数据dataB时,A链根据该跨链事务构建交易Tx1,Tx1是由跨链网关封装成跨链通用的IBTP网络协议格式的跨链交易,内容包括:跨链交易类型、来源链地址、目的链地址、跨链相关证明信息、跨链事务具体内容等。
中继链收到跨链交易Tx1,将Tx1的事务状态初始化为INIT-->BEGIN,INIT为跨链事务前一个的事务状态,BEGIN为跨链事务当前的事务状态。解析跨链交易Tx1,检查A链与B链是否在中继链注册。
若A链与B链均已经在中继链注册,则中继链封装跨链交易Tx2,提交至目的链。
目的链执行跨链交易失败,因为Bob没有dataB这个数据,返回内容为空,类型为RECEIPT_FAILURE,格式为通用网络协议IBTP的跨链交易Tx3。并将Tx3提交至中继链。
中继链解析收到的跨链交易Tx3,根据Tx3的RECEIPT_FAILURE类型更新事务状态为BEGIN-->FAILURE。中继链构造跨链交易Tx4提交到来源链。
来源链解析收到的跨链交易Tx4,发现交易的类型为RECEIPT_SUCCESS类型,事务状态是BEGIN--> FAILURE,说明跨链交易执行失败,进行跨链事务回滚。跨链事务操作完成。
由于B链未在中继链中注册而导致A链的账户Alice不能获取位于B链的Bob的数据dataB的执行过程可以为图4所示。图4是本申请一个实施例提供的另一种跨链交易执行失败的示意图。
当A链的账户Alice想要获取位于B链的Bob的数据dataB时,A链根据该跨链事务构建交易Tx1,Tx1是由跨链网关封装成跨链通用的IBTP网络协议格式的跨链交易,内容包括:跨链交易类型、来源链地址、目的链地址、跨链相关证明信息、跨链事务具体内容等。
中继链解析跨链交易Tx1,将Tx1的事务状态初始化为INIT-->BEGIN,检查A链与B链是否在中继链注册,发现B链未注册,更新事务状态为BEGIN-->BEGIN_FAILURE。中继链事务管理器构建跨链交易Tx2,跨链交易类型是INTERCHAIN,提交至来源链A链。
A链收到跨链交易Tx2,根据收到的是跨链交易类型为INTERCHAIN,并且交易事务状态为BEGIN_FAILURE,说明跨链事务执行失败,该跨链交易需要进行回滚。跨链事务操作完成。来源链在对跨链事务回滚完毕后,来源链需要将回执返回给中继链;中继链接收到目的链返回的回滚的回执以后,将跨链事务的事务状态从BEGIN_FAILURE变为FAILURE。至此,跨链事务处理完成。
图5是本申请一个实施例提供的另一种跨链事务处理方法的流程图,参照图5,来源链与目的链部署跨链合约,调用跨链合约相关方法在中继链进行注册。
当进行跨链事务时,来源链发起跨链交易,来源链部署的跨链合约SC1根据交易请求抛出跨链事务,跨链网关捕获该跨链事务,并构造为公共网络协议IBTP格式的第一跨链交易Tx1向中继链传输。
中继链收到第一跨链交易Tx1,进行交易检查、交易打包、交易执行,交易执行开始前初始化事务状态表,事务状态表维护了前一个事务状态与当前的事务状态,初始化时记录前一个事务状态为INIT,当前事务状态为BEGIN。
第一跨链交易Tx1在中继链成功上链后,中继链检查目的链相关信息并更新事务状态,如果目的链未在中继链注册,进入步骤5.1,如果目的链已注册,进入步骤5.2。
5.1)中继链将跨链事务状态从BEGIN更改为BEGIN_FAILURE,中继链事务管理器将构建第五跨链交易Tx2.1,通知来源链进行回滚。
5.2)中继链事务管理器根据第一跨链交易Tx1的内容构建第二跨链交易Tx2.2,通过跨链网关将第二跨链交易Tx2.2路由到目的链。第二跨链交易Tx2.2包含了来源链地址、目的链地址、跨链事务、中继链的签名与更新后的跨链事务的状态。
目的链收到第二跨链交易Tx2.2后,解析跨链事务,并通过跨链合约SC2调用相关方法执行跨链事务。跨链事务执行结果通过构造第三跨链交易Tx3发送至中继链。第三跨链交易Tx3包含了跨链事务执行的结果。跨链事务的执行结果分为两类:执行成功返回RECEIPT_SUCCESS,执行失败返回RECIPT_FAILURE。
中继链根据收到的跨链交易Tx3的执行结果是否成功更改事务状态。成功的执行结果将事务状态从BEGIN更新为SUCCESS,失败的执行结果将事务状态从BEGIN更新为FAILURE;根据第三跨链交易Tx3构建第四跨链交易Tx4,将第四跨链交易Tx4转发至来源链。
来源链根据收到的第四跨链交易Tx4的事务状态进行相关操作。来源链的智能合约SC1调用相关方法执行跨链事务,如果收到的是跨链回执交易,并且交易事务状态为SUCCESS,说明跨链事务正常执行,如果收到的是跨链回执交易,并且交易事务状态为FAILURE,说明跨链事务执行失败,该跨链交易需要进行回滚,如果收到的是跨链交易,并且交易事务状态为BEGIN_FAILURE,说明跨链事务执行失败,该跨链交易需要进行回滚。来源链在对跨链事务回滚完毕后,来源链需要将回执返回给中继链;中继链接收到目的链返回的回滚的回执以后,将跨链事务的事务状态从BEGIN_FAILURE变为FAILURE。至此,一笔跨链交易流程结束,该方法保证了跨链事务的原子性。
参照图6,示出了本申请一个实施例的一种跨链事务处理装置的示意图,具体可以包括事务状态表初始化模块61、目的链确定模块62、第二跨链交易构建模块63、第二跨链交易发送模块64、第三跨链交易接收模块65、事务状态表更新模块66、第四跨链交易构建模块67和第四跨链交易发送模块68,其中:
事务状态表初始化模块61,用于当接收到来源链发起的第一跨链交易时,初始化所述第一跨链交易的事务状态表,所述第一跨链交易具有对应的跨链事务;
目的链确定模块62,用于对所述第一跨链交易进行解析,确定所述第一跨链交易的目的链;
第二跨链交易构建模块63,用于若所述来源链和所述目的链在所述中继链中注册过,则根据所述第一跨链交易和所述事务状态表构建第二跨链交易;
第二跨链交易发送模块64,用于将所述第二跨链交易发送至所述目的链;
第三跨链交易接收模块65,用于接收所述目的链根据所述第二跨链交易返回的第三跨链交易,所述第三跨链交易包括所述目的链对所述跨链事务的执行结果;
事务状态表更新模块66,用于根据所述执行结果更新所述事务状态表;
第四跨链交易构建模块67,用于根据所述第三跨链交易和更新后的所述事务状态表构建第四跨链交易,所述第四跨链交易中包括所述执行结果和所述跨链事务的事务状态;
第四跨链交易发送模块68,用于将所述第四跨链交易返回至所述来源链,以供所述来源链根据所述执行结果和所述事务状态处理所述跨链事务。
在一种可能的实现方式中,上述事务状态表初始化模块61包括:
第一初始化子模块,用于将所述第一状态值更新为初始值,所述第一状态值用于标识所述跨链事务的前一个事务状态;
第二初始化子模块,用于将所述第二状态值更新为开始值,所述第二状态值用于标识所述跨链事务的当前事务状态。
在一种可能的实现方式中,上述跨链事务处理装置还包括:
第一更新模块,用于若所述目的链未在所述中继链中注册,则将所述第一状态值更新为开始值;将所述第二状态值更新为开始失败值,所述开始失败值用于表征所述目的链未被发送至所述目的链;
第二更新模块,用于根据所述第一跨链交易和更新后的所述事务状态表构建第五跨链交易;
第五跨链交易发送模块,用于将所述第五跨链交易发送至所述来源链,以供所述来源链根据所述第五跨链交易对所述跨链事务进行回滚;
回滚回执接收子模块,用于接收所述来源链返回的回滚回执;
第三更新子模块,用于根据所述回滚回执将所述事务状态表的第二状态值更新为失败值,所述失败值用于表征所述跨链事务执行失败。
在一种可能的实现方式中,上述第二跨链交易发送模块64包括:
目的跨链网关确定子模块,用于根据所述目的链的注册信息,确定所述目的链的跨链网关;
第二跨链交易发送子模块,用于将所述第二跨链交易发送至所述目的链的跨链网关,所述目的链的跨链网关用于将所述第二跨链交易发送至所述目的链。
在一种可能的实现方式中,上述事务状态表更新模块66,包括:
第四更新子模块,用于若所述执行结果为执行失败,则将所述第一状态值更新为所述第二状态值,将所述第二状态值更新为失败值。
在一种可能的实现方式中,上述第四跨链交易发送模块68包括:
第一来源跨链网关确定子模块,用于确定所述来源链的跨链网关;
第一发送子模块,用于通过所述来源链的跨链网关,将所述第四跨链交易发送至所述来源链,以供所述来源链根据所述第四跨链交易在所述来源链中对所述跨链事务进行回滚。
在另一种可能的实现方式中,上述事务状态表更新模块66还包括:
第五更新子模块,用于若所述执行结果为执行成功,则将所述第一状态值更新为所述第二状态值,将所述第二状态值更新为成功值。
在另一种可能的实现方式中,上述第四跨链交易发送模块68包括:
第二来源跨链网关确定子模块,用于确定所述来源链的跨链网关;
第二发送子模块,用于通过所述来源链的跨链网关,将所述第四跨链交易发送至所述来源链,以供所述来源链根据所述第四跨链交易在所述来源链中完成所述跨链事务。
对于装置实施例而言,由于其与方法实施例基本相似,所以描述得比较简单,相关之处参见方法实施例部分的说明即可。
图7为本申请实施例提供的一种计算设备的结构示意图。如图7所示,该实施例的计算设备7包括:至少一个处理器70(图7中仅示出一个)处理器、存储器71以及存储在所述存储器71中并可在所述至少一个处理器70上运行的计算机程序72,所述处理器70执行所述计算机程序72时实现上述任意各个方法实施例中的步骤。
所述计算设备7可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。该计算设备可包括,但不仅限于,处理器70、存储器71。本领域技术人员可以理解,图7仅仅是计算设备7的举例,并不构成对计算设备7的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。
所称处理器70可以是中央处理单元(Central Processing Unit,CPU),该处理器70还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现成可编程门阵列 (Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器71在一些实施例中可以是所述计算设备7的内部存储单元,例如计算设备7的硬盘或内存。所述存储器71在另一些实施例中也可以是所述计算设备7的外部存储设备,例如所述计算设备7上配备的插接式硬盘,智能存储卡(Smart Media Card, SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。所述存储器71还可以既包括所述计算设备7的内部存储单元也包括外部存储设备。所述存储器71用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器71还可以用于暂时地存储已经输出或者将要输出的数据。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述各个方法实施例中的步骤。
本申请实施例提供了一种计算机程序产品,当计算机程序产品在计算设备上运行时,使得计算设备执行时实现可实现上述各个方法实施例中的步骤。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (18)

  1. 一种跨链事务处理方法,其特征在于,应用于中继链,所述方法包括:
    当接收到来源链发起的第一跨链交易时,初始化所述第一跨链交易的事务状态表,所述第一跨链交易具有对应的跨链事务;
    对所述第一跨链交易进行解析,确定所述第一跨链交易的目的链;
    若所述来源链与所述目的链在所述中继链中注册过,则根据所述第一跨链交易和所述事务状态表构建第二跨链交易;
    将所述第二跨链交易发送至所述目的链;
    接收所述目的链根据所述第二跨链交易返回的第三跨链交易,所述第三跨链交易包括所述目的链对所述跨链事务的执行结果;
    根据所述执行结果更新所述事务状态表;
    根据所述第三跨链交易和更新后的所述事务状态表构建第四跨链交易,所述第四跨链交易中包括所述执行结果和所述跨链事务的事务状态;
    将所述第四跨链交易返回至所述来源链,以供所述来源链根据所述执行结果和所述事务状态处理所述跨链事务。
  2. 如权利要求1所述的方法,其特征在于,所述事务状态表包括第一状态值和第二状态值,所述初始化所述第一跨链交易的事务状态表,包括:
    将所述第一状态值更新为初始值,所述第一状态值用于标识所述跨链事务的前一个事务状态,所述初始值用于标识所述跨链事务还未开始处理;
    将所述第二状态值更新为开始值,所述第二状态值用于标识所述跨链事务的当前事务状态,所述开始值用于标识所述跨链事务开始处理。
  3. 如权利要求2所述的方法,其特征在于,在对所述第一跨链交易进行解析,确定所述第一跨链交易的目的链步骤之后,还包括:
    若所述目的链未在所述中继链中注册,则将所述第一状态值更新为开始值;将所述第二状态值更新为开始失败值,所述开始失败值用于表征所述跨链事务未被发送至所述目的链;
    根据所述第一跨链交易和更新后的所述事务状态表构建第五跨链交易;
    将所述第五跨链交易发送至所述来源链,以供所述来源链根据所述第五跨链交易对所述跨链事务进行回滚;
    接收所述来源链返回的回滚回执;
    根据所述回滚回执将所述事务状态表的第二状态值更新为失败值,所述失败值用于表征所述跨链事务执行失败。
  4. 如权利要求1-3任一项所述的方法,其特征在于,所述将所述第二跨链交易发送至所述目的链,包括:
    根据所述目的链的注册信息,确定所述目的链的跨链网关;
    将所述第二跨链交易发送至所述目的链的跨链网关,所述目的链的跨链网关用于将所述第二跨链交易发送至所述目的链。
  5. 如权利要求2或3任一项所述的方法,其特征在于,所述根据所述执行结果更新所述事务状态表,包括:
    若所述执行结果为执行失败,则将所述第一状态值更新为所述第二状态值,将所述第二状态值更新为失败值。
  6. 如权利要求5所述的方法,其特征在于,所述将所述第四跨链交易返回至所述来源链,以供所述来源链根据所述执行结果和所述事务状态处理所述跨链事务,包括:
    确定所述来源链的跨链网关;
    通过所述来源链的跨链网关,将所述第四跨链交易发送至所述来源链,以供所述来源链根据所述执行结果和所述事务状态对所述跨链事务进行回滚。
  7. 如权利要求2或3任一项所述的方法,其特征在于,所述根据所述执行结果更新所述事务状态表,还包括:
    若所述执行结果为执行成功,则将所述第一状态值更新为所述第二状态值,将所述第二状态值更新为成功值。
  8. 如权利要求7所述的方法,其特征在于,所述将所述第四跨链交易返回至所述来源链,以供所述来源链根据所述执行结果和所述事务状态处理所述跨链事务,包括:
    确定所述来源链的跨链网关;
    通过所述来源链的跨链网关,将所述第四跨链交易发送至所述来源链,以供所述来源链根据所述执行结果和所述事务状态完成所述跨链事务。
  9. 一种跨链事务处理装置,其特征在于,应用于中继链,所述装置包括:
    事务状态表初始化模块,用于当接收到来源链发起的第一跨链交易时,初始化所述第一跨链交易的事务状态表,所述第一跨链交易具有对应的跨链事务;
    目的链确定模块,用于对所述第一跨链交易进行解析,确定所述第一跨链交易的目的链;
    第二跨链交易构建模块,用于若所述来源链和所述目的链在所述中继链中注册过,则根据所述第一跨链交易和所述事务状态表构建第二跨链交易;
    第二跨链交易发送模块,用于将所述第二跨链交易发送至所述目的链;
    第三跨链交易接收模块,用于接收所述目的链根据所述第二跨链交易返回的第三跨链交易,所述第三跨链交易包括所述目的链对所述跨链事务的执行结果;
    事务状态表更新模块,用于根据所述执行结果更新所述事务状态表;
    第四跨链交易构建模块,用于根据所述第三跨链交易和更新后的所述事务状态表构建第四跨链交易,所述第四跨链交易中包括所述执行结果和所述跨链事务的事务状态;
    第四跨链交易发送模块,用于将所述第四跨链交易返回至所述来源链,以供所述来源链根据所述执行结果和所述事务状态处理所述跨链事务。
  10. 如权利要求9所述的装置,其特征在于,所述事务状态表包括第一状态值和第二状态值,所述事务状态表初始化模块包括:
    第一初始化子模块,用于将所述第一状态值更新为初始值,所述第一状态值用于标识所述跨链事务的前一个事务状态,所述初始值用于标识所述跨链事务还未开始处理;
    第二初始化子模块,用于将所述第二状态值更新为开始值,所述第二状态值用于标识所述跨链事务的当前事务状态,所述开始值用于标识所述跨链事务开始处理。
  11. 如权利要求10所述的装置,其特征在于,所述跨链事务处理装置还包括:
    第一更新模块,用于若所述目的链未在所述中继链中注册,则将所述第一状态值更新为开始值;将所述第二状态值更新为开始失败值,所述开始失败值用于表征所述目的链未被发送至所述目的链;
    第二更新模块,用于根据所述第一跨链交易和更新后的所述事务状态表构建第五跨链交易;
    第五跨链交易发送模块,用于将所述第五跨链交易发送至所述来源链,以供所述来源链根据所述第五跨链交易对所述跨链事务进行回滚;
    回滚回执接收子模块,用于接收所述来源链返回的回滚回执;
    第三更新子模块,用于根据所述回滚回执将所述事务状态表的第二状态值更新为失败值,所述失败值用于表征所述跨链事务执行失败。
  12. 如权利要求9-11任一项所述的装置,其特征在于,所述第二跨链交易发送模块包括:
    目的跨链网关确定子模块,用于根据所述目的链的注册信息,确定所述目的链的跨链网关;
    第二跨链交易发送子模块,用于将所述第二跨链交易发送至所述目的链的跨链网关,所述目的链的跨链网关用于将所述第二跨链交易发送至所述目的链。
  13. 如权利要求10或11任一项所述的装置,其特征在于,所述事务状态表更新模块包括:
    第四更新子模块,用于若所述执行结果为执行失败,则将所述第一状态值更新为所述第二状态值,将所述第二状态值更新为失败值。
  14. 如权利要求13所述的装置,其特征在于,所述第四跨链交易发送模块包括:
    第一来源跨链网关确定子模块,用于确定所述来源链的跨链网关;
    第一发送子模块,用于通过所述来源链的跨链网关,将所述第四跨链交易发送至所述来源链,以供所述来源链根据所述第四跨链交易在所述来源链中对所述跨链事务进行回滚。
  15. 如权利要求10或11任一项所述的装置,其特征在于,所述事务状态表更新模块还包括:
    第五更新子模块,用于若所述执行结果为执行成功,则将所述第一状态值更新为所述第二状态值,将所述第二状态值更新为成功值。
  16. 如权利要求15所述的装置,其特征在于,所述第四跨链交易发送模块包括:
    第二来源跨链网关确定子模块,用于确定所述来源链的跨链网关;
    第二发送子模块,用于通过所述来源链的跨链网关,将所述第四跨链交易发送至所述来源链,以供所述来源链根据所述第四跨链交易在所述来源链中完成所述跨链事务。
  17. 一种计算设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1-8任一项所述的方法。
  18. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-8任一项所述的方法。
PCT/CN2022/120865 2021-12-23 2022-09-23 一种跨链事务处理方法、装置、计算设备和介质 WO2023116098A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111590196.0A CN114217911A (zh) 2021-12-23 2021-12-23 一种跨链事务处理方法、装置、计算设备和介质
CN202111590196.0 2021-12-23

Publications (1)

Publication Number Publication Date
WO2023116098A1 true WO2023116098A1 (zh) 2023-06-29

Family

ID=80705424

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/120865 WO2023116098A1 (zh) 2021-12-23 2022-09-23 一种跨链事务处理方法、装置、计算设备和介质

Country Status (2)

Country Link
CN (1) CN114217911A (zh)
WO (1) WO2023116098A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114217911A (zh) * 2021-12-23 2022-03-22 杭州趣链科技有限公司 一种跨链事务处理方法、装置、计算设备和介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190340267A1 (en) * 2018-05-01 2019-11-07 International Business Machines Corporation Blockchain implementing cross-chain transactions
CN112650764A (zh) * 2020-12-30 2021-04-13 北京百度网讯科技有限公司 跨链数据处理方法、装置、设备和存储介质
CN112822181A (zh) * 2020-12-30 2021-05-18 杭州趣链科技有限公司 跨链交易的验证方法、终端设备及可读存储介质
CN112882802A (zh) * 2021-02-01 2021-06-01 杭州云象网络技术有限公司 一种用于跨链的多链消息表事务处理方法及跨链系统
CN112907262A (zh) * 2021-02-20 2021-06-04 北京邮电大学 农产品溯源下的一种基于中继链的区块链跨链交互方法
CN114217911A (zh) * 2021-12-23 2022-03-22 杭州趣链科技有限公司 一种跨链事务处理方法、装置、计算设备和介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190340267A1 (en) * 2018-05-01 2019-11-07 International Business Machines Corporation Blockchain implementing cross-chain transactions
CN112650764A (zh) * 2020-12-30 2021-04-13 北京百度网讯科技有限公司 跨链数据处理方法、装置、设备和存储介质
CN112822181A (zh) * 2020-12-30 2021-05-18 杭州趣链科技有限公司 跨链交易的验证方法、终端设备及可读存储介质
CN112882802A (zh) * 2021-02-01 2021-06-01 杭州云象网络技术有限公司 一种用于跨链的多链消息表事务处理方法及跨链系统
CN112907262A (zh) * 2021-02-20 2021-06-04 北京邮电大学 农产品溯源下的一种基于中继链的区块链跨链交互方法
CN114217911A (zh) * 2021-12-23 2022-03-22 杭州趣链科技有限公司 一种跨链事务处理方法、装置、计算设备和介质

Also Published As

Publication number Publication date
CN114217911A (zh) 2022-03-22

Similar Documents

Publication Publication Date Title
EP3629272B1 (en) Method and device for running chaincode
US11194837B2 (en) Blockchain implementing cross-chain transactions
US11037145B2 (en) Concomitance of an asset and identity block of a blockchain
WO2021109735A1 (zh) 一种基于跨链网络的资源处理方法及装置
US20210036857A1 (en) Sending cross-chain authenticatable messages
US20220209948A1 (en) Blockchain notification board storing blockchain resources
JP2021504847A (ja) クロスブロックチェーンインタラクション方法、装置、システム、および電子デバイス
EP3788578A1 (en) Blockchain implementing cross-chain transactions
WO2020211483A1 (zh) 区块链中智能合约的存储、执行方法及装置和电子设备
WO2022062976A1 (zh) 用于执行交易的跨区块链的系统、跨链交易方法及设备
US20200110825A1 (en) Blockchain notification board storing blockchain resources
US11074353B2 (en) Blockchain universal RFID translator
US11301590B2 (en) Unfalsifiable audit logs for a blockchain
US11474854B2 (en) Transformation of inter-organization process for execution via blockchain
WO2023116098A1 (zh) 一种跨链事务处理方法、装置、计算设备和介质
WO2021114857A1 (zh) 接口调用方法、装置、计算机设备和存储介质
WO2024103854A1 (zh) 跨链交易方法、系统、电子设备及存储介质
WO2023246187A1 (zh) 一种区块链网络的管理方法及相关设备
US8843578B2 (en) Role-independent context exchange
US20230259930A1 (en) Cross-chain transaction processing method and apparatus, electronic device, and storage medium
WO2023207529A1 (zh) 数据处理方法、装置及设备、介质、产品
CN115390939B (zh) 业务处理方法和系统
CN115310974A (zh) 一种跨链交易的处理方法、计算机设备及介质
US11348101B2 (en) Post-settlement processes
US20200133646A1 (en) Transformation of inter-organization process for execution via blockchain

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

Country of ref document: EP

Kind code of ref document: A1