Cross-chain asset transfer method, computer device and storage medium

By maintaining the relay tree on the relay chain and using zero-knowledge proof circuit verification, the security and data redundancy issues in the blockchain cross-chain solution are solved, and efficient and safe cross-chains between multiple blockchains are achieved. Asset transfer.

CN114386967BActive Publication Date: 2024-10-29HANGZHOU FUZAMEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210001708.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-04
Publication Date
2024-10-29
Estimated Expiration
2042-01-04

AI Technical Summary

Technical Problem

Existing blockchain cross-chain solutions have problems in terms of security and data redundancy. In particular, relay solutions have security risks when the amount of block header data is huge, and the administrator terminal needs to synchronize or monitor multiple cross-chain asset trees. , resulting in high load and risk of errors.

Method used

By maintaining the relay tree on the relay chain, cross-chain asset transfers between multiple blockchains can be achieved by simply synchronizing or monitoring the tree roots on the relay chain, and using zero-knowledge proof circuits to verify asset certificate hashes. and tree roots to ensure the security and accuracy of asset transfers.

Benefits of technology

It reduces the load on the administrator terminal, reduces data redundancy, improves the security and efficiency of cross-chain asset transfer, and avoids asset transfer failures due to incorrect synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114386967B_ABST
    Figure CN114386967B_ABST
Patent Text Reader

Abstract

The present invention provides a cross-chain asset transfer method, computer equipment and storage medium, the method comprising: executing a first asset cross-chain transaction, depositing the first asset to be transferred to the second blockchain into the first asset cross-chain contract of the current blockchain, and using the first evidence hash of the first asset as a newly added leaf node to update the first cross-chain asset tree. Among them, the first tree root of the updated first cross-chain asset tree is submitted to the relay chain by the relay service end as a newly added leaf node of the relay tree; the second tree root of the updated relay tree is used to submit to the second asset cross-chain contract of the second blockchain in a credible or falsifiable manner; the first tree root, the first evidence hash, the first path corresponding to the first evidence hash, the second tree root, and the second path are used as inputs of the proof algorithm of the zero-knowledge proof circuit. The present invention realizes that the administrator terminal only needs to synchronize or monitor one tree root to realize cross-chain asset transfer between multiple blockchains.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and specifically to a cross-chain asset transfer method, computer equipment, and storage medium. Background Art

[0002] Existing blockchain cross-chain solutions can be roughly divided into side chains, relays, notary mechanisms, hash locks, etc. Each category of solutions has its own security risks. Once a hacker hijacks, it often causes the user's assets to suffer losses.

[0003] For relay solutions, one of the current methods to solve the above security risk problem is to synchronize all block headers of the endorsement chain to the target chain, so that the target chain can be verified based on the block header. The disadvantage of this method is that the amount of block header data is too large for blockchains with a large number of blocks. For example, the current amount of all block header data of Ethereum has reached 4.5G.

[0004] In response to the above problems, the applicant proposed three different solutions to the above problems in application No. CN202110884008.7, application No. CN202110881826.3, and application No. CN202110881827.8 (the latter two solutions also further solved the problem of saving the handling fees incurred by relaying).

[0005] In the above three solutions, if two blockchains want to realize cross-chain assets, they must each maintain a cross-chain asset tree in the cross-chain contract. For example, if blockchain A and blockchain B want to realize cross-chain assets, the cross-chain contract of blockchain A needs to maintain a cross-chain asset tree Tree. AB At the same time, a cross-chain asset tree Tree needs to be maintained in the cross-chain contract of blockchain B BA ; and this leads to a problem:

[0006] When the number of blockchains increases, cross-chain contracts need to maintain multiple cross-chain asset trees at the same time. For example, if cross-chain assets are to be realized between 100 blockchains, 99 cross-chain asset trees must be maintained in the cross-chain contract of each blockchain. On the one hand, it causes data redundancy, and on the other hand, it causes inconvenience to the relay as the administrator terminal to query the tree root.

[0007] In response to the above-mentioned problem of needing to maintain multiple cross-chain asset trees, the applicant proposed a solution suitable for a single asset in application No. CN202111289558.2. For example, if only cross-chain digital RMB is needed between 100 blockchains, the above-mentioned problem can be solved by this solution.

[0008] The applicant also proposed a solution applicable to multiple assets in another application filed at the same time as the present application.

[0009] However, whether it is the solution of application No. CN202111289558.2 or the solution of the other application mentioned above, there is a problem that the administrator terminal needs to synchronize or monitor the root of the cross-chain asset tree of each blockchain.

[0010] For example, if user A transfers assets from blockchain A to blockchain C, the administrator terminal needs to synchronize or monitor the root of the cross-chain asset tree of blockchain A; if user B transfers assets from blockchain D to blockchain B, the administrator terminal needs to synchronize or monitor the root of the cross-chain asset tree of blockchain D; and so on. That is, the administrator terminal needs to accurately synchronize or monitor the root of the cross-chain asset tree of each blockchain with high load and without errors. Once the root of the cross-chain asset tree of blockchain B is synchronized or monitored incorrectly when the root of the cross-chain asset tree of blockchain A needs to be synchronized or monitored, the asset transfer will fail. Summary of the invention

[0011] In view of the above-mentioned defects or deficiencies in the prior art, it is desired to provide a cross-chain asset transfer method, computer device and storage medium in which an administrator terminal only needs to synchronize or monitor the root of a tree of a blockchain to realize cross-chain asset transfer between multiple blockchains.

[0012] In a first aspect, the present invention provides a cross-chain asset transfer method, wherein multiple blockchains are respectively configured with asset cross-chain contracts for transferring assets to each other, and the asset cross-chain contract maintains a cross-chain asset tree, and the leaf nodes of the cross-chain asset tree include the evidence hash of each asset to be transferred from the current blockchain to each first blockchain other than the current blockchain among the multiple blockchains;

[0013] The asset cross-chain contract is also configured with a zero-knowledge proof circuit for verifying whether the asset to be transferred to the current blockchain has been stored in the asset cross-chain contract of the blockchain before the transfer;

[0014] The relay chain is configured with a relay contract for aggregating the roots of each cross-chain asset tree of multiple blockchains. The relay contract maintains a relay tree, and the leaf nodes of the relay tree include the roots of each cross-chain asset tree of multiple blockchains.

[0015] The method is applicable to a blockchain node of any blockchain among multiple blockchains, and the method includes:

[0016] Execute the first asset cross-chain transaction, deposit the first asset to be transferred to the second blockchain into the first asset cross-chain contract of the current blockchain, and use the first deposit hash of the first asset as a new leaf node of the first cross-chain asset tree of the first asset cross-chain contract to update the first cross-chain asset tree.

[0017] The first root of the updated first cross-chain asset tree is submitted by the relay server to the relay chain as a newly added leaf node of the relay tree to update the relay tree;

[0018] The second tree root of the updated relay tree is used to submit the second asset cross-chain contract to the second blockchain in a credible or falsifiable manner, so as to be used as one of the public inputs of the verification algorithm of the zero-knowledge proof circuit;

[0019] The first tree root, the first evidence hash, the first path corresponding to the first evidence hash, the second tree root, and the second path from the first tree root to the second tree root are used as inputs of a proof algorithm of a zero-knowledge proof circuit to generate first proof information;

[0020] The first proof information is used to be packaged together with the corresponding public inputs to generate a second asset cross-chain transaction and sent to the second blockchain for verification by the second asset cross-chain contract through a verification algorithm.

[0021] In a second aspect, the present invention also provides a computer device comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors so that the one or more processors execute the cross-chain asset transfer method provided according to various embodiments of the present invention.

[0022] In a third aspect, the present invention further provides a storage medium storing a computer program, which enables a computer to execute the cross-chain asset transfer method provided according to various embodiments of the present invention.

[0023] The cross-chain asset transfer method, computer device and storage medium provided by many embodiments of the present invention configure a relay contract on a certain blockchain, maintain a relay tree in the relay contract, and the relay server submits the root of each cross-chain asset tree of each blockchain to the relay chain as a new leaf node of the relay tree, and adds verification between the root of the cross-chain asset tree and the root of the relay tree in the zero-knowledge proof circuit, so that the administrator terminal only needs to synchronize or monitor the root of the relay tree on the relay chain to realize cross-chain asset transfer between multiple blockchains. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0025] Figure 1 A flowchart of a cross-chain asset transfer method provided by one embodiment of the present invention.

