A Cross-chain Transaction Method for Blockchain Based on Intelligent Contract Sequencing

By deploying smart contracts on the blockchain and using collectors and executors of cross-chain support modules, the serial number accuracy and integrity of cross-chain transactions are ensured, and the problem of cross-chain transactions is easily lost or received out of order is solved, and the high reliability of cross-chain transactions is achieved.

CN114548993BActive Publication Date: 2025-05-30HANGZHOU QULIAN TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210240384.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-06-06
Publication Date
2025-05-30
Estimated Expiration
2039-06-06

AI Technical Summary

Technical Problem

Cross-chain transactions are easily lost or received out of order, making it difficult to ensure the high reliability of cross-chain transactions.

Method used

The blockchain cross-chain transaction method based on smart contract sequence is adopted. By deploying cross-chain contracts on the source chain and the destination chain, and using collectors and executors in the cross-chain support module, the sequence number accuracy and integrity of cross-chain transactions are ensured.

Benefits of technology

It effectively avoids the loss and out-of-order reception of cross-chain transactions, ensures the high reliability of cross-chain transactions, and fundamentally solves the problem that cross-chain transactions are difficult to be highly reliable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114548993B_ABST
    Figure CN114548993B_ABST
Patent Text Reader

Abstract

The present invention discloses a cross-chain transaction method based on intelligent contract sequencing for a blockchain. First, a cross-chain contract is deployed on the source chain and the destination chain, and the cross-chain transaction sequence number is initialized. Then, for each cross-chain transaction, the sequence number is incremented. After the contract updates the sequence number, a key-value pair with the sequence number as the key and the cross-chain transaction index as the value is persistently stored, and the updated sequence number is also persisted. If the cross-chain support module receives an out-of-order cross-chain transaction, it searches for the missing cross-chain transaction from the full nodes of the source chain by virtue of the index persistently stored in the cross-chain contract. The present invention solves the problem that cross-chain transactions are easily lost or received out of order, and it is difficult to ensure the high reliability of cross-chain transactions. The use of the intelligent contract sequencing strategy avoids the possibility of cross-chain transactions being lost or received out of order. At the same time, the cross-chain transaction index in the blockchain intelligent contract is used to query the missing cross-chain transactions, fundamentally solving the problem of the high difficulty in ensuring the reliability of cross-chain transactions.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of a Chinese patent application with the application date of "June 6, 2019", application number of "201910491670.0", and title of "A Cross-chain Transaction Method for Blockchain Based on Intelligent Contract Sequencing". Technical Field

[0002] The present invention relates to the intelligent contract technology of blockchain and the field of blockchain cross-chain, and particularly relates to a cross-chain transaction method for blockchain based on intelligent contract sequencing. Background Art

[0003] Cross-chain technology can be understood as a bridge connecting various blockchains, and its main applications are to achieve atomic transactions, asset conversion, internal information intercommunication within blockchains, or to solve Oracle problems, etc.

[0004] Among the many problems faced by blockchains, the lack of interoperability between chains greatly restricts the application space of blockchains. Cross-chain mainly includes two application scenarios: information cross-chain and value cross-chain. The rigorous description, standardized implementation, and general application of cross-chain interoperability protocols will become the key to realizing the "Value Internet". Although many blockchain advocates claim that blockchain is the next-generation Internet, since each chain is an independent and vertically closed system, the current "Internet" is just composed of many blockchain "islands" that are separated from each other. Or rather, the current blockchains look more like intranets.

[0005] Due to the non-connectivity between blockchains and the large fluctuations in asset values, the application and development of blockchain technology have been greatly restricted. Therefore, the interconnection operation between chains is increasingly emphasized, and the need for cross-chain comes from this. However, cross-chain is a complex process that requires not only the ability to separately verify nodes in the chain, but also decentralized input, and more importantly, the ability to obtain information from the outside world of the chain.

[0006] During the process of designing the cross-chain support module, cross-chain transactions are prone to being lost or received out of order, making it difficult to ensure the high reliability of cross-chain transactions. Summary of the Invention

[0007] Aiming at the technical problem that cross-chain transactions are prone to being lost or received out of order, the present invention provides a cross-chain transaction method for blockchain based on intelligent contract sequencing, which can fundamentally solve the problem of difficult high reliability of cross-chain transactions. The specific technical solutions are as follows:

[0008] A cross-chain transaction method based on intelligent contract sequencing, characterized in that, in this method, the blockchain where the user sending the cross-chain transaction is located is the source chain, and the blockchain pointed to by the cross-chain transaction is the destination chain. The cross-chain support module includes a collector and an executor. Cross-chain contracts are deployed on the source chain and the destination chain, and both the source chain and the destination chain are registered on the cross-chain support module;

[0009] The cross-chain transaction method specifically includes the following steps:

[0010] S1: Initialize the cross-chain contract by the cross-chain operation and maintenance personnel. The sequence number identifiers of the cross-chain transactions in the cross-chain contract are determined by different destination chains, and are respectively identified as source chain identifier - destination chain one identifier - 0, source chain identifier - destination chain two identifier - 0, ···, source chain identifier - destination chain n identifier - 0;

[0011] S2: A user on the source chain initiates a cross-chain transaction specifying the destination chain on the source chain. After the cross-chain support module, the source chain, and the destination chain confirm that it is true, valid, and unique, the cross-chain transaction sequence number in the cross-chain contract deployed on the source chain is updated to itself + 1, and then the key-value pair with this sequence number as the key and the cross-chain transaction index as the value is persisted, and then this transaction sequence number is persisted;

[0012] S3: The cross-chain contract deployed on the source chain throws the cross-chain transaction, and it is received by the collector in the cross-chain support module; if the received cross-chain transaction is an out-of-order cross-chain transaction, the newly arrived cross-chain transaction is first cached, and the missing cross-chain transactions are searched from the full nodes of the source chain according to the index persistently stored in the cross-chain contract. After all the missing cross-chain transactions are stored and submitted to the executor in sequence, the cross-chain transactions in the cache are stored and submitted to the executor in sequence;

[0013] S4: After the collector collects the cross-chain transactions in the correct order and persists them in the database, it submits them to the executor. The executor checks the order of the cross-chain transactions. If the executor detects that the cross-chain transaction sequence number does not increase by one incrementally, it notifies the collector. If the collector cannot find it in the local database, it searches for the missing cross-chain transactions from the full nodes of the source chain. After all the missing cross-chain transactions are executed in sequence, the cross-chain transactions in the cache are executed in sequence.

[0014] Further, the cross-chain transaction includes a cross-chain transaction sequence number, a unique identifier ID of the destination chain, a timeout time, the logic to be executed by the destination chain, and a receipt returned by the destination chain.

[0015] Further, the logic to be executed by the destination chain includes a function name and function parameters.

[0016] Further, the receipt returned by the destination chain is a callback function and a timestamp.

[0017] Furthermore, the local database of the collector is maintained by the collector itself, and there are multiple backups of cross-chain transactions in the collector, thus ensuring the high reliability of cross-chain transactions provided to the executor.

[0018] Furthermore, the cross-chain transaction indexes persistently stored in the cross-chain contract need to follow certain specifications and formats, which are formulated and maintained by each blockchain itself.

[0019] The beneficial effects of the present invention are as follows:

[0020] The cross-chain transaction method of the blockchain based on intelligent contract sequencing in the present invention uses the intelligent contract sequencing strategy to avoid the possibility of cross-chain transaction loss or out-of-order reception, and at the same time uses the cross-chain transaction indexes in the parallel chain intelligent contract to query the lost cross-chain transactions, fundamentally solving the problem that it is difficult to achieve high reliability of cross-chain transactions. Description of the Drawings

[0021] Figure 1 is a flowchart of the parallel chain cross-chain transaction method based on intelligent contract sequencing of the present invention. Detailed Embodiments

