Data synchronization method, device, system and terminal equipment for cross-chain transactions
By building block information with preset structures and submitting transaction data to cross-chain gateways, the transaction data privacy leakage caused by traditional cross-chain transaction information synchronization methods is solved, and more efficient data synchronization and privacy protection is achieved.
Patent Information
- Application Number
- CN202011609680.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-30
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2040-12-30
AI Technical Summary
Traditional cross-chain transaction information synchronization method can easily lead to the privacy of transaction data that other blockchains use.
The cross-chain transactions sent by the source blockchain are obtained through the relay chain, and the cross-chain transactions are constructed into block information with a preset structure according to the address information of the destination blockchain, and transaction data is submitted to the cross-chain gateway, so that it can be verified and synchronized cross-chain transaction content to the target blockchain.
It realizes the protection of transaction data privacy of other blockchain applications, reduces the synchronous load of cross-chain gateways, reduces the bandwidth occupancy of network transmission storage pressure, and improves the system's response speed and processing efficiency.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer application technology, and in particular, relates to a data synchronization method, device, system and terminal device for cross-chain transactions. Background Art
[0002] With the development of blockchain application technology, different blockchains can communicate with each other through cross-chain technology, which mainly includes notary mechanism, hash locking and relay chain, etc. Among them, cross-chain transactions based on relay chain are that different application chains access the relay chain through the cross-chain gateway and perform cross-chain operations through the relay chain.
[0003] In a cross-chain network, based on the cross-chain transaction scenario of the relay chain, a relay chain may connect more than a dozen or even more application blockchains. The cross-chain gateway connecting the relay chain and the application blockchain is responsible for synchronizing the block headers and block transactions on the relay chain. However, when the cross-chain gateway synchronizes the relay chain block transactions, a block of the relay chain may contain multiple cross-chain transactions from different application blockchains. If all cross-chain transactions are synchronized in the traditional synchronization method, since the cross-chain gateway can obtain the cross-chain transactions of all application blockchains connected to the relay chain, it is easy to cause the privacy leakage of transaction data of other application blockchains. Summary of the invention
[0004] The embodiments of the present application provide a data synchronization method, apparatus, system and terminal device for cross-chain transactions, which can solve the problem that the traditional information synchronization method of cross-chain transactions easily leads to the privacy leakage of transaction data of other application blockchains.
[0005] In a first aspect, an embodiment of the present application provides a data synchronization method for cross-chain transactions, which is applied to a relay chain, and the method includes:
[0006] Obtain a cross-chain transaction sent by a source blockchain, wherein the cross-chain transaction includes address information of a destination blockchain; construct the cross-chain transaction into block information of a preset structure according to the address information, wherein the block information includes transaction data of a target blockchain corresponding to a cross-chain gateway; submit the transaction data to the cross-chain gateway, so that the cross-chain gateway synchronizes the cross-chain transaction content in the transaction data to the target blockchain after verifying the transaction data.
[0007] In a possible implementation manner of the first aspect, constructing the cross-chain transaction into block information of a preset structure according to the address information includes:
[0008] Classify the cross-chain transactions according to the address information to obtain a cross-chain transaction group corresponding to each of the destination blockchains; perform hash operations on each cross-chain transaction in the cross-chain transaction group to obtain a transaction hash list corresponding to the cross-chain transaction group; construct a first Merkel tree for each of the transaction hash lists according to the structure of the Merkel tree to obtain a first tree root value corresponding to each of the transaction hash lists and a first tree root value set corresponding to all transaction hash lists; construct a second Merkel tree for the first tree root value set to obtain a second tree root value; wherein the second tree root value is recorded in the block header of the block information, and the transaction hash list, all of the first Merkel trees, the first tree root value set, the second Merkel tree and the second tree root value are recorded in the block body of the block information.
[0009] In a possible implementation manner of the first aspect, submitting the transaction data to the cross-chain gateway so that the cross-chain gateway synchronizes the cross-chain transaction content in the transaction data to the target blockchain after verifying the transaction data includes:
[0010] Submit the target transaction hash list corresponding to the target blockchain in the transaction hash list, the first root value set, the second root value and the cross-chain transaction content to the cross-chain gateway, so that the cross-chain gateway can synchronize the cross-chain transaction content to the target blockchain after verifying the cross-chain transaction content based on the target transaction hash list, the first root value set and the second root value.
[0011] In a second aspect, an embodiment of the present application provides a data synchronization method for cross-chain transactions, which is applied to a cross-chain gateway, and the method includes:
[0012] Obtain the transaction data of the target blockchain corresponding to the cross-chain gateway in the block information submitted by the relay chain; the block information is obtained by the relay chain based on the address information of the target blockchain, and the cross-chain transaction sent by the source blockchain is constructed according to a preset structure; the transaction data is verified; if the verification is passed, the cross-chain transaction content in the transaction data is synchronized to the target blockchain.
[0013] In a possible implementation of the second aspect, the block information includes a block header and a block body; the block body includes a transaction hash list, a first Merkle tree, a first root value set, a second Merkle tree, and a second root value, and the block header includes the second root value; wherein the transaction hash list is obtained by the relay chain performing hash operations on each cross-chain transaction in a cross-chain transaction group, and the cross-chain transaction group is obtained by the relay chain classifying the cross-chain transactions according to the address information; the first root value set is obtained by the relay chain constructing a first Merkle tree for all the transaction hash lists according to the structure of the Merkle tree; and the second root value is obtained by the relay chain constructing a second Merkle tree based on the first root value set.
[0014] Exemplarily, the obtaining of block information submitted by the relay chain includes:
[0015] Obtain a target transaction hash list corresponding to the target blockchain in the transaction hash list submitted by the relay chain, the first tree root value set, the second tree root value, and the cross-chain transaction content.
[0016] In a possible implementation manner of the second aspect, the verifying the transaction data includes:
[0017] Based on the first root value set, a third Merkle tree is constructed to obtain a third root value; if the third root value is the same as the second root value, the target transaction hash list is verified, and the target hash list is a transaction hash list corresponding to the target blockchain; a fourth Merkle tree of the target transaction hash list is constructed to obtain a fourth root value; if the fourth root value exists in the first root value set, the cross-chain transaction content is verified; the cross-chain transaction content is hashed to obtain the hash values of all cross-chain transactions in the cross-chain transaction content; if the hash values of all cross-chain transactions are all in the target transaction hash list, the verification is successful.
[0018] In a third aspect, an embodiment of the present application provides a data synchronization device for cross-chain transactions, including:
[0019] An acquisition unit, used to acquire a cross-chain transaction sent by a source blockchain, wherein the cross-chain transaction includes address information of a destination blockchain;
[0020] A processing unit, configured to construct the cross-chain transaction into block information of a preset structure according to the address information, wherein the block information includes transaction data of a target blockchain corresponding to the cross-chain gateway;
[0021] The sending unit is used to submit the transaction data to the cross-chain gateway, so that the cross-chain gateway can synchronize the cross-chain transaction content in the transaction data to the target blockchain after verifying the transaction data.
[0022] In a fourth aspect, an embodiment of the present application provides a data synchronization device for cross-chain transactions, including:
[0023] An acquisition unit is used to acquire transaction data of a target blockchain corresponding to the cross-chain gateway in the block information submitted by the relay chain; the block information is obtained by the relay chain constructing the cross-chain transaction sent by the source blockchain according to a preset structure based on the address information of the target blockchain;
[0024] A verification unit, used to verify the transaction data;
[0025] The synchronization unit is used to synchronize the cross-chain transaction content in the transaction data to the target blockchain if the verification is passed.
[0026] In a fifth aspect, an embodiment of the present application provides a cross-chain transaction verification system, including: a relay chain and one or more cross-chain gateways, wherein the relay chain is communicatively connected to the one or more cross-chain gateways;
[0027] The relay chain is used to execute the data synchronization method for cross-chain transactions as described in the first aspect;
[0028] The cross-chain gateway is used to execute the data synchronization method for cross-chain transactions as described in the second aspect.
[0029] In a sixth aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the described method when executing the computer program.
[0030] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the described method when executed by a processor.
[0031] In an eighth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the method described above.
[0032] It can be understood that the beneficial effects of the second to eighth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.
[0033] Compared with the prior art, the embodiments of the present application have the following beneficial effects: through the embodiments of the present application, the relay chain obtains the cross-chain transaction sent by the source blockchain, and the cross-chain transaction includes the address information of the destination blockchain; according to the address information, the relay chain constructs the cross-chain transaction into block information of a preset structure, and the block information includes the transaction data of the destination blockchain corresponding to the cross-chain gateway; the relay chain submits the transaction data to the cross-chain gateway, so that the cross-chain gateway synchronizes the cross-chain transaction content in the transaction data to the destination blockchain after verifying the transaction data; by classifying the cross-chain transactions according to the address information and constructing the block information of a preset structure, the cross-chain gateway can only obtain the cross-chain transactions and related transaction data of the corresponding destination blockchain, and cannot synchronize and obtain the cross-chain transaction content of other destination blockchains, thereby protecting the cross-chain transaction data of other destination blockchains from being leaked; it has strong ease of use and practicality. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0035] Figure 1 It is a schematic diagram of the system architecture of an application scenario provided by an embodiment of the present application;
[0036] Figure 2 It is a flowchart of a data synchronization method for cross-chain transactions provided by an embodiment of the present application;
[0037] Figure 3 It is a schematic diagram of the structure of the constructed block information provided by an embodiment of the present application;
[0038] Figure 4 is a schematic diagram of the structure of a transaction tree constructed according to another embodiment of the present application;
[0039] Figure 5 This is a schematic diagram of a structure for constructing a transaction tree provided by another embodiment of the present application;
[0040] Figure 6 It is a flowchart of a data synchronization method for cross-chain transactions provided by an embodiment of the present application;
[0041] Figure 7 This is a schematic diagram of the interactive process of data synchronization provided by an embodiment of the present application;
[0042] Figure 8 This is a schematic diagram of the structure of a data synchronization device for cross-chain transactions provided by an embodiment of the present application;
[0043] Fig. 9 It is a structural diagram of a data synchronization device for cross-chain transactions provided by another embodiment of the present application;
[0044] Fig.10 It is a structural diagram of a data synchronization system for cross-chain transactions provided in an embodiment of the present application;
[0045] Fig.11 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0047] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0048] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0049] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0050] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0051] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0052] With the development and innovation of blockchain technology, a large number of blockchain networks with different characteristics and adapted to different scenario requirements have emerged for different fields. Many value islands have been formed between each blockchain network. The interconnection and value transfer between different chains are realized through blockchain cross-chain technology.
[0053] In the scenario of using relay chain for cross-chain, a relay chain may connect more than a dozen or even more application blockchains to form a cross-chain network. The cross-chain gateway connects the relay chain and the application blockchain. The cross-chain gateway is responsible for synchronizing the block headers and block transactions on the relay chain and verifying the validity of the block transactions; if the transaction is valid, the content of the received block transaction will be synchronized to the application blockchain connected to it.
[0054] See also Figure 1 , is a schematic diagram of the system architecture of an application scenario provided by an embodiment of the present application. The relay chain can connect to multiple target blockchains (such as Figure 1 The relay chain obtains cross-chain transactions from one or more source blockchains, packages the cross-chain transactions into blocks, and sends them to the cross-chain gateway through routing. The cross-chain gateway verifies the cross-chain transactions and verifies whether the received cross-chain transactions exist on the relay chain. After the verification is passed, the cross-chain transaction content is sent to the destination blockchain, and the destination blockchain performs the corresponding transaction operation.
[0055] Among them, when the cross-chain gateway synchronizes the block transactions of the relay chain, a block of the relay chain may contain cross-chain transactions from multiple different application blockchains, and the cross-chain gateway can obtain cross-chain transactions of all application blockchains connected to the relay chain. At present, in the application scenario where the cross-chain gateway synchronizes the blocks of the relay chain and verifies them, the Simplified Payment Verification (SPV) proof method is generally used; under this proof method, the cross-chain gateway needs to synchronize all transactions on the relay chain, and verify whether the transaction exists on the relay chain in combination with the corresponding path information.
[0056] Through the above model, if the cross-chain gateway synchronizes all cross-chain transactions of the relay chain, it will not be able to protect the privacy of transaction data of other application blockchains; and, with the continuous expansion of the cross-chain network, the amount of data that each cross-chain gateway needs to synchronize will increase greatly, which will increase the network transmission time and resource consumption of the cross-chain gateway synchronization block transactions, and increase the operation and maintenance costs of the cross-chain gateway.
[0057] Based on the above problems, the embodiment of the present application provides a data synchronization method for cross-chain transactions, which obtains only the cross-chain transactions and related information corresponding to the application blockchain connected to it from the relay chain through the cross-chain gateway, and based on the specific format of the cross-chain transaction and related information, it can quickly prove that the obtained cross-chain transaction comes from the relay chain, reducing the data volume of the proof information and simplifying the proof process. The specific process of implementing this method is introduced below through the embodiment of the present application.
[0058] See also Figure 2 , a flow chart of a data synchronization method for cross-chain transactions provided by an embodiment of the present application, the execution subject of the method is Figure 1 The relay chain in Figure 2 As shown, the method comprises the following steps:
[0059] Step S201, obtain the cross-chain transaction sent by the source blockchain, and the cross-chain transaction includes the address information of the destination blockchain.
[0060] In some embodiments, the relay chain obtains a cross-chain transaction sent by a source blockchain, and the cross-chain transaction includes information of the source blockchain and information of the destination blockchain; the information of the destination blockchain includes address information of the destination blockchain.
[0061] Among them, the source blockchain can communicate with the relay chain through the cross-chain gateway; that is, the source blockchain is sent to the cross-chain gateway connected to it, and the cross-chain gateway forwards the cross-chain transaction to the relay chain. Cross-chain transactions can be multiple transactions sent by multiple source blockchains to multiple destination blockchains, or multiple transactions sent by one source blockchain to multiple destination blockchains. Each destination blockchain can also correspond to multiple cross-chain transactions; each cross-chain transaction contains the address information of the corresponding destination blockchain.
[0062] Step S202: construct the cross-chain transaction into block information of a preset structure according to the address information, and the block information includes transaction data of the target blockchain corresponding to the cross-chain gateway.
[0063] In some embodiments, the relay chain groups cross-chain transactions according to the address information in the cross-chain transactions to obtain cross-chain transaction groups corresponding to different target blockchains. The cross-chain transaction groups corresponding to different target blockchains are then grouped according to a transaction tree with a preset structure to generate block information to be synchronized, i.e., the relay chain packages the received cross-chain transactions into blocks according to the preset structure.
[0064] Among them, when the relay chain synchronizes transaction information to the cross-chain gateway, it will no longer synchronize all cross-chain transactions in the block, but only synchronize the transaction data corresponding to the target blockchain connected to the cross-chain gateway; the target blockchain is one of multiple destination blockchains, and the target blockchain is connected to the cross-chain gateway, and communicates with the relay chain through the cross-chain gateway. The cross-chain gateway establishes a long-term communication connection with the relay chain.
[0065] In some embodiments, according to the address information, cross-chain transactions are constructed into block information of a preset structure, including: classifying cross-chain transactions according to the address information to obtain a cross-chain transaction group corresponding to each destination blockchain; performing hash operations on each cross-chain transaction in the cross-chain transaction group to obtain a transaction hash list corresponding to the cross-chain transaction group; according to the structure of the Merkel tree, constructing a first Merkel tree for each transaction hash list to obtain a first tree root value corresponding to each transaction hash list and a set of first tree root values corresponding to all transaction hash lists; constructing a second Merkel tree for the first tree root value set to obtain a second tree root value; wherein the second tree root value is recorded in the block header of the block information, and the transaction hash list, all first Merkel trees, the first tree root value set, the second Merkel tree, and the second tree root value are recorded in the block body of the block information.
[0066] In some embodiments, the relay chain constructs a transaction tree for cross-chain transactions. Figure 3 As shown, a schematic diagram of the structure of the block information constructed according to an embodiment of the present application is shown. The block information includes a block header and a block body, which is an exemplary description. Figure 3 Only the parts related to the embodiment are shown.
[0067] like Figure 3 As shown, in the transaction information received by the relay chain, in addition to cross-chain transactions, non-cross-chain transactions are also included. The embodiment of the present application takes the application scenario of cross-chain transactions as an example for explanation. The cross-chain transactions received by the relay chain include cross-chain transactions a to cross-chain transactions l, and the received non-cross-chain transactions include transactions m to transactions p. Among them, cross-chain transactions a to cross-chain transactions d correspond to cross-chain transactions sent to the destination blockchain A, cross-chain transactions c to cross-chain transactions h correspond to cross-chain transactions sent to the destination blockchain B, and cross-chain transactions i to cross-chain transactions l correspond to cross-chain transactions sent to the destination blockchain C. The relay chain groups cross-chain transactions according to the address information of the destination blockchain A, destination blockchain B, and destination blockchain C in the cross-chain transaction to obtain a cross-chain transaction group. Non-cross-chain transactions are grouped together.
[0068] For example, when constructing a transaction tree, the relay chain performs a hash operation on each cross-chain transaction and each non-cross-chain transaction to obtain a corresponding hash value, for example Figure 3The hash a corresponding to cross-chain transaction a, the hash m corresponding to transaction m, etc. For each cross-chain transaction group and non-cross-chain transaction group, the corresponding transaction hash list is obtained. For each transaction hash list, the relay chain constructs the first Merkle tree of each hash list according to the Merkle tree structure, such as Figure 3 As shown, for hash a to hash d, a hash operation of adjacent values is performed to obtain hash ab and hash cd, and then a hash operation is performed on hash ab and hash cd to obtain hash abcd, thereby constructing a transaction tree of cross-chain transaction a to cross-chain transaction d, and the value of hash abcd is used as the first tree root value L2Root. Similarly, the first Merkle tree and the first tree root value of other transaction hash lists are obtained, such as hash efgh, hash ijkl, and hash mnop; the first tree root value set is composed of each first tree root value. The relay chain constructs a second Merkle tree based on the first tree root value set to obtain the second tree root value L1Root; as shown Figure 3 As shown, hash abcd and hash efgh are hashed once to obtain hash abcdefgh; hash ijkl and hash mnop are hashed once to obtain hash ijklmnop; finally, hash abcdefgh and hash ijklmnop are hashed once again to obtain the second Merkle tree and the second tree root value L1Root.
[0069] like Figure 3 As shown, the second tree root value L1Root is recorded in the block header of the block information, and each cross-chain transaction, non-cross-chain transaction and the corresponding transaction hash list, the first Merkle tree and the second Merkle tree are recorded in the block body. It can be understood that the block information of the block information also includes other relevant information, which is only exemplified here and will not be described in detail.
[0070] For example, in some embodiments, when the relay chain constructs a transaction tree, it determines how many layers of height to construct the transaction tree based on the number of cross-chain transactions. Figure 4 and Figure 5 As shown, a schematic diagram of the structure of a transaction tree constructed according to another embodiment of the present application is shown.
[0071] like Figure 4 As shown, in the relay chain, the cross-chain transactions corresponding to the destination blockchain A include cross-chain transactions a to cross-chain transactions d, and the cross-chain transactions corresponding to the destination blockchain D include cross-chain transactions e to cross-chain transactions g. After the cross-chain transactions are grouped according to the address information of the destination blockchain, two groups of cross-chain transaction groups are obtained. In the process of constructing a transaction tree for the two groups of cross-chain transaction groups, the relay chain first performs a hash operation on each cross-chain transaction to obtain the hash value of each cross-chain transaction, such as hash a to hash g, to obtain a transaction hash list for each group of cross-chain transaction groups; the relay chain constructs a transaction tree for each transaction hash list. As shown Figure 4As shown, hash a to hash d are hashed twice to obtain hash abcd, thereby obtaining the first Merkle tree and the first tree root value of cross-chain transactions a to cross-chain transactions d. In the process of constructing the transaction tree of cross-chain transactions e to cross-chain transactions g, the relay chain performs a hash operation on cross-chain transactions e to cross-chain transactions g to obtain the values of hash e to hash g. When performing adjacent hash operations on hash e to hash g again, the value of hash g (such as hash g in the dotted box) is copied to obtain hash ef and hash gg. Hash ef and hash gg are hashed again to obtain the transaction tree of cross-chain transactions e to cross-chain transactions g, thereby obtaining the first Merkle tree and the first tree root value of cross-chain transactions e to cross-chain transactions g. The relay chain further performs a hash operation based on hash abcd and hash efgg to obtain the second Merkle tree and the second tree root value hash abcdefgg. Among them, the cross-chain transaction groups are cross-chain transaction a to cross-chain transaction d, and cross-chain transaction e to cross-chain transaction g; the transaction hash lists are hash a to hash d, and hash e to hash g; and the first tree root values are hash abcd and hash efgg.
[0072] like Figure 5 As shown, in the relay chain, the cross-chain transactions corresponding to the destination blockchain A include cross-chain transactions a to cross-chain transactions d, and the cross-chain transactions corresponding to the destination blockchain D include cross-chain transactions e to cross-chain transactions g. After the cross-chain transactions are grouped according to the address information of the destination blockchain, two groups of cross-chain transaction groups are obtained. In the process of constructing a transaction tree for the two groups of cross-chain transaction groups, the relay chain first performs a hash operation on each cross-chain transaction to obtain the hash value of each cross-chain transaction, such as hash a to hash j, to obtain a transaction hash list for each group of cross-chain transaction groups; the relay chain constructs a transaction tree for each transaction hash list. Figure 5As shown, hash a to hash d are hashed twice to obtain hash abcd. To maintain the height consistency with the transaction tree of cross-chain transaction e to cross-chain transaction j, hash abcd is hashed again. For example, hash abcd is hashed in combination with the hash abcd in the dotted box to obtain hash abcdabcd, thereby obtaining the first Merkle tree and the first tree root value of cross-chain transaction a to cross-chain transaction d. In the process of constructing the transaction tree of cross-chain transaction e to cross-chain transaction j, the relay chain performs a hash operation on cross-chain transaction e to cross-chain transaction j to obtain the values of hash e to hash j, performs adjacent hash operations on hash e to hash j again to obtain hash ef, hash gh and hash ij, and when performing the hash operation again, copies the value of hash ij (for example, hash ji in the dotted box) to obtain hash efgh and hash ijij, performs a hash operation on hash efgh and hash ijij again to obtain hash efghijij, and obtains the transaction tree of cross-chain transaction e to cross-chain transaction j, thereby obtaining the first Merkle tree and the first tree root value of cross-chain transaction e to cross-chain transaction j. The relay chain further performs a hash operation based on hash abcdabcd and hash efghijij to obtain the second Merkle tree and the second tree root value hash abcdabcdefghijij. Among them, the cross-chain transaction groups are cross-chain transactions a to cross-chain transactions d, cross-chain transactions e to cross-chain transactions j; the transaction hash lists are hash a to hash d, hash e to hash j; the first tree root values are hash abcdabcd and hash efghijij.
[0073] It is understandable that the above structure of the relay chain constructing the transaction tree is only an example. If there are similar concepts or structures, they also fall within the protection scope of the embodiments of the present application.
[0074] Step S203: Submit the transaction data to the cross-chain gateway so that the cross-chain gateway can verify the transaction data and then synchronize the cross-chain transaction content in the transaction data to the target blockchain.
[0075] In some embodiments, the relay chain no longer synchronizes all cross-chain transactions to the cross-chain gateway, but only submits transaction data related to the target blockchain connected to the cross-chain gateway to the cross-chain gateway. Moreover, based on the block information in a preset format constructed by the relay chain, the transaction data corresponding to the target blockchain is sent to the cross-chain gateway.
[0076] The transaction data includes the first tree root value set L2Roots, the second tree root value L1Root, the target transaction hash list TransactionsHashes corresponding to the target blockchain, and the cross-chain transaction content Transactions; for example, if the target blockchain is Figure 3The target blockchain A in the target hash list TransactionsHashes includes hash a, hash b, hash c and hash d. Among them, the cross-chain transaction content Transactions corresponds to the target transaction hash list TransactionsHashes one by one. The cross-chain transaction content of each cross-chain transaction corresponds to a transaction hash value in the transaction hash list, that is, the specific content of cross-chain transaction a corresponds to hash a.
[0077] In some embodiments, submitting transaction data to the cross-chain gateway so that the cross-chain gateway can verify the transaction data and then synchronize the cross-chain transaction content in the transaction data to the target blockchain includes:
[0078] Submit the target transaction hash list, the first tree root value set, the second tree root value and the cross-chain transaction content corresponding to the target blockchain in the transaction hash list to the cross-chain gateway, so that the cross-chain gateway can synchronize the cross-chain transaction content to the target blockchain after verifying the cross-chain transaction content based on the target transaction hash list, the first tree root value set and the second tree root value.
[0079] In some embodiments, after the relay chain submits the transaction data to the cross-chain gateway, the cross-chain gateway does not directly submit it to the target blockchain for execution, but verifies the validity of the received transaction data based on the first tree root value set L2Roots, the second tree root value L1Root, and the target transaction hash list TransactionsHashes corresponding to the target blockchain. After proving that the cross-chain transaction content in the transaction data does come from the relay chain, the cross-chain transaction content is synchronized to the target blockchain.
[0080] It should be noted that when the relay chain and the cross-chain gateway maintain a long-term communication connection, when the relay chain submits transaction data to the cross-chain gateway, the relay chain can actively send transaction data to the cross-chain gateway at a regular interval, or the cross-chain gateway can periodically send query requests to the relay chain to request transaction data; the specific triggering method is not limited.
[0081] Through the embodiments of the present application, the relay chain constructs a transaction tree with a preset structure for the received transaction, and only needs to provide the cross-chain gateway with transaction data such as the cross-chain transaction and related information corresponding to the target blockchain, so that the cross-chain gateway can verify according to the transaction data to prove that the cross-chain transaction content comes from the relay chain. After the verification is passed, the cross-chain gateway sends the cross-chain transaction content to the target blockchain for reference by the target blockchain to perform corresponding operations; on the one hand, it protects the privacy information of cross-chain transactions of other source blockchains on the relay chain, and on the other hand, it reduces the load of the cross-chain gateway synchronizing transaction data from the relay chain, reduces the bandwidth occupancy level storage pressure of network transmission, and improves the response speed and processing efficiency of the system.
[0082] See also Figure 6, is a flow chart of a data synchronization method for cross-chain transactions provided by another embodiment of the present application. The method is applied to a cross-chain gateway connected to a target blockchain, and the execution subject is as follows Figure 1 The cross-chain gateway shown in . The method comprises the following steps:
[0083] Step S601, obtain the transaction data of the target blockchain corresponding to the cross-chain gateway in the block information submitted by the relay chain; the block information is the address information of the target blockchain based on the relay chain, and the cross-chain transaction sent by the source blockchain is constructed according to the preset structure.
[0084] In some embodiments, the relay chain groups the addresses of the destination blockchains in the cross-chain transactions to obtain a cross-chain transaction group; performs a hash operation on each cross-chain transaction to obtain a transaction hash list corresponding to the cross-chain transaction group, and constructs a transaction tree of the transaction hash list according to a preset structure to obtain block information.
[0085] Among them, the specific construction process of the relay chain has been explained in the above-mentioned embodiment with the relay chain as the execution body, and will not be repeated here.
[0086] In some embodiments, obtaining block information submitted by the relay chain includes:
[0087] Obtain a target transaction hash list, a first tree root value set, a second tree root value, and cross-chain transaction content corresponding to the target blockchain in the transaction hash list submitted by the relay chain.
[0088] In some embodiments, the block information includes a block header and a block body; the block body includes a transaction hash list, a first Merkle tree, a first tree root value set, a second Merkle tree, and a second tree root value, and the block header includes the second tree root value.
[0089] Among them, the transaction hash list is obtained by the relay chain performing hash operations on each cross-chain transaction in the cross-chain transaction group, and the cross-chain transaction group is obtained by the relay chain classifying cross-chain transactions according to address information; the first tree root value set is obtained by the relay chain constructing the first Merkel tree for all transaction hash lists according to the structure of the Merkel tree; the second tree root value is obtained by the relay chain constructing the second Merkel tree based on the first tree root value set.
[0090] It can be understood that the above-mentioned embodiment using the relay chain as the execution body is based on the same implementation principle and will not be described in detail here.
[0091] Step S602, verifying the transaction data.
[0092] In some embodiments, after receiving the above transaction data, the cross-chain gateway will not directly submit it to the target blockchain for execution, but needs to verify the transaction data. Based on the data of the preset structure constructed by the relay chain, the cross-chain gateway performs corresponding verification.
[0093] In some embodiments, transaction data is verified, including: based on the first root value set, constructing a third Merkle tree to obtain a third root value; if the third root value is the same as the second root value, verifying the target transaction hash list; constructing a fourth Merkle tree of the target transaction hash list to obtain a fourth root value; if the fourth root value exists in the first root value set, verifying the cross-chain transaction content; performing a hash operation on the cross-chain transaction content to obtain hash values of all cross-chain transactions in the cross-chain transaction content; if the hash values of all cross-chain transactions are in the target transaction hash list, the verification is successful.
[0094] In some embodiments, the cross-chain gateway constructs the received first root value set L2Roots into a third Merkle tree to obtain a third root value L3Root; compares the third root value L3Root with the second root value L1Root obtained from the block header of the relay chain. If they are consistent, proceed to the next step of verification; if they are inconsistent, the verification fails.
[0095] In some embodiments, if L3Root=L1Root, the cross-chain gateway constructs a fourth Merkle tree with the received target transaction hash list TransactionsHashes to obtain a fourth tree root value L4Root; determines whether the fourth tree root value L4Root is in the received first tree root value set L2Roots. If so, the verification passes; if not, the verification fails.
[0096] In some embodiments, if L4Root is in the first tree root value set L2Roots, the cross-chain gateway will locally calculate a hash for all cross-chain transactions in the received cross-chain transaction content Transactions to obtain the hash values of all cross-chain transactions; determine whether the hash values of all cross-chain transactions are all in the received target transaction hash list TransactionsHashes. If so, the verification is successful; otherwise, the verification fails.
[0097] Step S603: If the verification is successful, the cross-chain transaction content in the transaction data is synchronized to the target blockchain.
[0098] In some embodiments, if the cross-chain gateway verifies the transaction data, the cross-chain transaction content in the transaction data is submitted to the target blockchain. For example, the specific content of cross-chain transactions a to cross-chain transactions d is synchronized to the corresponding target blockchain A.
[0099] Through the embodiments of the present application, the cross-chain gateway only synchronizes transaction data such as cross-chain transactions and related information corresponding to the target blockchain from the relay chain, and verifies the transaction data to prove that the cross-chain transaction content comes from the relay chain. After the verification is passed, the cross-chain transaction content is sent to the target blockchain for reference by the target blockchain to perform corresponding operations. On the one hand, the privacy information of cross-chain transactions of other source blockchains on the relay chain is protected, and on the other hand, the load of synchronizing transaction data of the cross-chain gateway from the relay chain is reduced, the bandwidth occupancy level storage pressure of network transmission is reduced, the response speed and processing efficiency of the system are improved, and the operation and maintenance costs and machine costs of the cross-chain gateway are reduced.
[0100] See also Figure 7 , is a schematic diagram of the interactive process of data synchronization provided by an embodiment of the present application. In the interactive process of this embodiment, the implementation principle of each step is the same as Figure 2 ,and Figure 6 The implementation processes described separately are the same and will not be repeated here. Figure 7 As shown, the interaction process includes the following steps:
[0101] 1. The relay chain obtains the cross-chain transaction sent by the source blockchain;
[0102] 2. According to the address information of the destination chain in the cross-chain transaction, the relay chain constructs the cross-chain transaction into block information of a preset structure;
[0103] 3. The relay chain submits the transaction data of the target blockchain corresponding to the cross-chain gateway in the block information to the cross-chain gateway;
[0104] 4. The cross-chain gateway verifies the transaction data;
[0105] 5. If the verification is successful, the cross-chain gateway will synchronize the cross-chain transaction content in the transaction data to the target blockchain.
[0106] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0107] Through the embodiments of the present application, the relay chain constructs a transaction tree with a preset structure for the received transaction, and only needs to provide the cross-chain gateway with transaction data such as the cross-chain transaction and related information corresponding to the target blockchain, so that the cross-chain gateway can verify according to the transaction data to prove that the cross-chain transaction content comes from the relay chain. After the verification is passed, the cross-chain gateway sends the cross-chain transaction content to the target blockchain for reference by the target blockchain to perform corresponding operations; on the one hand, it protects the privacy information of cross-chain transactions of other source blockchains on the relay chain, and on the other hand, it reduces the load of the cross-chain gateway synchronizing transaction data from the relay chain, reduces the bandwidth occupancy level storage pressure of network transmission, improves the response speed and processing efficiency of the system, and at the same time reduces the operation and maintenance cost and machine cost of the cross-chain gateway.
[0108] Corresponding to the data synchronization method for cross-chain transactions described in the above embodiment, Figure 8 A structural block diagram of a data synchronization device for cross-chain transactions provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0109] Reference Figure 8 , the device comprises:
[0110] An acquisition unit 81 is used to acquire a cross-chain transaction sent by a source blockchain, wherein the cross-chain transaction includes address information of a destination blockchain;
[0111] A processing unit 82 is used to construct the cross-chain transaction into block information of a preset structure according to the address information, wherein the block information includes transaction data of a target blockchain corresponding to the cross-chain gateway;
[0112] The sending unit 83 is used to submit the transaction data to the cross-chain gateway, so that the cross-chain gateway can synchronize the cross-chain transaction content in the transaction data to the target blockchain after verifying the transaction data.
[0113] Corresponding to the data synchronization method for cross-chain transactions described in the above embodiment, Fig. 9 A structural block diagram of a data synchronization device for cross-chain transactions provided in another embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0114] Reference Fig. 9 , the device comprises:
[0115] The acquisition unit 91 is used to obtain the transaction data of the target blockchain corresponding to the cross-chain gateway in the block information submitted by the relay chain; the block information is obtained by the relay chain constructing the cross-chain transaction sent by the source blockchain according to the preset structure based on the address information of the target blockchain;
[0116] A verification unit 92, used to verify the transaction data;
[0117] The synchronization unit 93 is used to synchronize the cross-chain transaction content in the transaction data to the target blockchain if the verification is passed.
[0118] Corresponding to the data synchronization method for cross-chain transactions described in the above embodiment, Fig.10 A structural block diagram of a data synchronization system for cross-chain transactions provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0119] like Fig.10 As shown, the data synchronization system for cross-chain transactions includes: a relay chain and one or more cross-chain gateways, the relay chain is communicatively connected to the one or more cross-chain gateways, and the cross-chain gateway is communicatively connected to the target blockchain.
[0120] Among them, the relay chain 101 is used to execute the data synchronization method of the cross-chain transaction as described in steps S201 to S203; the cross-chain gateway 102 is used to execute the data synchronization method of the cross-chain transaction as described in steps S601 to S603.
[0121] Through the embodiments of the present application, the relay chain constructs a transaction tree with a preset structure for the received transaction, and only needs to provide the cross-chain gateway with transaction data such as the cross-chain transaction and related information corresponding to the target blockchain, so that the cross-chain gateway can verify according to the transaction data to prove that the cross-chain transaction content comes from the relay chain. After the verification is passed, the cross-chain gateway sends the cross-chain transaction content to the target blockchain for reference by the target blockchain to perform corresponding operations; on the one hand, it protects the privacy information of cross-chain transactions of other source blockchains on the relay chain, and on the other hand, it reduces the load of the cross-chain gateway synchronizing transaction data from the relay chain, reduces the bandwidth occupancy level storage pressure of network transmission, improves the response speed and processing efficiency of the system, and at the same time reduces the operation and maintenance cost and machine cost of the cross-chain gateway.
[0122] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0123] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0124] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0125] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0126] Fig.11 This is a schematic diagram of the structure of a terminal device 11 provided in an embodiment of the present application. Fig.11 As shown, the terminal device 11 of this embodiment includes: at least one processor 110 ( Fig.11 Only one is shown in the figure) a processor, a memory 111, and a computer program 112 stored in the memory 111 and executable on the at least one processor 110, and when the processor 110 executes the computer program 112, the steps in the above-mentioned embodiments of data synchronization of any of the cross-chain transactions are implemented.
[0127] The terminal device 11 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device 11 may include, but is not limited to, a processor 110 and a memory 111. Those skilled in the art will appreciate that Fig.11 It is only an example of the terminal device 11 and does not constitute a limitation on the terminal device 11. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0128] The processor 110 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (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 any conventional processor, etc.
[0129] In some embodiments, the memory 111 may be an internal storage unit of the terminal device 11, such as a hard disk or memory of the terminal device 11. In other embodiments, the memory 111 may also be an external storage device of the terminal device 11, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 11. Further, the memory 111 may also include both an internal storage unit of the terminal device 11 and an external storage device. The memory 111 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 111 may also be used to temporarily store data that has been output or is to be output.
[0130] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0131] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0132] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0133] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0134] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0135] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A data synchronization method for cross-chain transactions, characterized in that: Applied to the relay chain, the method includes: Obtain a cross-chain transaction sent by a source blockchain, wherein the cross-chain transaction includes address information of a destination blockchain; According to the address information, construct the cross-chain transaction into block information of a preset structure, wherein the block information includes transaction data of the target blockchain corresponding to the cross-chain gateway; Submit the transaction data to the cross-chain gateway, so that the cross-chain gateway can synchronize the cross-chain transaction content in the transaction data to the target blockchain after verifying the transaction data; The step of constructing the cross-chain transaction into block information of a preset structure according to the address information includes: According to the address information in the cross-chain transaction, the cross-chain transactions are grouped to obtain cross-chain transaction groups corresponding to different destination blockchains; The cross-chain transaction groups corresponding to different purpose blockchains are generated according to the structure of the Merkle tree to generate the block information.
2. The method according to claim 1, characterized in that The step of constructing the cross-chain transaction into block information of a preset structure according to the address information includes: Performing a hash operation on each cross-chain transaction in the cross-chain transaction group to obtain a transaction hash list corresponding to the cross-chain transaction group; According to the structure of the Merkle tree, construct a first Merkle tree for each of the transaction hash lists, and obtain a first tree root value corresponding to each of the transaction hash lists and a set of first tree root values corresponding to all the transaction hash lists; Constructing a second Merkle tree of the first root value set to obtain a second root value; The second root value is recorded in the block header of the block information, and the transaction hash list, all the first Merkel trees, the first root value set, the second Merkel tree and the second root value are recorded in the block body of the block information.
3. The method according to claim 2, characterized in that Submitting the transaction data to the cross-chain gateway so that the cross-chain gateway can synchronize the cross-chain transaction content in the transaction data to the target blockchain after verifying the transaction data, includes: Submit the target transaction hash list corresponding to the target blockchain in the transaction hash list, the first root value set, the second root value and the cross-chain transaction content to the cross-chain gateway, so that the cross-chain gateway can synchronize the cross-chain transaction content to the target blockchain after verifying the cross-chain transaction content based on the target transaction hash list, the first root value set and the second root value.
4. A data synchronization method for cross-chain transactions, characterized in that: Applied to a cross-chain gateway, the method includes: Obtaining the transaction data of the target blockchain corresponding to the cross-chain gateway in the block information submitted by the relay chain; the block information is obtained by the relay chain constructing the cross-chain transaction sent by the source blockchain according to the preset structure based on the address information of the target blockchain; Verifying the transaction data; If the verification is successful, the cross-chain transaction content in the transaction data is synchronized to the target blockchain; Among them, the cross-chain transactions sent by the source blockchain are constructed according to a preset structure, including: grouping the cross-chain transactions according to the address information in the cross-chain transactions to obtain cross-chain transaction groups corresponding to different destination blockchains; and generating the block information according to the structure of the Merkle tree for the cross-chain transaction groups corresponding to different destination blockchains.
5. The method according to claim 4, characterized in that The block information includes a block header and a block body; the block body includes a transaction hash list, a first Merkle tree, a first tree root value set, a second Merkle tree, and a second tree root value, and the block header includes the second tree root value; Among them, the transaction hash list is obtained by the relay chain performing hash operations on each cross-chain transaction in the cross-chain transaction group, and the cross-chain transaction group is obtained by the relay chain classifying the cross-chain transactions according to the address information; the first tree root value set is obtained by the relay chain constructing a first Merkel tree for all the transaction hash lists according to the structure of the Merkel tree; the second tree root value is obtained by the relay chain constructing a second Merkel tree based on the first tree root value set.
6. The method according to claim 5, characterized in that The verifying the transaction data includes: Based on the first set of tree root values, construct a third Merkle tree to obtain a third tree root value; If the third tree root value is the same as the second tree root value, verifying the target transaction hash list, where the target hash list is a transaction hash list corresponding to the target blockchain; Constructing a fourth Merkle tree of the target transaction hash list to obtain a fourth tree root value; If the fourth tree root value exists in the first tree root value set, verifying the cross-chain transaction content; Performing a hash operation on the cross-chain transaction content to obtain hash values of all cross-chain transactions in the cross-chain transaction content; If the hash values of all the cross-chain transactions are in the target transaction hash list, the verification is successful.
7. A data synchronization device for cross-chain transactions, characterized in that: include: An acquisition unit, used to acquire transaction data of a target blockchain corresponding to the cross-chain gateway in the block information submitted by the relay chain; The block information is obtained by the relay chain constructing the cross-chain transaction sent by the source blockchain according to a preset structure based on the address information of the destination blockchain; A verification unit, used to verify the transaction data; A synchronization unit, configured to synchronize the cross-chain transaction content in the transaction data to the target blockchain if the verification is successful; Among them, the cross-chain transactions sent by the source blockchain are constructed according to a preset structure, including: grouping the cross-chain transactions according to the address information in the cross-chain transactions to obtain cross-chain transaction groups corresponding to different destination blockchains; and generating the block information according to the structure of the Merkle tree for the cross-chain transaction groups corresponding to different destination blockchains.
8. A data synchronization system for cross-chain transactions, characterized in that: include: A relay chain and one or more cross-chain gateways, wherein the relay chain is communicatively connected to the one or more cross-chain gateways; The relay chain is used to execute the data synchronization method for cross-chain transactions according to any one of claims 1 to 3; The cross-chain gateway is used to execute the data synchronization method for cross-chain transactions as described in any one of claims 4 to 6.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 3 or claims 4 to 6 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 3 or claims 4 to 6 is implemented.
Citation Information
Patent Citations
Cross-chain method and system for blockchain transaction, equipment and storage medium
CN110751475A
IPFS-based blockchain cross-chain relay method
CN111107136A