[0026] Figure 2 FIG. 1 is a schematic diagram of a relay tree in an embodiment of the present invention.

[0027] Figure 3This is a schematic diagram of a cross-chain asset tree in a preferred embodiment of the present invention.

[0028] Figure 4 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0029] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.

[0030] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0031] Figure 1 A flowchart of a cross-chain asset transfer method provided by one embodiment of the present invention.

[0032] like Figure 1 As shown, in this embodiment, the present invention provides a cross-chain asset transfer method, wherein multiple blockchains are respectively configured with asset cross-chain contracts for transferring assets to each other, and the asset cross-chain contract maintains a cross-chain asset tree, and the leaf nodes of the cross-chain asset tree include the evidence hash of each asset to be transferred from the current blockchain to each first blockchain other than the current blockchain among the multiple blockchains;

[0033] The asset cross-chain contract is also configured with a zero-knowledge proof circuit for verifying whether the asset to be transferred to the current blockchain has been stored in the asset cross-chain contract of the blockchain before the transfer;

[0034] The relay chain is configured with a relay contract for aggregating the roots of each cross-chain asset tree of multiple blockchains. The relay contract maintains a relay tree, and the leaf nodes of the relay tree include the roots of each cross-chain asset tree of multiple blockchains.

[0035] The method is applicable to a blockchain node of any blockchain among multiple blockchains, and the method includes:

[0036] S11: Execute the first asset cross-chain transaction, deposit the first asset to be transferred to the second blockchain into the first asset cross-chain contract of the current blockchain, and use the first deposited hash of the first asset as a new leaf node of the first cross-chain asset tree of the first asset cross-chain contract to update the first cross-chain asset tree.

[0037] The first root of the updated first cross-chain asset tree is submitted by the relay server to the relay chain as a newly added leaf node of the relay tree to update the relay tree;

[0038] The second tree root of the updated relay tree is used to submit the second asset cross-chain contract to the second blockchain in a credible or falsifiable manner, so as to be used as one of the public inputs of the verification algorithm of the zero-knowledge proof circuit;

[0039] The first tree root, the first evidence hash, the first path corresponding to the first evidence hash, the second tree root, and the second path from the first tree root to the second tree root are used as inputs of a proof algorithm of a zero-knowledge proof circuit to generate first proof information;

[0040] The first proof information is used to be packaged together with the corresponding public inputs to generate a second asset cross-chain transaction and sent to the second blockchain for verification by the second asset cross-chain contract through a verification algorithm.

[0041] The following are multiple examples of Figure 1 The method shown is explained by way of example.

[0042] In the first to third embodiments, each blockchain supports the transfer of a single asset to each other.

[0043] The asset cross-chain contract is also configured with a slot allocation rule for allocating slots in the first cross-chain asset tree to each first blockchain in multiple blockchains except the current blockchain; the asset cross-chain contract is also configured to verify whether the evidence hash is located in the correct slot according to the slot allocation rule to confirm that the asset is to be transferred to the current blockchain rather than other blockchains (the specific process of allocating slots and verifying the slot part of the evidence hash can be found in application No. CN202111289558.2, and the improvements made in this application will be highlighted below).

[0044] Take the example of blockchain AN supporting the mutual transfer of digital RMB:

[0045] In the first embodiment, the principle of verification by the zero-knowledge proof circuit includes at least:

[0046] The administrator terminal stores the second tree root in the second asset cross-chain contract to prove that the second tree root is the root of the relay tree recorded on the relay chain;

[0047] Whether the second root can be generated by the administrator terminal based on the first root and the second path from the first root to the second root: if yes, it proves that the first root is recorded on the relay tree, that is, the first root is the root of the cross-chain asset tree;

[0048] Whether the first tree root can be generated according to the first evidence hash and the first path corresponding to the first evidence hash: if yes, it proves that the first evidence hash is recorded in the first cross-chain asset tree;

[0049] The first address for paying the first asset and the corresponding private key are used as the private input of the proof algorithm, so that the verification algorithm can be used to verify whether the user who provides the proof information deposits the first asset into the user of the first asset cross-chain contract.

[0050] In the first embodiment, the zero-knowledge proof circuit is generated according to the above verification principle. Those skilled in the art can understand how to generate a zero-knowledge proof circuit according to the above verification principle in a zero-knowledge proof system, and the generated zero-knowledge proof circuit includes at least a proof algorithm Prove1() and a verification algorithm Verify1(), and may also include a generation algorithm Setup1(). The specific process will not be repeated here.

[0051] Take user A transferring 100 digital RMB from blockchain A to blockchain B as an example:

[0052] When user A wants to transfer 100 digital RMB on blockchain A to blockchain B, user A's user terminal packages and generates the first asset cross-chain transaction tx1 and sends it to the blockchain network of blockchain A.

[0053] In step S11, the node of blockchain A receives, broadcasts, packages, and executes tx1 through the asset cross-chain contract:

[0054] According to the cross-chain asset request of tx1, 100 digital RMB in User A's account is deposited into the contract address of the cross-chain asset contract;

[0055] After the deposit is successful, search for the free slot belonging to blockchain B in the first cross-chain asset tree of the asset cross-chain contract;

[0056] Generate the first proof hash of the asset based on the asset amount 100 and user A’s public key P1 i , and hash i As the leaf node of the found free slot, update the first cross-chain asset tree.

[0057] After the relay server detects the update of the cross-chain asset tree of blockchain A, it obtains the first tree root root1 of the updated first cross-chain asset tree and submits it to the relay chain by sending a transaction.

[0058] Figure 2 FIG. 1 is a schematic diagram of a relay tree in one embodiment of the present invention. Figure 2 As shown, the relay chain is a Merkle tree generated with the root of the cross-chain asset tree of each blockchain as the leaf node. Those skilled in the art should understand that Figure 2 The intermediate nodes between the leaf nodes and the root node are omitted, but this does not mean that there are no intermediate nodes.

[0059] The nodes of the relay chain execute the transaction sent by the relay server, take the first tree root root1 as the new leaf node of the relay tree, and update the relay tree.

[0060] After the administrator terminal detects the update of the relay tree, it obtains the second tree root root2 of the updated relay tree and submits it to blockchain B (and other blockchains) by sending a transaction.

[0061] The node of blockchain B executes the transaction through the asset cross-chain contract and stores the second tree root root2 in the asset cross-chain contract.

[0062] User A's client uses the second root root2, the first root root1, and the first stored hash hash. i , ... and other information are used as the public input of the proof algorithm Prove1() of the zero-knowledge proof circuit, and the first address addr1 to pay the asset, the first private key p1 corresponding to the first address addr1, the first path path1, and the second path path2 are used as the private input of the proof algorithm Prove1() to generate the first proof information:

[0063] Prove1(root2, root1, hash i ,...,addr1,p1,path1,path2)→prove1;

[0064] as well as,

[0065] The package generation includes the above public input root2, root1, hash i , …and the second asset cross-chain transaction tx2 with the first proof information prove1, and sending tx2 to the network of blockchain B.

[0066] The node of blockchain B executes tx2 through the asset cross-chain contract and performs the following verifications:

[0067] Verify whether the second tree root root2 submitted by tx2 has been stored in the asset cross-chain contract: If not, tx2 execution fails;

[0068] Verify the first proof hash submitted by tx2 i Is it not used? If not, tx2 execution fails.

[0069] Verify that the slot complies with the slot allocation rules according to the slot allocation rules;

[0070] Submit root2, root1, hash of tx2 i , …, prove1 inputs the verification algorithm Verify1() of the zero-knowledge proof circuit for verification:

[0071] Verify1(root2, root1, hash i ,…,prove1)→Yes / No;

[0072] When the output result of the verification algorithm Verify1() is No, the verification fails and tx2 execution fails;

[0073] If all the above verifications are passed, tx2 is executed successfully, 100 digital RMB is issued to user A’s account on blockchain B, and the first evidence hash is hashed. i Deposit into the verification pool (for subsequent execution of other second asset cross-chain transactions to verify the hash i has already been used).

[0074] In the second embodiment, the second tree root is submitted to the second blockchain by the user end of the first user who signed and generated the first asset cross-chain transaction;

[0075] The second asset cross-chain contract is further configured to freeze the first mapped asset anchored to the first asset issued to the first user within the first challenge period;

[0076] The administrator terminal is configured to monitor and verify whether the second tree root is recorded in the relay tree within the first challenge period: if not, a first challenge transaction is generated and sent to the network of the second blockchain, so that the nodes of the second blockchain can execute through the second asset cross-chain contract to withdraw or destroy the first mapped asset.

[0077] The difference between the second embodiment and the first embodiment is that:

[0078] The administrator terminal monitors whether the second tree root submitted by the user is authentic, rather than storing the second tree root by the administrator terminal;

[0079] The second asset cross-chain contract does not need to verify whether the second tree root submitted by the user has been stored in the contract. Instead, it freezes the first mapped assets within the first challenge period and withdraws or destroys the first mapped assets illegally obtained by the user based on the challenge initiated by the administrator.

[0080] The specific process of the second embodiment will not be described in detail.

[0081] In a third embodiment, the administrator terminal is configured to obtain a second tree root after monitoring a relay tree update, sign the second tree root to generate first signature information, and disclose the first signature information and the corresponding first elliptic curve random number off-chain;

[0082] The private input of the first proof information generated by the proof algorithm includes the first signature information and the first elliptic curve random number;

[0083] The generation algorithm of the first signature information is:

[0084] s=r+p*root;

[0085] The principle of the verification algorithm to verify the first signature information is:

[0086] s*G=(r+p*root)*G=r*G+(p*G)root=R+P*root;

[0087] Among them, s is the first signature information, r is the first random number, p is the administrator's private key, root is the second tree root, G is the elliptic curve base point, R is the first elliptic curve random number generated according to r, and P is the administrator's public key.

[0088] The third embodiment differs from the first and second embodiments in that:

[0089] The verification parameters generated by the administrator's public key and the generation algorithm of the zero-knowledge proof circuit are deployed in advance in the asset cross-chain contract, so that the administrator terminal only needs to publish the second tree root signed by the private key and the corresponding elliptic curve random number off-chain, and the second tree root (signed by the administrator) submitted by the user can be verified according to the verification parameters through the verification algorithm of the zero-knowledge proof circuit in the second asset cross-chain contract.

[0090] The specific process of the third embodiment will not be described in detail.

[0091] In the fourth to sixth embodiments, each blockchain supports the transfer of multiple assets to each other.

[0092] The cross-chain asset tree is formed by aggregating the cross-chain multi-class asset trees corresponding to each first blockchain in multiple blockchains except the current blockchain;

[0093] The cross-chain multi-class asset tree is formed by aggregating the cross-chain single-class asset trees of several different asset types of the corresponding first blockchain;

[0094] The cross-chain single-class asset tree is a Merkle tree generated with the first identification hash as the first leaf node and the evidence hash of each asset of the first asset type to be transferred from the current blockchain to the corresponding first blockchain as the subsequent leaf nodes;

[0095] The first identification hash is generated according to the current blockchain name, the name of the corresponding first blockchain, and the first asset type;

[0096] The first identification hash is also registered in the corresponding asset cross-chain contract of the first blockchain.

[0097] Take blockchain AN as an example, which supports the transfer of account ownership of game a, game coins of game b, ownership of game props of game c, Q coins, digital RMB, and other digital assets.

[0098] In the fourth embodiment, the principle of verification by the zero-knowledge proof circuit includes:

[0099] The administrator terminal stores the second root of the relay tree in the second asset cross-chain contract to prove that the second root is the root of the relay tree recorded on the relay chain;

[0100] Whether the first tree root and the second path can generate a second tree root that is certified by the administrator terminal: if yes, it proves that the first tree root is recorded on the relay tree, that is, the first tree root is the root of the cross-chain asset tree;

[0101] According to the third root (of the updated cross-chain single-class asset tree), whether the third path from the third root to the first root can generate the first root: if yes, it proves that the third root really exists in the first cross-chain asset tree;

[0102] Whether the third tree root can be generated according to the identification hash registered in the second asset cross-chain contract and the fourth path from the identification hash to the third tree root: if yes, it proves that the third tree root corresponds to the second blockchain and the correct asset type;

[0103] Whether the third tree root can be generated based on the first evidence hash and the fifth path from the first evidence hash to the third tree root: if yes, it proves that the first evidence hash is stored in the first cross-chain asset tree and corresponds to the second blockchain and the correct asset type.