[0022] The present invention will be described in detail below according to the drawings and preferred embodiments. The purpose and effects of the present invention will become more apparent. The present invention will be further described in detail below in conjunction with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0023] A cross-chain transaction method of the blockchain based on intelligent contract sequencing, as Figure 1 shown, in this method, the blockchain where the user sending the cross-chain transaction is located is the source chain, the blockchain pointed to by the cross-chain transaction is the destination chain, the cross-chain support module includes a collector and an executor, cross-chain contracts are deployed on the source chain and the destination chain, and both the source chain and the destination chain are registered on the cross-chain support module;

[0024] The cross-chain transaction method specifically includes the following steps:

[0025] S1: Initialize the cross-chain contract by cross-chain operation and maintenance personnel. The serial number identifiers of cross-chain transactions in the cross-chain contract are determined by different destination chains, and are respectively identified as source chain identifier - destination chain one identifier - 0, source chain identifier - destination chain two identifier - 0, ···, source chain identifier - destination chain n identifier - 0;

[0026] S2: A user on the source chain initiates a cross-chain transaction to the specified destination chain on the source chain. After the cross-chain support module, the source chain, and the destination chain confirm its authenticity, validity, and uniqueness, the cross-chain transaction sequence number in the cross-chain contract deployed on the source chain is updated to itself + 1, and then this transaction sequence number is persisted. Next, a key-value pair with this sequence number as the key and the cross-chain transaction index as the value is persisted.

[0027] S3: The cross-chain contract deployed on the source chain throws the cross-chain transaction, which is received by the collector in the cross-chain support module. If the received cross-chain transaction is out-of-order, the newly arrived cross-chain transaction is first cached, and the missing cross-chain transactions are searched from the full nodes of the source chain according to the index persistently stored in the cross-chain contract. After all the missing cross-chain transactions are submitted to the executor in order, the cross-chain transactions in the cache are then submitted to the executor in order.

[0028] Here, out-of-order means that the cross-chain transaction sequence numbers in the cross-chain transactions do not increase in the order of natural numbers.

[0029] S4: After the collector collects the cross-chain transactions in the correct order and persists them in the database, it submits them to the executor. The executor checks the order of the cross-chain transactions. If the executor detects that the cross-chain transaction sequence numbers do not increase by one, it notifies the collector. In the case where the collector cannot find them in its local database, it searches for the missing cross-chain transactions from the full nodes of the source chain. After all the missing cross-chain transactions are executed in order, the cross-chain transactions in the cache are then executed in order.

[0030] Preferably, the cross-chain transaction includes a cross-chain transaction sequence number, a unique identifier ID of the destination chain, a timeout period, the logic to be executed by the destination chain, and a receipt returned by the destination chain. The logic to be executed by the destination chain includes a function name and function parameters. The receipt returned by the destination chain is a callback function and a timestamp.

[0031] Preferably, the local database of the collector is maintained by the collector itself, and there are multiple backups of the cross-chain transactions in the collector, thus ensuring the high reliability of the cross-chain transactions provided to the executor.

[0032] Preferably, the cross-chain transaction index persistently stored in the cross-chain contract needs to follow a certain specification and format, which are formulated and maintained by each blockchain itself.

[0033] The blockchain in the cross-chain transaction method based on intelligent contract sequencing of the present invention can be an existing public chain or consortium chain, as well as a blockchain developed in the future. The cross-chain support module does not change the original structure of the parallel chain, that is, the cross-chain support module supports various heterogeneous blockchains and has good compatibility. The users on the source chain are participants who can initiate or receive digital asset transfer transactions. The cross-chain transaction index varies according to the design of each parallel chain. For example, for a certain consortium chain, it is the transaction hash txHash of the cross-chain transaction, and for another consortium chain, it is the transaction identifier TxID of the cross-chain transaction. However, in essence, they are all indexes of the cross-chain transaction and can be used to query the transaction content later.

[0034] Those of ordinary skill in the art can understand that the above are only preferred examples of the invention and are not used to limit the invention. Although the invention has been described in detail with reference to the foregoing examples, for those skilled in the art, they can still modify the technical solutions described in the foregoing examples or equivalently replace some of the technical features. Any modifications, equivalent replacements, etc. made within the spirit and principles of the invention shall be included within the protection scope of the invention.

