CN114283010B - Multi-main-chain crossing method based on multi-main-chain two-layer network state tree - Google Patents

Multi-main-chain crossing method based on multi-main-chain two-layer network state tree Download PDF

Info

Publication number
CN114283010B
CN114283010B CN202111668206.8A CN202111668206A CN114283010B CN 114283010 B CN114283010 B CN 114283010B CN 202111668206 A CN202111668206 A CN 202111668206A CN 114283010 B CN114283010 B CN 114283010B
Authority
CN
China
Prior art keywords
transaction
backbone
sequence
user
transactions
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111668206.8A
Other languages
Chinese (zh)
Other versions
CN114283010A (en
Inventor
马登极
王志文
吴思进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Fuzamei Technology Co Ltd
Original Assignee
Hangzhou Fuzamei Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Fuzamei Technology Co Ltd filed Critical Hangzhou Fuzamei Technology Co Ltd
Priority to CN202111668206.8A priority Critical patent/CN114283010B/en
Publication of CN114283010A publication Critical patent/CN114283010A/en
Application granted granted Critical
Publication of CN114283010B publication Critical patent/CN114283010B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application provides a multi-backbone cross-link method, a computer device and a storage medium based on a multi-backbone two-layer network state tree, wherein the method comprises the following steps: when the first main chain is monitored to generate a first main chain block, sequentially synchronizing first transactions requiring calling of a first type contract in the first main chain block; the following operations are performed for each first transaction: executing the first transaction to update an asset tree of a second user initiating the first transaction on the two-tier network, a second user root hash of the second user, and a two-tier network tree root; generating zero knowledge proof evidence according to second transaction information of each second transaction in sequence in response to the triggering settlement condition, and generating first proof data according to each second transaction in sequence and the zero knowledge proof evidence; the first certification data is sent to each backbone. The application prevents double flowers on the basis of saving cost.

Description

Multi-main-chain crossing method based on multi-main-chain two-layer network state tree
Technical Field
The application relates to the technical field of blockchains, in particular to a multi-backbone cross-chain method, computer equipment and a storage medium based on a multi-backbone two-layer network state tree.
Background
Current two-tier network-based cross-link schemes are generally one-to-one, with one two-tier network corresponding to one backbone. The applicant hopes to propose a two-layer network corresponding to a plurality of main chains, which is more cost-effective than the prior art, but also has the double-flower problem.
Disclosure of Invention
In view of the foregoing drawbacks or deficiencies of the prior art, it is desirable to provide a multi-backbone, cross-link method, computer device and storage medium based on a multi-backbone two-layer network state tree that prevents bifilar on a cost-effective basis.
In a first aspect, the present invention provides a multi-backbone cross-link method based on a multi-backbone two-layer network state tree for a node of a two-layer network, the two-layer network is configured with a multi-backbone two-layer network state tree, the multi-backbone two-layer network state tree is respectively configured with asset trees corresponding to each user in each backbone, two-layer network tree roots of the two-layer network are generated according to first user root hashes of each first user, the first user root hashes are generated according to first asset tree roots of the asset trees of each backbone by the first user, each backbone is configured with a cross-link verification contract, a zero knowledge proof circuit for verifying transaction information is deployed in the cross-link verification contract, a transaction requiring invoking the first type contract is verified to the backbone where the transaction is performed successfully by the backbone node of each backbone, and the first type contract includes a deposit contract and a withdrawal contract, the method includes:
when the first main chain is monitored to generate a first main chain block, sequentially synchronizing first transactions requiring calling of a first type contract in the first main chain block; wherein the first backbone block is further configured for backbone nodes of other backbones:
synchronizing each first transaction in sequence when the first main chain block is detected by block generation;
When the packing weight of the latest second main chain block to be generated of the main chain is obtained, generating a second main chain block comprising orderly all first transactions, and broadcasting the second main chain block to other main chain nodes of the main chain for other main chain nodes of the main chain:
determining whether the order of the first transactions in the second main chain block is the same as the synchronized order of the first transactions:
If not, rejecting the second main chain block;
The following operations are performed for each first transaction: executing the first transaction to update an asset tree of a second user initiating the first transaction on the two-tier network, a second user root hash of the second user, and a two-tier network tree root;
Generating zero knowledge proof evidence according to second transaction information of each second transaction in sequence in response to the triggering settlement condition, and generating first proof data according to each second transaction in sequence and the zero knowledge proof evidence;
transmitting the first attestation data to each backbone for backbone nodes of each backbone:
Judging whether the sequence of each second transaction in the first proving data is the same as the sequence of each second transaction stored by the cross-chain verification contract:
The order is the same, then the zero knowledge proof evidence is input into the zero knowledge proof circuit to verify whether each second transaction information is correct or not:
If the verification is correct, ending;
the second transaction information comprises an operation type, a user address and a certification quantity.
In a second aspect, the present invention also provides an apparatus comprising one or more processors and a memory, wherein the memory contains instructions executable by the one or more processors to cause the one or more processors to perform a multi-backbone cross-link method based on a multi-backbone two-layer network state tree provided in accordance with embodiments of the present invention.
In a third aspect, the present invention also provides a storage medium storing a computer program, where the computer program causes a computer to execute the multi-backbone cross-link method based on the multi-backbone two-layer network state tree provided in accordance with the embodiments of the present invention.
According to the multi-main-chain crossing method, the computer equipment and the storage medium based on the multi-main-chain two-layer network state tree, which are provided by the embodiments of the invention, when the first main chain is monitored to generate a first main chain block, each first transaction needing to call a first type contract in the first main chain block is synchronized in sequence; the following operations are performed for each first transaction: executing the first transaction to update an asset tree of a second user initiating the first transaction on the two-tier network, a second user root hash of the second user, and a two-tier network tree root; generating zero knowledge proof evidence according to second transaction information of each second transaction in sequence in response to the triggering settlement condition, and generating first proof data according to each second transaction in sequence and the zero knowledge proof evidence; the method of transmitting the first certification data to each backbone prevents double flowers on a cost-effective basis.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the accompanying drawings in which:
fig. 1 is a flowchart of a multi-backbone cross-link method based on a multi-backbone two-layer network state tree according to an embodiment of the present invention.
FIG. 2 is a schematic diagram of a multi-backbone two-layer network state tree.
FIG. 3 is a schematic diagram of a multi-backbone two-layer network state tree according to an embodiment of the present invention.
Fig. 4 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
The application is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be noted that, for convenience of description, only the portions related to the application are shown in the drawings.
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
Fig. 1 is a flowchart of a multi-backbone cross-link method based on a multi-backbone two-layer network state tree according to an embodiment of the present invention. As shown in fig. 1, in this embodiment, the present invention provides a multi-backbone cross-link method based on a multi-backbone two-layer network state tree applicable to a node of a two-layer network, a multi-backbone two-layer network state tree is configured on the two-layer network, asset trees corresponding to each user in each backbone are respectively configured on the multi-backbone two-layer network state tree, two-layer network tree roots of the two-layer network are generated according to first user root hashes of each first user, the first user root hashes are generated according to first asset root of each first user in the asset tree of each backbone, each backbone is configured with a cross-link verification contract, a zero knowledge proof circuit for verifying transaction information is deployed in the cross-link verification contract, a transaction requiring to invoke a first type contract is verified to the backbone where the transaction is performed successfully by the backbone node of each backbone, and the first type contract includes a deposit contract and a withdrawal contract, and the method includes:
S11: when the first main chain is monitored to generate a first main chain block, sequentially synchronizing first transactions requiring calling of a first type contract in the first main chain block; wherein the first backbone block is further configured for backbone nodes of other backbones:
synchronizing each first transaction in sequence when the first main chain block is detected by block generation;
When the packing weight of the latest second main chain block to be generated of the main chain is obtained, generating a second main chain block comprising orderly all first transactions, and broadcasting the second main chain block to other main chain nodes of the main chain for other main chain nodes of the main chain:
determining whether the order of the first transactions in the second main chain block is the same as the synchronized order of the first transactions:
If not, rejecting the second main chain block;
S12: the following operations are performed for each first transaction: executing the first transaction to update an asset tree of a second user initiating the first transaction on the two-tier network, a second user root hash of the second user, and a two-tier network tree root;
S13: generating zero knowledge proof evidence according to second transaction information of each second transaction in sequence in response to the triggering settlement condition, and generating first proof data according to each second transaction in sequence and the zero knowledge proof evidence;
s14: transmitting the first attestation data to each backbone for backbone nodes of each backbone:
Judging whether the sequence of each second transaction in the first proving data is the same as the sequence of each second transaction stored by the cross-chain verification contract:
The order is the same, then the zero knowledge proof evidence is input into the zero knowledge proof circuit to verify whether each second transaction information is correct or not:
If the verification is correct, ending;
the second transaction information comprises an operation type, a user address and a certification quantity.
Current two-tier network-based cross-link schemes are generally one-to-one, with one two-tier network corresponding to one backbone. The applicant wishes to propose a cross-link scheme for a two-layer network corresponding to multiple backbones. When the prior art is combined with a two-layer network corresponding to a cross-link scheme of a plurality of main chains, the tree structure shown in fig. 2 is relatively easy to construct. FIG. 2 is a schematic diagram of a multi-backbone two-layer network state tree. As shown in fig. 2, the state tree of the two-layer network is constructed in a structure that one main chain corresponds to one tree.
It is assumed that several backbones (A chain, B chain, C chain … …) are shared; asset tokenA, tokenA on chain a, asset tokenB, tokenB on chain B, asset … … on chain C; the user A, the user B and the like hold tokenA1;
As shown in fig. 1, the two-layer network has state tree (TreeA) of a chain, state tree (TreeB) of B chain, and state tree (TreeC) of C chain, treeA, treeB, treeC … …;
As can be seen, the id root of tokenA1 is generated according to the policies of the user holding tokenA, such as user a, user b, etc.; the A chain root is generated by the id root of tokenA1 and the id root … … of tokenA 2; the root is generated according to the A chain root and the B chain root … …;
if user A also holds tokenB a1 on the B chain and tokenC a on the C chain, then user accounts need to be configured on both TreeB and TreeC.
When the user A needs the asset retrieval, the user A needs to retrieve in TreeA, treeB, treeC … … respectively, which is quite inconvenient.
Applicant hopes that user asset retrieval will be facilitated, thus constructing a multi-backbone two-layer network state tree as shown in fig. 3; FIG. 3 is a schematic diagram of a multi-backbone two-layer network state tree according to an embodiment of the present invention. As shown in fig. 3, in this embodiment, the present invention provides a multi-backbone two-layer network state tree, where asset trees corresponding to users in each backbone are respectively configured on two-layer networks, two-layer network tree roots of the two-layer network are generated according to first user root hashes of each first user, and the first user root hashes are generated according to first asset tree roots of the asset trees of the first users in each backbone.
Specifically, taking a first asset tree root as an example according to account balance generation of each pass of a first user on a first main chain where the first asset tree root is located;
Also assume a common number of backbones (A, B, C … …); asset tokenA, tokenA on chain a, asset tokenB, tokenB on chain B, asset … … on chain C; user nail holds tokenA, tokenA2;
As shown in fig. 2, taking the user a as an example, the two-layer network is configured with an asset tree of the a chain, an asset tree of the B chain, and an asset tree … … of the C chain of the user a; the two-layer network root of the two-layer network is generated according to root hashes of all users (namely, the id root of the user A, the id root of the user B and the id root … … of the user C), the id root of the user A is generated according to asset roots (namely, A chain root, B chain root and C chain root … …) of asset trees of all main chains, and the asset roots (taking the A chain root as an example) are generated according to account balances (namely tokenA id balance and tokenA id balance … …) of all certificates where the user A is located in the A chain asset tree.
When the user A needs the asset retrieval, the user A can directly search the A chain asset tree of the user A, and the method is quite convenient.
The embodiment shown in fig. 1 is illustrated in the following hypothetical scenario:
Assuming 3 backbones (chain A, chain B, chain C), with assets tokenA, tokenA2 running on chain A, assets tokenB, tokenB2 running on chain B, and asset tokenC running on chain C; the first main chain is an A chain, and main chain nodes of the A chain generate a main chain block (100) according to tx 1-tx 10 in sequence, wherein tx1 and tx2 are transactions requiring invoking first type contracts;
The main chain node of the A chain generates a main chain block (100) _A comprising tx1 and tx2, and tx1 and tx2 are stored in the A chain;
The node of the two-layer network executes step S11, and when the fact that the chain A generates a block (100) _A is monitored, tx1 and tx2 are synchronized in sequence;
the main chain nodes of the B chain and the C chain are sequentially synchronized with tx1 and tx2 when the block generation of the A chain is detected to be about 100 through block generation;
taking a B chain as an example, assuming that the latest main chain block to be generated by the B chain is block (100) _B, and B1 obtains the packing weight of the block (100) _B;
B1 generates a block (100) _Bcomprising tx1, tx2 in sequence and broadcasts to B2-B10;
B2 to B10 determine whether or not the order of tx1 and tx2 in block (100) _b is the same as the order of tx1 and tx2 synchronized:
Assuming the same, then tx1, tx2 are verified on the B chain; it will be appreciated by those skilled in the art that the subsequent steps of B2-B10 may also be configured according to actual requirements, for example, configured to delete the synchronized tx1, tx2 when the block (100) _b consensus is successful; the subsequent steps can release the storage space of B2-B10 and prevent the subsequent repacking of B2-B10 by tx1 and tx2; for B2-B10, if the tx1 and tx2 are packed again later, the packed tx1 and tx2 are deleted in a duplication checking mode by consuming the memory;
if the blocks are different, rejecting the block (100) _B;
The operation of the main chain nodes of the C chain is similar to that of the B chain, and is not repeated here;
Step S12 is executed by the node of the two-layer network, taking tx1 as an example, and tx1 is executed to update the asset tree of the user A on the two-layer network (namely, to update tokenA id balance of the user A and A chain root of the user A), the root hash of the user A (namely, the id root of the user A) and the root of the two-layer network tree; similarly, tx2 is executed to update the asset tree of user b (i.e., update the tokenA id balance of user b and the a-chain root of user b), the root hash of user b (i.e., id root of user b), and the root of the two-layer network tree on the two-layer network;
assume that each second transaction in sequence is tx1, tx2, tx11 to tx20;
Responding to the triggering settlement condition, the node of the two-layer network executes a step S13, generates zero knowledge proof evidence proof1 according to the transaction information of tx1, tx2 and tx11 to tx20 in sequence, and generates proof data proofchunk according to tx1, tx2, tx11 to tx20 and proof 1; in more embodiments, the trigger settlement condition may be configured according to actual requirements, for example, configured to achieve the same technical effect when the distance from the last settlement reaches the first duration, or configured to receive the settlement request;
step S14 is executed by the nodes of the two-layer network, and proofchunk is sent to the A chain, the B chain and the C chain;
The main chain nodes of the A chain, the B chain and the C chain judge whether the sequences of tx1, tx2 and tx11 to tx20 in proofchunk are the same as the sequences of tx1, tx2 and tx11 to tx20 through the cross-chain verification contract:
Assuming the same order, the main chain nodes of the A chain, the B chain and the C chain input proof of zero knowledge circuit by proof1 to verify whether the transaction information of tx1, tx2 and tx11 to tx20 is correct or not:
Assuming that the verification is correct, it ends.
It should be noted that tx1 and tx2 are transactions synchronized from the a-chain, and assuming that tx11 to tx20 are transactions synchronized from the B-chain, then:
For the A chain, the main chain node of each main chain judges whether the sequence of tx1 and tx2 in proofchunk1 is the same as the sequence of tx1 and tx 2;
For the B chain, the main chain node of each main chain judges whether the sequence of tx11 to tx20 in proofchunk1 is the same as the sequence of tx11 to tx 20;
Assuming that each transaction in proofchunk1 is tx1, tx11, tx2, tx12 to tx20, the order of the transaction information of tx1 and tx2 is tx1 to tx2, the order of the transaction information of tx11 to tx20 is tx11 to tx20, and the verification order of the main chain nodes of each main chain is the same as long as the main chain nodes of each main chain store the transaction information;
In more embodiments, the transaction information may be further configured according to actual requirements, for example, configured as a user address, an asset type, an asset number, an operation type, and the like, so as to achieve the same technical effect;
The embodiment ensures that a plurality of backbones maintain a common account book on a two-layer network, thereby saving cost; and the two-layer network can continue to normally run only on the basis of correct transaction sequence and transaction information, so that double flowers are prevented.
Preferably, the method further comprises:
rolling back the asset trees of the users on the two-layer network to a state when the second transactions are not executed when the order is detected to be incorrect or the verification is incorrect;
And returning to the step of generating the zero-knowledge proof evidence according to the second transaction information of each second transaction in sequence so as to regenerate the zero-knowledge proof evidence and the first proof data.
When the sequence on the A chain, the B chain and the C chain is detected to be incorrect or verification is incorrect, the nodes of the two-layer network roll back the asset trees of the users to a state when tx1, tx2 and tx11 to tx20 are not executed;
The nodes of the two-layer network return to the step of generating zero knowledge proof evidence according to the second transaction information of each second transaction in sequence so as to regenerate proof1 and proofchunk1;
It will be appreciated by those skilled in the art that if tx21 is also performed on the two-tier network, tx21 should be rolled back by the result of one or more of tx1, tx2, tx 11-tx 20, if so.
Preferably, before generating the zero knowledge proof evidence according to the second transaction information of each second transaction in sequence, the method further comprises:
receiving third transactions which are generated by a plurality of clients and need to call the second class contracts; wherein the second type of contracts includes transfer contracts, cross-chain transfer contracts;
the following operations are performed for each third transaction: executing a third transaction to update an asset tree of a third user initiating the third transaction on the two-tier network, an asset tree of a fourth user receiving the asset specified by the third transaction, a third user root hash of the third user, a fourth user root hash of the fourth user, and a two-tier network tree root;
Determining whether the order of the second transactions in the first attestation data is the same as the order of the second transactions stored by the cross-chain validation contract includes:
Determining whether the order of the second transactions excluding the third transaction in the first certification data is the same as the order of the second transactions stored by the cross-chain validation contract.
Specifically, the backbone node of the present application is configured to receive transactions of a first type of contract generated by a client, while the nodes of the two-tier network are configured to receive transactions of a second type of contract generated by the client.
In connection with the embodiment shown in FIG. 3, let tx 11-tx 15 be the third transaction invoking the second type of contract, and tx 16-tx 20 be the first transaction invoking the first type of contract synchronized from the block (101) of the A-chain; it can be seen that the nodes of the two-layer network are firstly synchronized to tx1 and tx2 from the block (100) of the A chain, then tx11 to tx15 are sequentially received, and are sequentially synchronized to tx16 to tx20 from the block (101) of the A chain; the order of the transactions is thus tx1, tx2, tx11 to tx20; accordingly, the order of transactions to which the backbone nodes of the B-chain and the C-chain are synchronized is tx1, tx2, tx 16-tx 20.
For tx1, tx2, tx11 to tx20: the main chain nodes of the A chain, the B chain and the C chain only verify whether the sequences of tx1, tx2 and tx16 to tx20 are correct.
Those skilled in the art will appreciate that the transaction information for the third transaction invoking the second type of contract should also include the asset type.
Preferably, generating the first proof data from the sequential second transactions, zero knowledge proof evidence comprises:
generating first proof data according to each second transaction, two-layer network tree roots and zero knowledge proof evidence in sequence;
Judging whether the sequence of each second transaction in the first proving data is matched with the stored second transaction information or not through a cross-chain verification contract so as to verify whether the sequence of each second transaction in the first proving data is correct or not comprises the following steps:
Calculating a first tree root according to each second transaction and the last stored two-layer network tree root through a cross-link verification contract, and updating the stored two-layer network tree root when the first tree root is identical to the two-layer network tree root; and
And judging whether the sequence of each second transaction in the first proving data is matched with the stored second transaction information or not through a cross-chain verification contract so as to verify whether the sequence of each second transaction in the first proving data is correct or not.
Specifically, proofchunk further includes root; assume that root has a value of R1;
The main chain nodes of the A chain, the B chain and the C chain calculate a root 'according to tx1, tx2, tx 11-tx 20 through a cross-chain verification contract, and the last stored root (namely the last root is assumed to have the value of R2), and the root' is assumed to have the value of R3; if r1=r3, updating the stored root value from R2 to R1; and
It is determined by the cross-chain validation contract whether the order of tx1, tx2, tx 11-tx 20 in proofchunk1 matches the transaction information of the stored certificates tx1, tx2, tx 11-tx 20 to verify whether the order of tx1, tx2, tx 11-tx 20 in proofchunk is correct.
Preferably, generating the first proof data from the sequential second transactions, zero knowledge proof evidence comprises:
generating first proof data according to second transaction information and zero knowledge proof evidence of each second transaction in sequence;
Determining whether the order of the second transactions in the first attestation data is the same as the order of the second transactions stored by the cross-chain validation contract includes:
Judging whether each second transaction information in the first proving data is matched with each second transaction of the stored certificate or not through a cross-link verification contract;
the order is the same, then enter the zero knowledge proof evidence into the zero knowledge proof circuit to verify whether each second transaction information is correct or not, comprising:
And if the second transaction information is matched, inputting the zero-knowledge proof evidence into a zero-knowledge proof circuit to verify whether the second transaction information is correct.
The above-described embodiments reduce the data amount of the first certification data.
Preferably, the nodes of the two-layer network pay a plurality of deposits on each main chain, and the main chain nodes of each main chain deduct the first number of deposits when the sequence is detected to be incorrect or verification is incorrect.
The above embodiment penalizes the nodes of the two-layer network, further preventing double flowers.
As shown in fig. 4, as another aspect, the present application also provides an apparatus including one or more Central Processing Units (CPUs) 401, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM403, various programs and data required for the operation of the device 400 are also stored. The CPU401, ROM402, and RAM403 are connected to each other by a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 406 including a keyboard, a mouse, and the like; an output portion 407 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker, and the like; a storage section 408 including a hard disk or the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. The 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, or the like is installed on the drive 410 as needed, so that a computer program read therefrom is installed into the storage section 408 as needed.
In particular, according to embodiments of the present disclosure, the method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing any of the methods described above. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 409 and/or installed from the removable medium 411.
As still another aspect, the present application also provides a computer-readable storage medium, which may be a computer-readable storage medium contained in the apparatus of the above-described embodiment; or may be a computer-readable storage medium, alone, that is not assembled into a device. The computer-readable storage medium stores one or more programs for use by one or more processors to perform the methods described herein.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules involved in the embodiments of the present application may be implemented in software or in hardware. The described units or modules may also be provided in a processor, for example, each of the units may be a software program provided in a computer or a mobile smart device, or may be separately configured hardware devices. Wherein the names of the units or modules do not in some cases constitute a limitation of the units or modules themselves.
The above description is only illustrative of the preferred embodiments of the present application and of the principles of the technology employed. It will be appreciated by persons skilled in the art that the scope of the application referred to in the present application is not limited to the specific combinations of the technical features described above, but also covers other technical features formed by any combination of the technical features described above or their equivalents without departing from the spirit of the application. Such as the above-mentioned features and the technical features disclosed in the present application (but not limited to) having similar functions are replaced with each other.

Claims (7)

1. The multi-backbone cross-link method based on multi-backbone two-layer network state tree is characterized in that a multi-backbone two-layer network state tree is configured on a two-layer network, asset trees corresponding to users in backbones are respectively configured on the multi-backbone two-layer network state tree, two-layer network tree roots of the two-layer network are generated according to first user root hashes of first users, the first user root hashes are generated according to first asset tree roots of the first users in the asset trees of the backbones, each backbone is configured with a cross-link verification contract, a zero knowledge proof circuit for verifying transaction information is deployed in the cross-link verification contract, transactions requiring calling a first type contract are stored in the backbone when the transactions are successfully executed by the backbone nodes of each backbone, the first type contract comprises deposit contracts and withdrawal contracts, and the method is suitable for nodes of the two-layer network, and comprises:
when the first main chain is monitored to generate a first main chain block, sequentially synchronizing first transactions requiring calling of the first type contracts in the first main chain block; wherein the first backbone block is further configured for backbone nodes of other backbones:
Synchronizing each of the first transactions in sequence when the first backbone block is monitored by block generation;
When the packing weight of the latest second main chain block to be generated of the main chain is obtained, generating the second main chain block comprising each first transaction in sequence, and broadcasting the second main chain block to other main chain nodes of the main chain for other main chain nodes of the main chain:
determining whether the order of each of the first transactions in the second main chain block is the same as the order of the synchronized first transactions:
If not, rejecting the second main chain block;
Performing the following operations on each of the first transactions: executing the first transaction to update an asset tree of a second user initiating the first transaction on a two-tier network, a second user root hash of the second user, and the two-tier network root;
generating zero knowledge proof evidence according to second transaction information of each second transaction in sequence in response to a trigger settlement condition, and generating first proof data according to each second transaction in sequence and the zero knowledge proof evidence;
Transmitting the first attestation data to each backbone for backbone nodes of each backbone:
judging whether the sequence of each second transaction in the first proving data is the same as the sequence of each second transaction of the stored certificate or not through the cross-chain verification contract:
The order is the same, the zero knowledge proof evidence is input into the zero knowledge proof circuit to verify whether each second transaction information is correct or not:
If the verification is correct, ending;
wherein the second transaction information comprises operation type, user address and number of passes.
2. The method as recited in claim 1, further comprising:
rolling back each asset tree of each user on the two-tier network to a state when each second transaction is not executed when the order is detected to be incorrect or the verification is incorrect;
And returning to the step of generating zero-knowledge proof evidence according to the second transaction information of each second transaction in sequence so as to regenerate the zero-knowledge proof evidence and the first proof data.
3. The method of claim 1, wherein before generating zero-knowledge proof evidence from the second transaction information of each second transaction in sequence, further comprising:
receiving third transactions which are generated by a plurality of clients and need to call the second class contracts; wherein the second type of contracts include transfer contracts, cross-chain transfer contracts;
Performing the following operations on each of the third transactions: executing the third transaction to update an asset tree of a third user initiating the third transaction on a two-tier network, an asset tree of a fourth user receiving assets specified by the third transaction, a third user root hash of the third user, a fourth user root hash of the fourth user, and the two-tier network root;
The determining, by the cross-link validation contract, whether the order of the second transactions in the first attestation data is the same as the order of the second transactions stored includes:
And judging whether the sequence of the second transaction excluding the third transaction in the first proving data is the same as the sequence of the second transaction in the certificate through the cross-chain verification contract.
4. The method of claim 1, wherein generating the first proof data from the zero-knowledge proof evidence for each of the second transactions in sequence comprises:
Generating first proof data according to each second transaction, the two-layer network tree root and the zero knowledge proof evidence in sequence;
The determining, by the cross-link validation contract, whether the order of each of the second transactions in the first attestation data matches with each of the second transaction information of the stored attestation to verify whether the order of each of the second transactions in the first attestation data is correct includes:
Calculating a first tree root according to each second transaction and the last stored two-layer network tree root through the cross-link verification contract, and updating the stored two-layer network tree root when the first tree root is identical to the two-layer network tree root; and
Judging whether the sequence of each second transaction in the first proving data is matched with the stored second transaction information or not through the cross-link verification contract so as to verify whether the sequence of each second transaction in the first proving data is correct or not.
5. The method of claim 1, wherein generating the first proof data from the zero-knowledge proof evidence for each of the second transactions in sequence comprises:
Generating first proof data according to second transaction information of each second transaction in sequence and the zero knowledge proof evidence;
The determining, by the cross-link validation contract, whether the order of the second transactions in the first attestation data is the same as the order of the second transactions stored includes:
Judging whether each second transaction information in the first proving data is matched with each second transaction of the stored certificate or not through the cross-link verification contract;
the order is the same, inputting the zero-knowledge proof evidence into the zero-knowledge proof circuit to verify whether each of the second transaction information is correct includes:
And if the second transaction information is matched, inputting the zero knowledge proof evidence into the zero knowledge proof circuit to verify whether each second transaction information is correct.
6. A computer device, the device comprising:
One or more processors;
A memory for storing one or more programs,
The one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-5.
7. A storage medium storing a computer program, characterized in that the program, when executed by a processor, implements the method according to any one of claims 1-5.
CN202111668206.8A 2021-12-31 2021-12-31 Multi-main-chain crossing method based on multi-main-chain two-layer network state tree Active CN114283010B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111668206.8A CN114283010B (en) 2021-12-31 2021-12-31 Multi-main-chain crossing method based on multi-main-chain two-layer network state tree

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111668206.8A CN114283010B (en) 2021-12-31 2021-12-31 Multi-main-chain crossing method based on multi-main-chain two-layer network state tree

Publications (2)

Publication Number Publication Date
CN114283010A CN114283010A (en) 2022-04-05
CN114283010B true CN114283010B (en) 2024-05-24

Family

ID=80879370

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111668206.8A Active CN114283010B (en) 2021-12-31 2021-12-31 Multi-main-chain crossing method based on multi-main-chain two-layer network state tree

Country Status (1)

Country Link
CN (1) CN114283010B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020258848A1 (en) * 2019-06-28 2020-12-30 创新先进技术有限公司 Method and apparatus for cross-chain transmission of resources
CN113592475A (en) * 2021-08-02 2021-11-02 杭州复杂美科技有限公司 Cross-chain asset transfer method, computer device, and storage medium
CN113592476A (en) * 2021-08-02 2021-11-02 杭州复杂美科技有限公司 Cross-chain asset transfer method, computer device, and storage medium
CN113657900A (en) * 2021-07-13 2021-11-16 中国人民银行数字货币研究所 Cross-chain transaction verification method and system and cross-chain transaction system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020258848A1 (en) * 2019-06-28 2020-12-30 创新先进技术有限公司 Method and apparatus for cross-chain transmission of resources
CN113657900A (en) * 2021-07-13 2021-11-16 中国人民银行数字货币研究所 Cross-chain transaction verification method and system and cross-chain transaction system
CN113592475A (en) * 2021-08-02 2021-11-02 杭州复杂美科技有限公司 Cross-chain asset transfer method, computer device, and storage medium
CN113592476A (en) * 2021-08-02 2021-11-02 杭州复杂美科技有限公司 Cross-chain asset transfer method, computer device, and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
BitXHub:基于侧链中继的异构区块链互操作平台;叶少杰;汪小益;徐才巢;孙建伶;;计算机科学;20200615(第06期);全文 *

Also Published As

Publication number Publication date
CN114283010A (en) 2022-04-05

Similar Documents

Publication Publication Date Title
US11824996B2 (en) Parachain data synchronization method, device and storage medium
CN108389129B (en) Transaction execution method and device based on block chain and electronic equipment
CN109886681A (en) Block chain common recognition method and common recognition system
CN109492013B (en) Data processing method, device and system applied to database cluster
CN111818185B (en) Method and device for starting intelligent contract, electronic equipment and storage medium
CN112200571A (en) Resource distribution method and device based on block chain and electronic equipment
CN110187831B (en) Block data storage system and method of block chain alliance chain
CN112200567A (en) Resource management method and device based on block chain and electronic equipment
CN109005208B (en) Method and device for pushing information
CN110443612B (en) Block chain-based reimbursement expense segmentation method and device and electronic equipment
CN113469815A (en) Data management method and device
CN114283010B (en) Multi-main-chain crossing method based on multi-main-chain two-layer network state tree
CN114266665A (en) Contract multi-backbone cross-link method, device and storage medium
CN111242614A (en) Wallet account asset retrieving method, collection guarantee method, equipment and storage medium
CN114202425A (en) Method, device and storage medium for predicting multi-main-chain interlinkage of language machine
CN113592653B (en) Proxy delay transaction method, computer device and storage medium
US20230388120A1 (en) Client-Side Device Bloom Filter Mapping
CN115203747A (en) Data account creation method and device
CN115203746A (en) Data account access authorization method and device
CN114757777A (en) Optimal link selection method and device for block chain and electronic equipment
CN111290733B (en) Settlement method, apparatus and storage medium
CN105791350B (en) Project data processing method and system
CN114219646A (en) Multi-main-chain two-layer network state tree and multi-main-chain cross-chain method
CN111524011A (en) Parallel chain consensus confirming method, equipment and storage medium
CN113592652B (en) Delay transaction method, computer device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant