Embodiments of the disclosure disclose a method for orderly execution of cross-chain transactions and a cross-chain system. The method for orderly execution of cross-chain transactions includes: obtaining, by a main chain, a plurality of cross-chain transactions of a source chain; generating, by the main chain, a cross-chain transaction package for at least one of the plurality of subchains according to the plurality of cross-chain transactions, and distributing the cross-chain transaction package to the at least one subchain; and executing orderly, by the at least one subchain, the transactions in the cross-chain transaction package according to orders of the transactions in the cross-chain transaction package after obtaining the cross-chain transaction package. The embodiments of the disclosure may facilitate the orderly execution of cross-chain transactions.
Legal claims defining the scope of protection, as filed with the USPTO.
. A method for orderly execution of cross-chain transactions, the method being applied to a cross-chain system comprising a main chain and a plurality of subchains, and the method for orderly execution of cross-chain transactions comprising:
. The method of, further comprising:
. The method of, wherein the obtaining, by the main chain, the plurality of cross-chain transactions of the source chain comprises:
. The method of, wherein the obtaining, by the main chain, the plurality of cross-chain transactions of the source chain comprises:
. The method of, wherein the obtaining, by the main chain, the plurality of cross-chain transactions of the source chain comprises:
. A cross-chain system, comprising a main chain and a plurality of subchains, cross-chain operations between the main chain and the plurality of subchains being performed according to operations of the method of.
. The cross-chain system ofwherein in a case where the same transaction ID sent by other subchains has not been received by the one subchain of the at least one subchain, the one subchain of the at least one subchain suspends an execution of the empty transaction until the same transaction ID sent by other subchains is received.
. The cross-chain system ofwherein the sending, by the one subchain of the at least one subchain, the transaction ID of the executed cross-chain transaction to the rest of the at least one subchain after executing a cross-chain transaction comprises:
. The cross-chain system ofwherein the obtaining, by the main chain, the plurality of cross-chain transactions of the source chain comprises:
. The cross-chain system ofwherein the obtaining, by the main chain, the plurality of cross-chain transactions of the source chain comprises:
. The cross-chain system ofwherein the obtaining, by the main chain, the plurality of cross-chain transactions of the source chain comprises:
Complete technical specification and implementation details from the patent document.
This application is a U.S. national phase of International Application No. PCT/CN2022/097229, filed on Jun. 6, 2022, which claims priority to Chinese Patent Application No. 202111084581.8, filed on Sep. 16, 2021, entitled “Methods for Orderly Execution of Cross-Chain Transactions and Cross-Chain Systems”, the disclosures of which are hereby incorporated in their entirety by reference herein.
The disclosure relates to a technical field of blockchains, and for example relates to methods for orderly execution of cross-chain transactions and cross-chain systems.
As a distributed ledger, a blockchain has technical advantages for example in immutability of data information, traceability of data information, distributed decentralization, and a trustless system. The blockchain technology has been currently applied in many fields such as finance, health care, supply chains, asset management, Internet-based E-Commerce and so on.
Embodiments of the disclosure disclose methods for orderly execution of cross-chain transactions, cross-chain systems, and corresponding apparatuses and media.
According to an aspect of the embodiments of the disclosure, disclosed is a method for orderly execution of cross-chain transactions, which is applied to a cross-chain system comprising a main chain and a plurality of subchains. The method for orderly execution of cross-chain transactions comprises:
According to another aspect of the embodiments of the disclosure, disclosed is a method for orderly execution of cross-chain transactions, which is applied to a target subchain in a cross-chain system comprising a main chain and a plurality of subchains, the target subchain being one subchain of the plurality of subchains. The method comprises:
According to another aspect of the embodiments of the disclosure, disclosed is a cross-chain system comprising a main chain and a plurality of subchains, and cross-chain operations between the main chain and the plurality of subchains are based on operations of the method of any embodiment of the disclosure.
According to yet another aspect of the embodiments of the disclosure, disclosed is electronic apparatus comprising:
According to still another aspect of the embodiments of the disclosure, disclosed is a computer-readable medium storing computer-readable instructions which, when being executed, perform operations of operations of the method of any embodiment of the disclosure.
Based on the method for orderly execution of cross-chain transactions and the cross-chain system disclosed by the above embodiments of the disclosure, a plurality of transactions in the cross-chain transaction package are ordered according to the transaction numbers, and execution orders of the plurality of transactions in the cross-chain transaction package in the source chain may be maintained. Moreover, during the orderly execution of the transactions in the cross-chain transaction package by the subchain, if the currently processed transaction is a cross-chain transaction, the subchain sends the transaction ID of the cross-chain transaction to the other subchains after processing the cross-chain transaction. If the currently processed transaction is an empty transaction, whether the subchain has received the same transaction ID sent by other subchains is detected according to the transaction ID carried by the empty transaction; if the same transaction ID sent by other subchains has been received, it means that the other subchains have processed the cross-chain transaction corresponding to the empty transaction, and subsequently, the subchain executes the empty transaction and executes the next transaction after executing the empty transaction. In this way, a plurality of cross-chain transactions in the source chain is executed by several subchains orderly according to the execution orders of these cross-chain transactions in a source subchain, which facilitates the orderly execution of cross-chain transactions.
The disclosure will be described in further detail with reference to the drawings and embodiments.
Various exemplary embodiments of the disclosure will now be described in detail with reference to the accompanying drawings. It is noted that the relative arrangements, numerical expressions and numerical values of components and operations set forth in these embodiments do not limit the scope of the disclosure unless otherwise specified.
It is also understood that, in the embodiments of the disclosure, “a plurality of” may refer to two or more, and “at least one” may refer to one, two, or more.
It may be understood by those skilled in the art that terms such as “first” and “second” in the embodiments of this disclosure are only used to distinguish different operations, devices or modules, and do not represent any specific technical meaning or their inevitable logical order.
It is also understood that any component, data or structure mentioned in the embodiments of the disclosure may generally be understood as one or more components, data or structures unless explicitly defined or given contrary enlightenment in the context.
It is also understood that the description of various embodiments in this disclosure focuses on the differences between various embodiments, and the same or similar parts may serve as references for each other, and will not be repeated for the sake of brevity.
The description of at least one exemplary embodiment below is only illustrative, and in no way should it be taken as any limitation on the disclosure, its application or uses.
Technologies, methods and apparatuses known to ordinary skilled in the art may not be discussed in detail, but in appropriate cases, they may be regarded as a part of the specification.
It is noted that similar reference numerals and letters indicate similar items in the following figures, so once an item is defined in one figure, it will not be further discussed in the following figures.
The embodiments of the disclosure may be applied to electronic apparatuses such as terminal apparatuses, computer systems, servers, and the like, which may be operated together with many other general-purpose or special-purpose computing system environments or configurations. Examples of terminal apparatuses, computing systems, environments and/or configurations suitable for use with terminal apparatuses, computer systems, servers and other electronic apparatuses include, but are not limited to, personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop apparatuses, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, mainframe computer systems, and distributed cloud computing technology environments including any of the above systems, and so on.
Terminal apparatuses, computer systems, servers and other electronic apparatuses may be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules may include routines, programs, object programs, components, logic, data structures, etc., which perform particular tasks or implement particular abstract data types. Computer systems/servers may be implemented in a distributed cloud computing environment where tasks are performed by remote processing apparatuses linked through a communication network. In the distributed cloud computing environment, program modules may be located on local or remote computing system storage media including storage apparatuses.
For example, due to complexity of cross-chain technologies and cross-chain systems, it is difficult to realize the orderly execution of cross-chain transactions, thus causing business problems. For example, a user registering in a subchain A initiates a cross-chain transaction tx1 and a cross-chain transaction tx2 successively during a period of time, hoping to purchase bond assets with a quantity m in subchain B through the cross-chain transaction tx1, and then to purchase fund assets with a quantity n in subchain C through the cross-chain transaction tx2 by utilizing the remaining assets in the account. However, when the total assets of account a1 are not enough to purchase both the bond assets with the quantity m and the fund assets with the quantity n, if the two cross-chain transactions are executed orderly, the bond assets that the user wants to buy the most may still be successfully purchased; however, if the two cross-chain transactions are not executed orderly, the bond assets that the user wants to buy the most may not be successfully purchased. It may be seen that the orderly execution of cross-chain transactions is important.
For example for the above issues, the embodiments of the disclosure disclose methods for orderly execution of cross-chain transactions, cross-chain systems, corresponding apparatuses and media. A plurality of transactions in a cross-chain transaction package are ordered according to the transaction numbers, and the execution orders in a source chain are maintained for the plurality of transactions in the cross-chain transaction package. Moreover, during the orderly execution of the transactions in the cross-chain transaction package by a subchain, if the currently processed transaction is a cross-chain transaction, the subchain may send a transaction ID of the processed cross-chain transaction to other subchains after processing the cross-chain transaction. If the currently processed transaction is an empty transaction, then according to a transaction ID carried by the empty transaction, whether the subchain has received the same transaction ID sent by the other subchains is detected; if so, it means that the other subchains have processed a cross-chain transaction corresponding to the empty transaction, then the subchain executes the empty transaction and executes the next transaction after executing the empty transaction. In this way, a plurality of cross-chain transactions in the source chain may be executed orderly by several subchains according to the execution orders of these cross-chain transactions in a source subchain, which facilitates the orderly execution of cross-chain transactions.
The technical solutions in the embodiments of the disclosure may be implemented in various computer languages, for example an object-oriented programming language, such as Java, and an interpreted scripting language, such as JavaScript.
In order to make the technical solutions and advantages of the embodiments of the disclosure clearer, exemplary embodiments of the disclosure will be described in detail below with reference to the attached drawings. Obviously, the described embodiments are only a part of the embodiments of the disclosure, but not an exhaustive list of all the embodiments. It is noted that the embodiments in the disclosure and the features in the embodiments may be combined with each other without conflicts.
Referring to,is a flowchart of a method for orderly execution of cross-chain transactions according to an embodiment of the disclosure, the method for orderly execution of cross-chain transactions may be applied to a cross-chain system comprising a main chain and a plurality of subchains. As shown in, the method for orderly execution of cross-chain transactions may comprise the following operations.
In S, the main chain may obtain a plurality of cross-chain transactions of a source chain.
Each cross-chain transaction carries a target chain ID and a transaction number, and the transaction number of each cross-chain transaction may indicate an execution order of the cross-chain transaction in the source chain, the source chain may be one of the plurality of subchains, and the target chain may be a subchain in the plurality of subchains other than the source chain.
In this disclosure, in addition to the target chain ID and the transaction number, each cross-chain transaction may further carry a transaction ID. The transaction number may indicate the execution order of the cross-chain transaction in the source chain. For example, the transaction numbers of the plurality of cross-chain transactions may be increment digital numbers. The larger the digital number of a cross-chain transaction, the lower the execution order of the cross-chain transaction in the source chain.
For ease of understanding, illustratively, let a cross-chain transaction carry information “tx_id:077ae2439; nonce:175; Account:b1; Source_chain_id:chain-b; Destination_chain_id:chain-a”, meaning that the transaction ID of the cross-chain transaction is 077ae2439, the transaction number of the cross-chain transaction is 175, the cross-chain transaction is initiated by the account b1, the source chain ID of the cross-chain transaction is chain-b, and the target chain ID of the cross-chain transaction is chain-a.
For another example, let a cross-chain transaction carry information “tx_id:8d69cbc53; nonce:176; Account:b1; Source_chain_id:chain-b; Destination_chain_id:chain-c”, meaning that the transaction ID of the cross-chain transaction is 8d69cbc53, the transaction number of the cross-chain transaction is 176, the cross-chain transaction is initiated by the account b1, the source chain ID of the cross-chain transaction is chain-b, and the target chain ID of the cross-chain transaction is chain-c.
In some possible embodiments, the cross-chain system may further comprise a plurality of backbone nodes, each corresponding to a subchain, and a backbone node of the plurality of backbone nodes may connect the main chain and a subchain corresponding to the backbone node. In these embodiments, for example, obtaining, by the main chain, the plurality of cross-chain transactions of the source chain may comprise: obtaining, by a backbone node of the source chain, a plurality of cross-chain transactions of the source chain; and adjusting, by the backbone node, a transaction structure of at least one cross-chain transaction of the plurality of cross-chain transactions into a transaction structure matching the main chain, assigning a transaction number to at least one adjusted cross-chain transaction, and then submitting the plurality of cross-chain transactions with assigned transaction numbers to the main chain. In this way, the main chain may obtain the plurality of cross-chain transactions submitted by the backbone node.
In an optional example, Smay be performed by the main chain in the cross-chain system.
In S, the main chain may generate a cross-chain transaction package for at least one subchain of the plurality of subchains according to the plurality of cross-chain transactions, and may distribute the cross-chain transaction package to the at least one subchain.
The cross-chain transaction package of the at least one subchain may comprise at least one cross-chain transaction and at least one empty transaction. The target chain ID carried by the cross-chain transaction in the cross-chain transaction package of the at least one subchain may be the same as a subchain ID of the subchain. Each of the at least one empty transaction in the cross-chain transaction package of the at least one subchain may correspond to a cross-chain transaction, the target chain ID carried by the cross-chain transaction corresponding to the at least one empty transaction may be different from the subchain ID of the subchain, and the at least one empty transaction may further carry the transaction ID of the corresponding cross-chain transaction. The at least one cross-chain transaction and the at least one empty transaction in the cross-chain transaction package of each subchain may be ordered according to the transaction numbers.
In this disclosure, at least one cross-chain transaction and at least one empty transaction in the cross-chain transaction package of each subchain are ordered according to the transaction numbers, and thus the order of at least one transaction in the cross-chain transaction package of the at least one subchain may be the same as the execution order of at least one cross-chain transaction in the source chain.
In some possible embodiments, for example, distributing, by the main chain, the cross-chain transaction package of the at least one subchain to the at least one subchain may comprise: distributing, by the main chain, the cross-chain transaction package of the at least one subchain to backbone nodes of the at least one subchain; and adjusting, by a backbone node of a subchain of the at least one subchain, a transaction structure of each transaction in the cross-chain transaction package into a transaction structure matching the subchain, and submitting the adjusted cross-chain transaction package to the subchain.
It is noted that the cross-chain system of this disclosure may comprise a plurality of subchains, and in order to improve system compatibility, the plurality of subchains may be various heterogeneous chains, and the transaction structures supported by the plurality of subchains may be different. Therefore, in order to smoothly realize cross-chain operation among the plurality of subchains, before sending the cross-chain transaction of at least one subchain in this disclosure to the main chain, the backbone node of at least one subchain may adjust the transaction structure of the cross-chain transaction of the corresponding subchain, and then may send the adjusted cross-chain transaction to the main chain, so that the main chain may successfully execute the cross-chain transaction. Similarly, the backbone node of each subchain may also adjust the transaction structure of the cross-chain transaction sent by the main chain, and then send the adjusted cross-chain transaction to the corresponding subchain, so that the subchain may successfully execute the cross-chain transaction.
In an optional example, Smay be performed by the main chain in the cross-chain system.
In S, after obtaining the cross-chain transaction package, each subchain may execute orderly the transactions in the cross-chain transaction package according to the orders of the transactions in the cross-chain transaction package.
As shown in, after executing a cross-chain transaction, one subchain of the plurality of subchains sends the transaction ID of the executed cross-chain transaction to the rest of the plurality of subchains other than the subchain which has finished the execution of the cross-chain transaction. Before executing an empty transaction, the one subchain of the plurality of subchains detects whether the subchain has received the same transaction ID sent by other subchains according to the transaction ID carried by the empty transaction, and executes the empty transaction if the same transaction ID sent by the other subchains has been received. In addition, if the subchain has not received the same transaction ID sent by other subchains in the plurality of subchains than the subchain ready to execute the empty transaction, the subchain ready to execute the empty transaction may suspend the execution of the empty transaction until it receives the same transaction ID sent by the other subchains in the plurality of subchains than the subchain ready to execute the empty transaction.
In an optional example, Smay be executed performed by the subchain in the cross-chain system.
In some possible embodiments, as shown in, after executing a cross-chain transaction, the subchain may send the transaction ID of the cross-chain transaction to the rest subchains in the following ways.
In S-, after executing the cross-chain transaction, the subchain may send the transaction ID of the cross-chain transaction to the main chain.
In an optional example, S-may be performed by the subchain in the cross-chain system.
In S-, after receiving the transaction ID, the main chain may forward the transaction ID to at least one subchain of the plurality of subchains, for example, the transaction ID may be forwarded to each subchain of the plurality of subchains.
In an optional example, S-may be performed by the main chain in the cross-chain system.
In the disclosure, the transaction ID may be forwarded to at least one subchain in the cross-chain system through the main chain, for example, to all subchains in the cross-chain system through the main chain, and thus the at least one subchain does not need to save and update a routing relationship among the subchains at any time, which simplifies the design of the subchains and reduces the workload of subchain calculation.
In an implementation, the main chain may comprise a plurality of main chain nodes, and at least one main chain node may correspond to a subchain, for example, each main chain node corresponds to a subchain. When a subchain finishes executing a cross-chain transaction, the subchain may send the transaction ID of the cross-chain transaction to the backbone node of the subchain. The backbone node may submit the transaction ID to the main chain node corresponding to the subchain. After receiving the transaction ID, the main chain node synchronizes the transaction ID to other main chain nodes of the main chain through a peer to peer (P2P) network of the main chain. After receiving the transaction ID, each of the other main chain nodes may send the transaction ID to the backbone node of the subchain corresponding to each main chain node. After receiving the transaction ID sent by the main chain node, each backbone node may send the transaction ID to the corresponding subchain. After receiving the transaction ID, the subchain may perform synchronization within the subchain through the P2P network of the subchain, so that each subchain node receives the transaction ID.
In another possible embodiment, at least one subchain in the cross-chain system may save and update the routing relationship among the subchains, for example, each subchain in the cross-chain system may save and update the routing relationship between the subchains. When a subchain in the cross-chain system finishes executing a cross-chain transaction, the subchain may directly send the transaction ID of the cross-chain transaction to the other subchains according to the routing relationship among the subchains.
Unknown
March 3, 2026
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.