Claims

1. A cross-chain transaction method for blockchain based on intelligent contract sequencing, characterized in that, applied to a cross-chain support module, the cross-chain support module includes a collector and an executor, and the method includes: using the collector to receive cross-chain transactions from the source chain, the cross-chain transactions having corresponding sequence numbers and destination chains; if the cross-chain transaction is an out-of-order cross-chain transaction, then use the index persistently stored in the cross-chain contract to look up the missing cross-chain transaction from the full nodes of the source chain, and the source chain is used to persistently generate key-value pairs with the sequence number of the cross-chain transaction as the key and the cross-chain transaction index as the value; after the collector collects the cross-chain transactions in the correct order, submit the cross-chain transactions to the executor; using the executor to check the order of the cross-chain transactions; when the executor confirms that the order of the cross-chain transactions is the correct order, use the executor to execute the cross-chain transactions in order.

2. The method according to claim 1, characterized in that, before the step of submitting the cross-chain transactions to the executor after the collector collects the cross-chain transactions in the correct order, further includes: if the sequence numbers of the cross-chain transactions collected by the collector increase incrementally by one, it is determined that the collector has collected the cross-chain transactions in the correct order.

3. The method according to claim 1, characterized in that, the method further includes: after the collector collects the cross-chain transactions in the correct order, store the cross-chain transactions in the local database for summarization.

4. The method according to any one of claims 1-3, characterized in that, after the step of using the executor to check the order of the cross-chain transactions, further includes: if the executor detects that the sequence numbers of the cross-chain transactions do not increase incrementally by one, notify the collector; using the collector to look up the missing cross-chain transactions in the local database; if the collector does not find the missing cross-chain transactions in the local database, look up the missing cross-chain transactions from the full nodes of the source chain.

5. The method according to claim 4, characterized in that, the method further includes: sending the cross-chain transactions to the destination chain in order according to the sequence numbers of the cross-chain transactions.

6. The method according to claim 5, characterized in that, the cross-chain transactions further include the unique identification ID of the destination chain, the timeout period, the logic to be executed by the destination chain, and the receipt returned by the destination chain.

7. The method according to claim 6, characterized in that, the logic to be executed by the destination chain includes the function name and function parameters; the receipt returned by the destination chain is the callback function and the timestamp.

8. A cross-chain transaction method for blockchain based on intelligent contract sequencing, characterized in that, applied to the source chain, the method includes: initiate a cross-chain transaction, the cross-chain transaction having a corresponding sequence number and a specified destination chain; After the cross-chain transaction is determined to be true, valid, and unique by the source chain, the destination chain, and the cross-chain support module, the cross-chain contract is used to increment the serial number of the cross-chain transaction by one and persist the serial number of the cross-chain transaction, as well as persist the key-value pair generated with the serial number of the cross-chain transaction as the key and the cross-chain transaction index as the value; Throw the cross-chain transaction to the cross-chain support module; the cross-chain support module includes a collector and an executor; the collector is used to collect the cross-chain transaction, and after collecting the cross-chain transactions in the correct order, submit the cross-chain transaction to the executor; the executor is used to execute the cross-chain transactions in order. Before executing the cross-chain transaction, the executor checks whether the order of the cross-chain transactions is correct according to the serial number of the cross-chain transaction.

9. The method according to claim 8, wherein, Before initiating the cross-chain transaction, it further includes: In the cross-chain contract, initialize the serial number of the cross-chain transaction; Notify the collector to collect the cross-chain transaction.

10. The method according to claim 8 or 9, wherein, The method further includes: When receiving information about the lost cross-chain transaction queried from the collector, return the lost cross-chain transaction to the collector.

Citation Information

Patent Citations

  • Block chain system-based digital asset transaction method and block chain system

    CN107392608A

  • Joint cloud computing environment value exchange-oriented cross-chain communication method

    CN108009811A