[0104] In the fourth embodiment, the zero-knowledge proof circuit is generated according to the above verification principle. Those skilled in the art can understand how to generate a zero-knowledge proof circuit according to the above verification principle in a zero-knowledge proof system, and the generated zero-knowledge proof circuit includes at least a proof algorithm Prove4() and a verification algorithm Verify4(), and may also include a generation algorithm Setup4(). The specific process will not be repeated here.

[0105] For example, user B wants to transfer 10,000 game coins of game B on blockchain N to blockchain B.

[0106] Figure 3 This is a schematic diagram of a cross-chain asset tree in a preferred embodiment of the present invention.

[0107] like Figure 3 As shown, in this embodiment, in the cross-chain asset tree maintained by the cross-chain asset contract of blockchain N, the cross-chain asset tree is aggregated by the cross-chain multi-class asset tree corresponding to blockchain A, the cross-chain multi-class asset tree corresponding to blockchain B, ..., and the cross-chain multi-class asset tree corresponding to blockchain M.

[0108] Among them, taking the cross-chain multi-class asset tree corresponding to blockchain B as an example, the cross-chain multi-class asset tree corresponding to blockchain B is composed of the cross-chain single-class asset tree corresponding to the ownership of the game a account of blockchain B, the cross-chain single-class asset tree corresponding to the game currency of game b of blockchain B,..., and the cross-chain single-class asset tree of the digital RMB corresponding to blockchain B.

[0109] Taking the cross-chain single-class asset tree of the game currency of game b corresponding to blockchain B as an example, the cross-chain single-class asset tree is a Merkle tree generated with the identification hash of the cross-chain single-class asset tree as the first leaf node and the asset type to be transferred from blockchain N to blockchain B, which is the evidence hash of each asset of the game currency of game b, as the subsequent leaf nodes.

[0110] Among them, the identification hash of the cross-chain single-class asset tree is generated according to the current blockchain N, the blockchain B to be transferred and the asset type (game currency of game b).

[0111] For example, hash id1 = hash(chain_N, chain_B, token_gameB, rand_num), where token_gameB is the game coin of game b, and rand_num is a random number.

[0112] The identifier hash id1 The administrator of the asset cross-chain contract registers it to the asset cross-chain contract of blockchain B for verification.

[0113] Those skilled in the art should understand that Figure 3 Due to space limitations, the intermediate nodes between the leaf nodes and the root node in each tree are omitted, but this does not mean that there are no intermediate nodes.

[0114] When user B wants to transfer 10,000 game coins of game B on blockchain N to blockchain B, user B's user terminal packages and generates the first asset cross-chain transaction tx3 and sends it to the blockchain network of blockchain N.

[0115] In step S11, the node of blockchain N executes tx3 through the asset cross-chain contract:

[0116] According to the cross-chain asset request of tx3, 10,000 game coins of game B in user B's account are deposited into the contract address of the cross-chain asset contract;

[0117] After the deposit is successful, the first proof hash of the asset is generated according to the target chain chain_B, asset type token_gameB, asset amount 10000 and user B's public key P2 j , and hash jAs the latest leaf node of the cross-chain single-class asset tree corresponding to the game currency of game b on blockchain B, it updates the cross-chain asset tree.

[0118] After the relay server detects the update of the cross-chain asset tree of blockchain N, it obtains the first tree root root3 of the updated cross-chain asset tree and submits it to the relay chain by sending a transaction.

[0119] The nodes of the relay chain execute the transaction sent by the relay server, take the first tree root root3 as the new leaf node of the relay tree, and update the relay tree.

[0120] After the administrator terminal detects the update of the relay tree, it obtains the second tree root root4 of the updated relay tree and submits it to blockchain B (and other blockchains) by sending a transaction.

[0121] The node of blockchain B executes the transaction through the asset cross-chain contract and stores the second tree root root4 in the asset cross-chain contract.

[0122] User B's client uses the second root root4, the first root root3, and the first stored hash hash j , ... and other information are used as the public input of the proof algorithm Prove4() of the zero-knowledge proof circuit, and the first address addr2 to pay the asset, the first private key p2 corresponding to the first address addr2, the first path path3, and the second path path4 are used as the private input of the proof algorithm Prove4() to generate the first proof information:

[0123] Prove4(root4, root3, hash j ,...,addr2,p2,path3,path4)→prove4;

[0124] as well as,

[0125] The package generation includes the above public input root4, root3, hash j , …and the second asset cross-chain transaction tx4 with the first proof information prove4, and sending tx4 to the network of blockchain B.

[0126] The node of blockchain B executes tx4 through the asset cross-chain contract and performs the following verifications:

[0127] Verify whether the second tree root root4 submitted by tx4 has been stored in the asset cross-chain contract: If not, tx4 execution fails;

[0128] Verify the first proof hash submitted by tx4 j Is it not used? If not, tx4 execution fails.

[0129] Submit root4, root3, and hash of tx4 j , ..., prove4 and the identifier hash registered in the contract id1 Enter the verification algorithm Verify4() of the zero-knowledge proof circuit for verification:

[0130] Verify4(root4, root3, hash j ,…,prove4,hash id1 )→Yes / No;

[0131] When the output result of the verification algorithm Verify4() is No, the verification fails and tx4 execution fails;

[0132] If all the above verifications are passed, tx4 is executed successfully, and 10,000 game coins of game B are issued to user A's account in blockchain B, and the first evidence hash is hashed. j Deposit into the verification pool (for subsequent execution of other second asset cross-chain transactions to verify the hash j has already been used).

[0133] The difference between the fifth embodiment and the fourth embodiment is the same as the difference between the second embodiment and the first embodiment, which can be understood by those skilled in the art, and the specific process is not described in detail.

[0134] The difference between the sixth embodiment and the fourth / fifth embodiment is the same as the difference between the third embodiment and the first / second embodiment, which can be understood by those skilled in the art, and the specific process will not be described in detail.

[0135] The above embodiments configure a relay contract on a certain blockchain, maintain a relay tree in the relay contract, and the relay server submits the root of each cross-chain asset tree of each blockchain to the relay chain as a new leaf node of the relay tree, and adds verification between the root of the cross-chain asset tree and the root of the relay tree in the zero-knowledge proof circuit, so that the administrator terminal only needs to synchronize or monitor the root of the relay tree on the relay chain to realize cross-chain asset transfer between multiple blockchains.

[0136] Figure 4 A schematic diagram of the structure of a computer device provided by an embodiment of the present invention.

[0137] like Figure 4As shown, as another aspect, the present application also provides a computer device, including one or more central processing units (CPU) 401, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 402 or the program loaded from the storage part 408 to the random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 are also stored. The CPU 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0138] The following components are connected to the I / O interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as needed. A removable medium 411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 410 as needed, so that a computer program read therefrom is installed into the storage section 408 as needed.

[0139] In particular, according to an embodiment of the present disclosure, the method described in any of the above embodiments can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a machine-readable medium, and the computer program includes a program code for executing any of the above methods. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 409, and / or installed from the removable medium 411.

[0140] As another aspect, the present application also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the apparatus of the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into the device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to execute the method described in the present application.

[0141] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a dedicated hardware-based system that performs a specified function or operation, or can be realized by a combination of dedicated hardware and computer instructions.

[0142] The units or modules involved in the embodiments described in the present application may be implemented by software or by hardware. The units or modules described may also be provided in a processor. For example, each unit may be a software program provided in a computer or a mobile smart device, or may be a separately configured hardware device. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.

[0143] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the concept of the present application. For example, the above features are replaced with the technical features with similar functions disclosed in the present application (but not limited to) to form a technical solution.

Claims

