Oracle multi-main chain cross-chain method, device and storage medium
By deploying cross -chain verification contracts and prophecy contracts on the second -level network node, the correctness of the existing cross -chain solution is used to verify the correctness of the transaction information of the zero -knowledge proof circuit, and Safety and efficient cross -chain transactions in the environment.
Patent Information
- Application Number
- CN202111661946.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2041-12-31
AI Technical Summary
The existing cross-chain solution based on layer two networks has high cost and double spending problems, especially in the scenario where a layer two network corresponds to multiple main chains, it is difficult to effectively prevent double spending.
By deploying cross -chain verification contracts and prophecy contracts on the second -level network node, the correctness of the zero -knowledge certification circuit verify the correctness of the transaction information, and synchronize the transaction information in the multi -chain environment to ensure the order order and information of the transaction Correction.
To prevent double flowers on the basis of saving costs, ensure that multiple main chains maintain a common ledger on the second floor network, ensure the order of transactions and the correctness of information, thereby preventing the operator from cheating.
Smart Images

Figure CN114202425B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and specifically to a oracle multi-main chain cross-chain method, device and storage medium. Background Art
[0002] The current cross-chain solution based on the second-layer network is generally one-to-one, with one second-layer network corresponding to one main chain. The applicant hopes to propose a cross-chain solution in which one second-layer network corresponds to multiple main chains. Compared with the existing technology, the above solution saves more costs, but there is also the problem of double spending. Summary of the invention
[0003] In view of the above-mentioned defects or deficiencies in the prior art, it is desired to provide a oracle multi-main chain cross-chain method, device and storage medium that can prevent double spending on the basis of cost saving.
[0004] In a first aspect, the present invention provides a multi-main chain cross-chain method for an oracle applicable to a second-layer network node, wherein there are state trees corresponding to each main chain on the second-layer network, the initial root hash of each state tree is the same, each main chain is configured with a cross-chain verification contract and an oracle contract, and a zero-knowledge proof circuit for verifying transaction information is deployed in the cross-chain verification contract, and the above method comprises:
[0005] When it is detected that the first main chain has generated the first main chain block, the first transactions in the first main chain block that need to call the first type of contract are synchronized in order; wherein the first type of contract includes a deposit contract and a withdrawal contract; each first transaction is recorded in the first main chain, and the first main chain block is also used for the oracle:
[0006] Send the first transaction information of each first transaction in order to other main chains, so that the main chain nodes of other main chains can store the first transaction information through the oracle contract;
[0007] Execute each first transaction to update the first state tree of the first main chain on the second layer network;
[0008] In response to triggering a settlement condition, generating a zero-knowledge proof evidence according to the second transaction information of each second transaction in sequence, and generating first proof data according to each second transaction in sequence and the zero-knowledge proof evidence;
[0009] The first proof data is sent to each main chain for the main chain node of each main chain to:
[0010] The cross-chain verification contract is used to determine whether the order of each second transaction in the first proof data matches the stored second transaction information to verify whether the order of each second transaction in the first proof data is correct:
[0011] If the order is correct, the zero-knowledge proof evidence is input into the zero-knowledge proof circuit to verify whether each second transaction information is correct:
[0012] If the verification is correct, then end;
[0013] Among them, the first transaction information and the second transaction information include operation type, user address, and token quantity.
[0014] In a second aspect, the present invention also provides a 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 oracle multi-main chain cross-chain method provided according to various embodiments of the present invention.
[0015] In a third aspect, the present invention also provides a storage medium storing a computer program, which enables a computer to execute the oracle multi-main chain cross-chain method provided according to various embodiments of the present invention.
[0016] The oracle multi-main chain cross-chain method, device and storage medium provided by many embodiments of the present invention prevent double spending on the basis of cost saving by synchronizing the first transactions that need to call the first type of contract in the first main chain block in sequence when monitoring that the first main chain has generated a first main chain block; executing each first transaction to update the first status tree of the first main chain on the second-layer network; in response to triggering a settlement condition, generating zero-knowledge proof evidence in sequence according to the second transaction information of each second transaction, and generating first proof data according to the sequenced second transactions and zero-knowledge proof evidence; and sending the first proof data to each main chain. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] 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:
[0018] Figure 1 A flowchart of a oracle multi-main chain cross-chain method provided for an embodiment of the present invention.
[0019] Figure 2 A schematic diagram of generating a first tree root provided by an embodiment of the present invention.
[0020] Figure 3 A schematic diagram of the structure of a device provided in one embodiment of the present invention. DETAILED DESCRIPTION
[0021] 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.
[0022] 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.
[0023] The applicant hopes to propose a cross-chain solution in which one layer 2 network corresponds to multiple main chains. Compared with the existing technology, the above solution is more cost-saving, but there is also the problem of double spending - if the operator cheats and deposits and exchanges with assets from another chain, the other chain will not be able to verify. For example, suppose there are 3 main chains (chain A, chain B, and chain C); asset AAA runs on chain A, asset BBB runs on chain B, and asset CCC runs on chain C. The exchange ratio of AAA to BBB to CCC is 1:1:1; suppose the operator privately deposits 100AAA in the layer 2 network and immediately exchanges it with BBB of a user in the layer 2 network. The 100AAA is extra out of thin air and will eventually fail to be verified on chain A, but the operator has already exchanged 100BBB and submitted it to chain B, causing harm to chain B.
[0024] The above problems can be solved by various embodiments of the present application.
[0025] Figure 1 This is a flow chart of a multi-main-chain cross-chain method for an oracle provided in one embodiment of the present invention. Figure 1 As shown, in this embodiment, the present invention provides a oracle multi-main chain cross-chain method applicable to a second-layer network node, wherein there are state trees corresponding to each main chain on the second-layer network, and the initial root hash of each state tree is the same, and each main chain is configured with a cross-chain verification contract and an oracle contract, and a zero-knowledge proof circuit for verifying transaction information is deployed in the cross-chain verification contract, and the above method includes:
[0026] S11: When it is detected that the first main chain has generated a first main chain block, the first transactions in the first main chain block that need to call the first type of contract are synchronized in order; wherein the first type of contract includes a deposit contract and a withdrawal contract; each first transaction is recorded in the first main chain, and the first main chain block is also used for the oracle:
[0027] Send the first transaction information of each first transaction in order to other main chains, so that the main chain nodes of other main chains can store the first transaction information through the oracle contract;
[0028] S12: Execute each first transaction to update the first state tree of the first main chain on the second layer network;
[0029] S13: In response to triggering the settlement condition, generating zero-knowledge proof evidence according to the second transaction information of each second transaction in sequence, and generating first proof data according to each second transaction in sequence and the zero-knowledge proof evidence;
[0030] S14: Send the first proof data to each main chain, so that the main chain nodes of each main chain can:
[0031] The cross-chain verification contract is used to determine whether the order of each second transaction in the first proof data matches the stored second transaction information to verify whether the order of each second transaction in the first proof data is correct:
[0032] If the order is correct, the zero-knowledge proof evidence is input into the zero-knowledge proof circuit to verify whether each second transaction information is correct:
[0033] If the verification is correct, then end;
[0034] Among them, the first transaction information and the second transaction information include operation type, user address, and token quantity.
[0035] Specifically, taking sending the first transaction information of each first transaction in sequence to other main chains so that the main chain nodes of other main chains can store the first transaction information through the oracle contract as evidence, the method includes "storing the first transaction information of each first transaction in sequence, generating a fourth transaction according to each first transaction information, sending the fourth transaction to other main chains so that the main chain nodes of other main chains can execute the fourth transaction through the oracle contract, and storing the first transaction information when the fourth transaction is successfully executed" as an example;
[0036] Assume that there are three main chains (chain A, chain B, and chain C); chain A has asset AAA, chain B has asset BBB, and chain C has asset CCC. The exchange ratio of AAA to BBB to CCC is 1:1:1. On the second-layer network, there is the state tree TreeA of chain A, the state tree TreeB of chain B, and the state tree TreeC of chain C. The initial root hashes of TreeA, TreeB, and TreeC are the same. The first main chain is chain A. The main chain nodes of chain A generate the main chain block block (100) in sequence according to tx1 to tx10. Among them, tx1 and tx2 are transactions that need to call the first type of contract. tx1 is user A's request to deposit 100 AAA, and tx2 is user B's request to withdraw 10 AAA.
[0037] The main chain node of chain A generates the main chain block block (100) including tx1 and tx2. tx1 and tx2 are stored on chain A.
[0038] The nodes of the second-layer network execute step S11. When detecting that the A chain has generated block (100), they synchronize tx1 and tx2 in sequence.
[0039] When the oracle detects that the A chain has generated block (100), it generates tx3 according to the transaction information of tx1 (deposit, addr (A), 100) and the transaction information of tx2 (withdraw, addr (B), 10), and sends tx3 to the B chain and the C chain. In more embodiments, the transaction information can also be configured according to actual needs, such as user address, asset type, asset quantity and operation type, etc., to achieve the same technical effect.
[0040] The main chain nodes of chain B and chain C execute tx3 through the oracle contract. When tx3 is successfully executed, the certificates (deposit, addr(A), 100) and (withdraw, addr(B), 10) are stored.
[0041] The node of the second layer network executes step S12, executes tx1 and tx2 to update TreeA on the second layer network;
[0042] Assume that the second transactions in order are tx1, tx2, tx11-tx20;
[0043] In response to triggering the settlement condition, the node of the second layer network executes step S13, generates zero-knowledge proof proof1 according to the transaction information of tx1, tx2, tx11~tx20 in sequence, and generates proof data proofchunk1 according to tx1, tx2, tx11~tx20, proof1; in more embodiments, the triggering settlement condition can be configured according to actual needs, for example, when the first time length is reached from the last settlement, or when the settlement request is received, the same technical effect can be achieved;
[0044] The nodes of the second-layer network execute step S14 and send proofchunk1 to chain A, chain B, and chain C;
[0045] The main chain nodes of chain A, chain B, and chain C use the cross-chain verification contract to determine whether the order of tx1, tx2, tx11~tx20 in proofchunk1 matches the stored transaction information of tx1, tx2, tx11~tx20 to verify whether the order of tx1, tx2, tx11~tx20 in proofchunk1 is correct:
[0046] Assuming the order is correct, the main chain nodes of chain A, chain B, and chain C input proof1 into the zero-knowledge proof circuit to verify whether the transaction information of tx1, tx2, tx11~tx20 is correct:
[0047] Assuming the verification is correct, then end.
[0048] It should be noted that tx1 and tx2 are transactions synchronized from chain A, and assuming that tx11 to tx20 are transactions synchronized from chain B, then:
[0049] For chain A, the main chain nodes of each main chain determine whether the order of tx1 and tx2 in proofchunk1 matches the transaction information of tx1 and tx2 stored to verify whether the order of transactions synchronized from chain A in proofchunk1 is correct;
[0050] For chain B, the main chain nodes of each main chain determine whether the order of tx11~tx20 in proofchunk1 matches the transaction information of tx11~tx20 stored to verify whether the order of transactions synchronized from chain B in proofchunk1 is correct;
[0051] Assuming that the transactions in proofchunk1 are tx1, tx11, tx2, tx12~tx20, as long as the transaction information stored in the main chain nodes of each main chain is in the order of tx1→tx2, and the order of tx11~tx20, the main chain node verification order of each main chain is also correct;
[0052] The above embodiment enables multiple main chains to maintain a common ledger on the second-layer network, saving costs; and the second-layer network can continue to operate normally only when the transaction sequence and transaction information are correct, preventing double spending.
[0053] Preferably, the above method further comprises:
[0054] When an incorrect order or incorrect verification is detected, the state tree of each main chain is rolled back to the state before the second transaction is executed;
[0055] Return to the step of generating zero-knowledge proof evidence according to the second transaction information of each second transaction in order to regenerate the zero-knowledge proof evidence and the first proof data.
[0056] When the order of chain A, chain B, and chain C is detected to be incorrect, or the verification is incorrect, the nodes of the second-layer network roll back TreeA to TreeC to the state when tx1, tx2, tx11 to tx20 are not executed;
[0057] The nodes of the second-layer network return to the step of "generating zero-knowledge proof evidence according to the second transaction information of each second transaction in order" to regenerate proof1 and proofchunk1;
[0058] Those skilled in the art should understand that, assuming that tx21 is also executed on the second-layer network, the execution of tx21 requires the execution result of one or more transactions among tx1, tx2, tx11~tx20, then tx21 should also be rolled back when rolling back TreeA~TreeC.
[0059] Preferably, before generating the zero-knowledge proof evidence according to the second transaction information of each second transaction in sequence, the method further includes:
[0060] Receive third transactions generated by several clients that need to call the second type of contract; the second type of contract includes transfer contracts and cross-chain transfer contracts; each third transaction is also used for the oracle to: store the third transaction information of each third transaction in order;
[0061] The following operations are performed on each third transaction: the third transaction is executed to update the second state tree of the second main chain to be cross-chained specified by the third transaction on the second-layer network, and the third state tree of the third main chain to be cross-chained specified by the third transaction.
[0062] Specifically, the main chain node of the present application is configured to receive transactions of the first type of contract generated by the client, and the nodes of the second-layer network are configured to receive transactions of the second type of contract generated by the client.
[0063] Combination Figure 1 In the embodiment shown, it is assumed that tx11~tx15 is the third transaction calling the second type of contract, and tx16~tx20 is the first transaction calling the first type of contract synchronized from the block (101) of the A chain; it can be seen that the nodes of the second-layer network first synchronize to tx1 and tx2 from the block (100) of the A chain, and then receive tx11~tx15 in sequence, and synchronize to tx16~tx20 in sequence from the block (101) of the A chain; therefore, the order of each transaction is tx1, tx2, tx11~tx20; accordingly, the oracle sends the transaction information of tx1, tx2, tx11~tx20 in sequence.
[0064] For tx1, tx2, tx11~tx20: the main chain nodes of chain A, chain B, and chain C only verify whether the order of tx1, tx2, tx16~tx20 is correct.
[0065] Those skilled in the art should understand that the transaction information of the third transaction that calls the second type of contract should also include the asset type.
[0066] Preferably, generating the first proof data according to the sequential second transactions and the zero-knowledge proof evidence includes:
[0067] Generate first proof data according to the second transactions, the first tree root, and the zero-knowledge proof evidence in order; wherein the first tree root is generated according to the Merkle tree root of each state tree;
[0068] Determining whether the order of each second transaction in the first proof data matches the stored second transaction information through the cross-chain verification contract to verify whether the order of each second transaction in the first proof data is correct includes:
[0069] Calculate the third tree root according to each second transaction and the stored second tree root through the cross-chain verification contract, and when the third tree root is the same as the first tree root, update the value of the second tree root to the value of the first tree root; and
[0070] The cross-chain verification contract is used to determine whether the order of each second transaction in the first proof data matches the stored second transaction information to verify whether the order of each second transaction in the first proof data is correct.
[0071] Specifically, proofchunk1 also includes the first tree root chain tree root; Figure 2 A schematic diagram of generating a first tree root according to an embodiment of the present invention is shown in FIG. Figure 2 As shown, the chain tree root is generated according to merkleroothash(treeA)~merkleroothash(tree C), assuming its value is R1;
[0072] The main chain nodes of chain A, chain B, and chain C calculate chain tree root' based on tx1, tx2, tx11~tx20 and the stored chain tree root (i.e., the previous chain tree root, assuming its value is R2) through the cross-chain verification contract, assuming that the value of chain tree root' is R3; if R1=R3, then the value of the stored chain tree root is updated from R2 to R1; and,
[0073] The cross-chain verification contract is used to determine whether the order of tx1, tx2, tx11~tx20 in proofchunk1 matches the stored transaction information of tx1, tx2, tx11~tx20 to verify whether the order of tx1, tx2, tx11~tx20 in proofchunk1 is correct.
[0074] Preferably, the nodes of the second-layer network pay a certain amount of deposit on each main chain, and the main chain nodes of each main chain deduct the first amount of deposit when detecting that the order is incorrect or the verification is incorrect.
[0075] The above embodiment punishes the nodes of the second layer network to further prevent double spending.
[0076] Preferably, storing each first transaction information through the oracle contract includes:
[0077] Store each first transaction information in the oracle contract;
[0078] Determining whether the order of each second transaction in the first proof data matches the stored second transaction information through the cross-chain verification contract to verify whether the order of each second transaction in the first proof data is correct includes:
[0079] Request the second transaction information from the oracle contract through the cross-chain verification contract;
[0080] It is determined whether the order of each second transaction in the first proof data matches the stored second transaction information to verify whether the order of each second transaction in the first proof data is correct.
[0081] The above embodiment stores each second transaction information in the oracle contract. In more embodiments, the permissions of each other contract to access each second transaction information can also be configured according to actual needs. For example, the cross-chain verification contract can access each second transaction information, while some other contracts are configured as contracts that cannot access each second transaction information.
[0082] Preferably, generating the first proof data according to the sequential second transactions and the zero-knowledge proof evidence includes:
[0083] Generate first proof data according to each second transaction information and zero-knowledge proof evidence;
[0084] Determining whether the order of each second transaction in the first proof data matches the stored second transaction information through the cross-chain verification contract to verify whether the order of each second transaction in the first proof data is correct includes:
[0085] Through the cross-chain verification contract, it is determined whether each second transaction information in the first proof data is the same as each second transaction information stored in the proof to verify whether the order of each second transaction information in the first proof data is correct.
[0086] The above-described embodiment reduces the data amount of the first certification data.
[0087] Preferably, sending the first transaction information of each first transaction in order to other main chains includes:
[0088] The first transaction information of each first transaction is stored in sequence, and each first transaction information is sent to other main chains; each first transaction information is also used for the oracle to send each first transaction information to the first main chain node when the oracle detects the first main chain node that has just entered the network, so that the first main chain node can store each first transaction information through the oracle contract.
[0089] The above-mentioned embodiment accelerates the speed of synchronizing the main chain block data of the main chain node newly connected to the network, and improves the correctness of the synchronized main chain block data.
[0090] Figure 3 A schematic diagram of the structure of a device provided in one embodiment of the present invention.
[0091] like Figure 3 As shown, as another aspect, the present application also provides a device 300, including one or more central processing units (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the device 300 are also stored. The CPU 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0092] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed, so that a computer program read therefrom is installed into the storage section 308 as needed.
[0093] 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 309, and / or installed from a removable medium 311.
[0094] 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.
[0095] 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.
[0096] 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 arranged in a processor. For example, each of the units may be a software program arranged 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.
[0097] 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 (but not limited to) technical features with similar functions disclosed in the present application.
Claims
1. A multi-main-chain cross-chain method for oracles, characterized in that: There are state trees corresponding to each main chain on the second-layer network, and the initial root hash of each state tree is the same. Each main chain is configured with a cross-chain verification contract and an oracle contract. A zero-knowledge proof circuit for verifying transaction information is deployed in the cross-chain verification contract. The method is applicable to nodes of the second-layer network, and the method includes: When it is detected that the first main chain has generated a first main chain block, the first transactions in the first main chain block that need to call the first type of contract are synchronized in order; wherein the first type of contract includes a deposit contract and a withdrawal contract; each of the first transactions is recorded in the first main chain, and the first main chain block is also used for the oracle: Sending the first transaction information of each of the first transactions in order to other main chains, so that the main chain nodes of other main chains can store the first transaction information through the oracle contract; Execute each of the first transactions to update the first state tree of the first main chain on the second layer network; In response to triggering a settlement condition, generating a zero-knowledge proof evidence according to the second transaction information of each second transaction in sequence, and generating first proof data according to each of the second transactions and the zero-knowledge proof evidence in sequence; The first proof data is sent to each main chain so that the main chain nodes of each main chain can: The cross-chain verification contract is used to determine whether the order of each of the second transactions in the first proof data matches the stored second transaction information to verify whether the order of each of the second transactions in the first proof data is correct: If the order is correct, the zero-knowledge proof evidence is input into the zero-knowledge proof circuit to verify whether each of the second transaction information is correct: If the verification is correct, then end; The first transaction information and the second transaction information include operation type, user address, and token quantity.
2. The method according to claim 1, characterized in that Also includes: When an incorrect order or incorrect verification is detected, the state tree of each main chain is rolled back on the second-layer network to the state before the second transaction is executed; Return to the step of sequentially generating zero-knowledge proof evidence according to the second transaction information of each second transaction to regenerate the zero-knowledge proof evidence and the first proof data.
3. The method according to claim 1, characterized in that: Before the zero-knowledge proof evidence is generated according to the second transaction information of each second transaction in sequence, the method further includes: Receiving a third transaction generated by several clients that needs to call a second type of contract; wherein the second type of contract includes a transfer contract and a cross-chain transfer contract; Perform the following operations on each of the third transactions: execute the third transaction to update the second state tree of the second main chain to be cross-chained specified by the third transaction on the second-layer network, and the third state tree of the third main chain to be cross-chained specified by the third transaction; The determining, by the cross-chain verification contract, whether the order of each of the second transactions in the first proof data matches the stored second transaction information to verify whether the order of each of the second transactions in the first proof data is correct includes: The cross-chain verification contract is used to determine whether the order of the second transactions excluding the third transaction in the first proof data matches the stored second transaction information to verify whether the order of the second transactions in the first proof data is correct.
4. The method according to claim 1, characterized in that: The generating of the first proof data according to the second transactions and the zero-knowledge proof evidence in order includes: Generate first proof data according to the second transactions, the first tree root, and the zero-knowledge proof evidence in order; wherein the first tree root is generated according to the Merkle tree root of each state tree; The determining, by the cross-chain verification contract, whether the order of each of the second transactions in the first proof data matches the stored second transaction information to verify whether the order of each of the second transactions in the first proof data is correct includes: Calculate a third tree root according to each of the second transactions and the stored second tree root through the cross-chain verification contract, and when the third tree root is the same as the first tree root, update the value of the second tree root to the value of the first tree root; and The cross-chain verification contract is used to determine whether the order of each of the second transactions in the first proof data matches the stored second transaction information to verify whether the order of each of the second transactions in the first proof data is correct.
5. The method according to claim 1, characterized in that The sending of the first transaction information of each of the first transactions in order to other main chains so that the main chain nodes of other main chains can store the first transaction information through the oracle contract includes: The first transaction information of each of the first transactions is stored in sequence, a fourth transaction is generated according to each of the first transaction information, and the fourth transaction is sent to other main chains so that the main chain nodes of other main chains can execute the fourth transaction through the oracle contract, and the first transaction information is stored when the fourth transaction is successfully executed.
6. The method according to claim 5, characterized in that The storing of the first transaction information by the oracle contract includes: Storing each of the first transaction information in the oracle contract; The determining, by the cross-chain verification contract, whether the order of each of the second transactions in the first proof data matches the stored second transaction information to verify whether the order of each of the second transactions in the first proof data is correct includes: Requesting each of the second transaction information from the oracle contract through the cross-chain verification contract; Determine whether the order of each second transaction in the first proof data matches the stored second transaction information to verify whether the order of each second transaction in the first proof data is correct.
7. The method according to claim 1, characterized in that The generating of the first proof data according to the second transactions and the zero-knowledge proof evidence in order includes: Generate first proof data according to each of the second transaction information and the zero-knowledge proof evidence; The determining, by the cross-chain verification contract, whether the order of each of the second transactions in the first proof data matches the stored second transaction information to verify whether the order of each of the second transactions in the first proof data is correct includes: The cross-chain verification contract is used to determine whether each second transaction information in the first proof data is the same as each second transaction information stored in the proof to verify whether the order of each second transaction information in the first proof data is correct.
8. The method according to claim 1, characterized in that The sending the first transaction information of each of the first transactions in order to other main chains includes: The first transaction information of each first transaction is stored in sequence, and each first transaction information is sent to other main chains; each first transaction information is also used for the oracle to send each first transaction information to the first main chain node when the oracle detects the first main chain node that has just entered the network, so that the first main chain node can store each first transaction information through the oracle contract.
9. 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 8.
10. 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 8 is implemented.
Citation Information
Patent Citations
Oracle machine-based cross-chain asset transaction method and device, and storage medium
CN113139808A
Cross-chain asset transfer method, computer equipment and storage medium
CN113592475A