1. A cross-chain asset transfer method, characterized in that: The multiple blockchains are respectively configured with an asset cross-chain contract for transferring assets to each other, and the asset cross-chain contract maintains a cross-chain asset tree, and the leaf nodes of the cross-chain asset tree include the evidence hash of each asset to be transferred from the current blockchain to each first blockchain other than the current blockchain among the multiple blockchains; The asset cross-chain contract is also configured with a zero-knowledge proof circuit for verifying whether the asset to be transferred to the current blockchain has been stored in the asset cross-chain contract of the blockchain before the transfer; The relay chain is configured with a relay contract for aggregating the roots of each cross-chain asset tree of the multiple blockchains, and the relay contract maintains a relay tree, and the leaf nodes of the relay tree include the roots of each cross-chain asset tree of the multiple blockchains; The method is applicable to a blockchain node of any blockchain among the multiple blockchains, and the method includes: Execute the first asset cross-chain transaction, deposit the first asset to be transferred to the second blockchain into the first asset cross-chain contract of the current blockchain, and use the first deposited hash of the first asset as a new leaf node of the first cross-chain asset tree of the first asset cross-chain contract to update the first cross-chain asset tree; The updated first tree root of the first cross-chain asset tree is submitted by the relay server to the relay chain as a newly added leaf node of the relay tree to update the relay tree; The updated second root of the relay tree is used to be submitted to the second asset cross-chain contract of the second blockchain in a credible or falsifiable manner, so as to be used as one of the public inputs of the verification algorithm of the zero-knowledge proof circuit; The first tree root, the first stored evidence hash, the first path corresponding to the first stored evidence hash, the second tree root, and the second path from the first tree root to the second tree root are used as inputs of the proof algorithm of the zero-knowledge proof circuit to generate first proof information; The first proof information is used to be packaged together with the corresponding public inputs to generate a second asset cross-chain transaction and sent to the second blockchain for verification by the second asset cross-chain contract through the verification algorithm.

2. The method according to claim 1, characterized in that The asset cross-chain contract is also configured with a slot allocation rule for allocating slots in the first cross-chain asset tree to each first blockchain in the multiple blockchains except the current blockchain; The asset cross-chain contract is also configured to verify whether the evidence hash is located in the correct slot according to the slot allocation rule to confirm that the asset is to be transferred to the current blockchain rather than other blockchains.

3. The method according to claim 1, characterized in that The cross-chain asset tree is formed by aggregating the cross-chain multi-class asset trees corresponding to each first blockchain in the multiple blockchains except the current blockchain; The cross-chain multi-class asset tree is formed by aggregating cross-chain single-class asset trees of several different asset types of the corresponding first blockchain; The cross-chain single-class asset tree is a Merkle tree generated with the first identification hash as the first leaf node and the evidence hash of each asset of the first asset type to be transferred from the current blockchain to the corresponding first blockchain as the subsequent leaf nodes; The first identification hash is generated according to the current blockchain name, the name of the corresponding first blockchain, and the first asset type; The first identification hash is also registered in the asset cross-chain contract of the corresponding first blockchain.

4. The method according to any one of claims 1 to 3, characterized in that: The second tree root is obtained by the administrator terminal after monitoring the update of the relay tree and stored in the second asset cross-chain contract.

5. The method according to any one of claims 1 to 3, characterized in that: The second tree root is submitted to the second blockchain by the user end of the first user who signed and generated the first asset cross-chain transaction; The second asset cross-chain contract is further configured to freeze the first mapped asset anchored to the first asset issued to the first user within the first challenge period; The administrator terminal is configured to monitor and verify whether the second tree root is recorded in the relay tree within the first challenge period: if not, a first challenge transaction is generated and sent to the network of the second blockchain, so that the nodes of the second blockchain can execute through the second asset cross-chain contract to withdraw or destroy the first mapped asset.

6. The method according to any one of claims 1 to 3, characterized in that: The administrator terminal is configured to obtain the second tree root after monitoring the update of the relay tree, sign the second tree root to generate first signature information, and disclose the first signature information and the corresponding first elliptic curve random number off-chain; The private input of the proof algorithm to generate the first proof information includes the first signature information and the first elliptic curve random number; The generation algorithm of the first signature information is: s=r+p*root; The principle of the verification algorithm verifying the first signature information is: s*G=(r+p*root)*G=r*G+(p*G)root=R+P*root; Among them, s is the first signature information, r is the first random number, p is the administrator's private key, root is the second tree root, G is the elliptic curve base point, R is the first elliptic curve random number generated according to r, and P is the administrator's public key.

7. A computer device, characterized in that: The device comprises: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are caused to perform the method according to any one of claims 1 to 6.

8. A storage medium storing a computer program, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Cross-chain asset transfer method, computer equipment and storage medium

    CN113592475A

  • IP address geographic position ambiguity judgment method and related equipment

    CN113779165A

  • Cross-chain asset transfer method, computer equipment and storage medium

    CN114037449A

  • Cross-chain asset transfer method, computer equipment and storage medium

    CN113592476A

  • Block chain-based default asset processing method, apparatus, and electronic device

    WO2021042817A1