CN114202425A - Oracle multi-main chain cross-chain method, equipment and storage medium - Google Patents

Oracle multi-main chain cross-chain method, equipment and storage medium Download PDF

Info

Publication number
CN114202425A
CN114202425A CN202111661946.9A CN202111661946A CN114202425A CN 114202425 A CN114202425 A CN 114202425A CN 202111661946 A CN202111661946 A CN 202111661946A CN 114202425 A CN114202425 A CN 114202425A
Authority
CN
China
Prior art keywords
sequence
transaction
transactions
transaction information
chain
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.)
Granted
Application number
CN202111661946.9A
Other languages
Chinese (zh)
Other versions
CN114202425B (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.)
Shenzhen Morning Intellectual Property Operations 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 CN202111661946.9A priority Critical patent/CN114202425B/en
Publication of CN114202425A publication Critical patent/CN114202425A/en
Application granted granted Critical
Publication of CN114202425B publication Critical patent/CN114202425B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a prophetic machine multi-main-chain cross-linking method, equipment and a storage medium, wherein the method comprises the following steps: when the first main chain block is detected to be generated by the first main chain, synchronizing first transactions in the first main chain block, which need to call the first type of contracts, in sequence; performing each first transaction to update a first state tree of a first backbone on the two-tier network; responding to a triggered settlement condition, generating zero-knowledge proof evidence according to second transaction information of each second transaction in sequence, and generating first proof data according to each second transaction and the zero-knowledge proof evidence in sequence; first proof data is sent to each backbone. The application prevents double flowers on the basis of saving cost.

Description

Method, device and storage medium for predicting multi-main-chain interlinkage of language machine
Technical Field
The application relates to the technical field of block chains, in particular to a method, equipment and a storage medium for multi-main-chain crossing of a prediction machine.
Background
Current link-crossing schemes based on two-layer networks are generally one-to-one, with one two-layer network corresponding to one backbone. The applicant wishes to propose a cross-link scheme for a two-layer network with multiple backbones, which is more cost-effective than the prior art, but also has the problem of double flowers.
Disclosure of Invention
In view of the above-mentioned deficiencies or inadequacies in the prior art, it would be desirable to provide a predictive multi-master chain cross-link method, apparatus, and storage medium that prevents double blossoming on a cost effective basis.
In a first aspect, the present invention provides a predictive engine multi-main-chain crossing method suitable for a two-layer network node, where a state tree corresponding to each main chain is on the two-layer network, initial root hashes of the state trees are the same, each main chain is configured with a cross-chain verification contract and a predictive engine contract, and a zero-knowledge proof circuit for verifying transaction information is deployed in the cross-chain verification contract, the method including:
when the first main chain block is detected to be generated by the first main chain, synchronizing first transactions in the first main chain block, which need to call the first type of contracts, in sequence; wherein the first type of contract comprises a deposit contract and a withdrawal contract; each first transaction is credited at a first backbone, the first backbone block further for the predictive engine to:
sending the first transaction information of each first transaction in sequence to other main chains so that main chain nodes of other main chains can store and verify the first transaction information through a prompter contract;
performing each first transaction to update a first state tree of a first backbone on the two-tier network;
responding to a triggered settlement condition, generating zero-knowledge proof evidence according to second transaction information of each second transaction in sequence, and generating first proof data according to each second transaction and the zero-knowledge proof evidence in sequence;
sending the first proof data to each backbone for the backbone nodes of each backbone:
judging whether the sequence of each second transaction in the first certification data is matched with the stored second transaction information through the cross-link verification contract so as to verify whether the sequence of each second transaction in the first certification data is correct:
and if the sequence is correct, inputting the zero-knowledge proof evidence into a zero-knowledge proof circuit to verify whether each second transaction message is correct:
if the verification is correct, ending;
the first transaction information and the second transaction information comprise operation types, user addresses and the number of certificates of receipt.
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 predictive multi-chassis cross-chain method provided in accordance with embodiments of the present invention.
In a third aspect, the present invention further provides a storage medium storing a computer program, the computer program enabling a computer to execute the prediction machine multi-main-chain inter-chain method provided according to the embodiments of the present invention.
According to the method, the device and the storage medium for the multi-main-chain cross-linking of the prediction machine, provided by the embodiments of the invention, when the fact that the first main-chain block is generated by the first main-chain is monitored, the first transactions of the first type of contracts, which need to be called, in the first main-chain block are synchronized in sequence; performing each first transaction to update a first state tree of a first backbone on the two-tier network; responding to a triggered settlement condition, generating zero-knowledge proof evidence according to second transaction information of each second transaction in sequence, and generating first proof data according to each second transaction and the zero-knowledge proof evidence in sequence; the method of sending the first certification data to each main chain prevents double blossom on a cost-saving basis.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
fig. 1 is a flowchart of a method for predicting inter-chain of multiple main chains of a speaker.
Fig. 2 is a schematic diagram of generating a first tree root according to an embodiment of the present invention.
Fig. 3 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
The applicant wishes to propose a cross-chaining scheme with a two-tier network corresponding to multiple backbones, which is more cost-effective than the prior art, but also has the problem of double flowers-if the operator cheats the exchange of assets with the other chain after the deposit, the other chain will not be able to verify. For example, assume that there are 3 main chains (A chain, B chain, C chain); an asset AAA runs on the chain A, an asset BBB runs on the chain B, an asset CCC runs on the chain C, and the exchange ratio of the AAA to the BBB to the CCC is 1:1: 1; assuming that the operator privately deposits 100AAA in the two-tier network and immediately exchanges with the BBB of a certain user in the two-tier network, the 100AAA is overflowed by the air and eventually fails authentication on the a chain, but the operator has exchanged 100BBB and submitted to the B chain, causing damage to the B chain.
The above problems can be solved by embodiments of the present application.
Fig. 1 is a flowchart of a method for predicting inter-chain of multiple main chains of a speaker. As shown in fig. 1, in this embodiment, the present invention provides a predictive engine multi-main-chain cross-link method suitable for a two-layer network node, where a two-layer network has state trees corresponding to main chains, initial root hashes of the state trees are the same, each main chain is configured with a cross-chain verification contract and a predictive engine contract, and a zero-knowledge proof circuit for verifying transaction information is deployed in the cross-chain verification contract, where the method includes:
s11: when the first main chain block is detected to be generated by the first main chain, synchronizing first transactions in the first main chain block, which need to call the first type of contracts, in sequence; wherein the first type of contract comprises a deposit contract and a withdrawal contract; each first transaction is credited at a first backbone, the first backbone block further for the predictive engine to:
sending the first transaction information of each first transaction in sequence to other main chains so that main chain nodes of other main chains can store and verify the first transaction information through a prompter contract;
s12: performing each first transaction to update a first state tree of a first backbone on the two-tier network;
s13: responding to a triggered settlement condition, generating zero-knowledge proof evidence according to second transaction information of each second transaction in sequence, and generating first proof data according to each second transaction and the zero-knowledge proof evidence in sequence;
s14: sending the first proof data to each backbone for the backbone nodes of each backbone:
judging whether the sequence of each second transaction in the first certification data is matched with the stored second transaction information through the cross-link verification contract so as to verify whether the sequence of each second transaction in the first certification data is correct:
and if the sequence is correct, inputting the zero-knowledge proof evidence into a zero-knowledge proof circuit to verify whether each second transaction message is correct:
if the verification is correct, ending;
the first transaction information and the second transaction information comprise operation types, user addresses and the number of certificates of receipt.
Specifically, taking as an example that the first transaction information of each first transaction in sequence is sent to each other main chain, so that the main chain nodes of each other main chain can store each first transaction information through a language predictive machine contract to certify each first transaction information, including "the first transaction information of each first transaction is stored in sequence, a fourth transaction is generated according to each first transaction information, the fourth transaction is sent to each other main chain, so that the main chain nodes of each other main chain can execute the fourth transaction through the language predictive machine contract, and each first transaction information is certified when the fourth transaction is executed successfully";
suppose there are 3 main chains (chain A, chain B, chain C); an asset AAA runs on the chain A, an asset BBB runs on the chain B, an asset CCC runs on the chain C, and the exchange ratio of the AAA to the BBB to the CCC is 1:1: 1; the two-layer network is provided with a state tree TreeA of the chain A, a state tree TreeB of the chain B and a state tree TreeC of the chain C, and the initial root hash of TreeA, TreeB and TreeC is the same; the first main chain is an A chain, 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 needing to call a first type of contract, tx1 requests a user A to deposit 100AAA, and tx2 requests a user B to withdraw 10 AAA;
the main chain node of the A chain generates a main chain block (100) comprising tx1 and tx2, and tx1 and tx2 are verified on the A chain;
the nodes of the two-layer network execute step S11, and synchronize tx1 and tx2 in sequence when detecting that the A chain generates a block (100);
when monitoring that the A chain generates a block (100), the prophetic generates tx3 according to transaction information (default, addr (A),100) of tx1 and transaction information (withdraw, addr (B),10) of tx2, and sends tx3 to the B chain and the C chain; in more embodiments, the transaction information may also be configured according to actual requirements, for example, configured as a user address, an asset type, an asset quantity, an operation type, and the like, so that the same technical effect may be achieved;
main chain nodes of the B chain and the C chain execute tx3 through a presupportion machine contract, and when the tx3 is executed successfully, the memories (dispose, addr (A), (100)) and (withdraw, addr (B), (10)) are stored;
the nodes of the two-layer network execute the step S12, execute tx1, tx2 to update TreeA on the two-layer network;
assume that each second transaction in order is tx1, tx2, tx 11-tx 20;
responding to the triggered settlement condition, executing a step S13 by the nodes of the two-layer network, generating proof of zero knowledge proof1 according to the transaction information of tx1, tx2 and tx11 to tx20 in sequence, and generating proof data proofchunk1 according to tx1, tx2, tx11 to tx20 and proof 1; in further embodiments, the condition for triggering settlement may be configured according to actual requirements, for example, configured to achieve the same technical effect when the time is the first time since the last settlement, or configured to receive the settlement request;
the node of the two-layer network executes the step S14, and sends proofchunk1 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 sequence of tx1, tx2 and tx11 to tx20 in the proofchunk1 is matched with the stored transaction information of tx1, tx2 and tx11 to tx20 through a cross-chain verification contract so as to verify whether the sequence of tx1, tx2 and tx11 to tx20 in the proofchunk1 is correct:
assuming the sequence is correct, the main chain nodes of the A chain, the B chain and the C chain input proof1 into a zero-knowledge proof circuit to verify whether the transaction information of tx1, tx2, tx11 to tx20 is correct:
assuming the verification is correct, the process is ended.
It should be noted that tx1 and tx2 are transactions synchronized from the a chain, and assuming 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 the proofchunk1 is matched with the stored transaction information of tx1 and tx2 so as to verify whether the sequence of each transaction synchronized from the a chain in the proofchunk1 is correct;
for the B chain, the main chain node of each main chain judges whether the sequence of tx11 to tx20 in the proofchunk1 is matched with the stored transaction information of tx11 to tx20 so as to verify whether the sequence of each transaction synchronized from the B chain in the proofchunk1 is correct;
assuming that each transaction in the proofchunk1 is tx1, tx11, tx2, tx12 to tx20, as long as the sequence of the transaction information of tx1 and tx2 is tx1 → tx2 and the sequence of the transaction information of tx11 to tx20 is tx11 → tx20 in the transaction information of the main chain node certificate of each main chain, the main chain node verification sequence of each main chain is also correct;
the embodiment enables a plurality of main chains to maintain a common account book on a two-layer network, thereby saving the cost; and only on the basis of correct transaction sequence and transaction information, the two-layer network can continue to operate normally, so that double flowers are prevented.
Preferably, the method further comprises:
when the monitored sequence is incorrect or the verification is incorrect, rolling back the state tree of each main chain to the state when each second transaction is not executed;
and returning to the step of generating the zero-knowledge proof evidence according to the second transaction information of the second transactions in sequence so as to regenerate the zero-knowledge proof evidence and the first proof data.
When the sequence of the chain A, the chain B and the chain C is monitored to be incorrect, or the verification is incorrect, the nodes of the two-layer network roll back TreeA-TreeC to the state when tx1, tx2 and tx 11-tx 20 are not executed;
the nodes of the two-layer network return the step of generating zero-knowledge proof evidence according to the second transaction information of the second transactions in sequence so as to regenerate proof1 and proof 1;
it should be understood by those skilled in the art that, assuming tx21 is also executed on the two-tier network, tx21 is executed by means of the execution results of one or more transactions among tx1, tx2, tx11 to tx20, then tx21 should also be rolled back when rolling back TreeA to TreeC.
Preferably, before generating the zero-knowledge proof evidence according to the second transaction information of the second transactions in sequence, the method further includes:
receiving third transactions which are generated by a plurality of clients and need to call the second type of contracts; wherein the second type of contract comprises a transfer contract and a cross-chain transfer contract; each third transaction is also for the predictive engine: storing third transaction information of each third transaction in sequence;
performing the following operations for each third transaction: and executing the third transaction to update a second state tree of a second main chain needing to be bridged and specified by the third transaction on the two-layer network, and a third state tree of a third main chain to be bridged and specified by the third transaction.
Specifically, the backbone nodes of the present application are 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. 1, assume that tx 11-tx 15 are third transactions invoking contracts of a second type, and tx 16-tx 20 are first transactions invoking contracts of a first type synchronized from a block (101) of an A-chain; it can be seen that the nodes of the two-layer network are synchronized to tx1 and tx2 from block (100) of the a chain, then sequentially receive tx11 to tx15, and sequentially synchronize to tx16 to tx20 from block (101) of the a chain; the order of transactions is thus tx1, tx2, tx11 to tx 20; correspondingly, the prediction machine sends the transaction information of tx1, tx2, tx11 to tx20 in sequence.
For tx1, tx2, tx11 to tx 20: the main chain nodes of the A chain, the B chain and the C chain only verify whether the sequence of tx1, tx2, tx16 to tx20 is correct or not.
Those skilled in the art will appreciate that the transaction information for the third transaction that invokes the second type of contract should also include the asset type.
Preferably, generating the first proof data from the sequential second transaction, zero knowledge proof of knowledge proofs comprises:
generating first proof data according to each second transaction, the first tree root and the zero-knowledge proof evidence in sequence; wherein the first tree root is generated according to the Mercker tree root of each state tree;
determining, by the cross-link verification contract, whether the order of the second transactions in the first attestation data matches the second transaction information stored to verify whether the order of the second transactions in the first attestation data is correct comprises:
calculating a third root according to each second transaction and the stored second root through the cross-link verification contract, and updating the value of the second root to the value of the first root when the third root is the same as the first root; and the number of the first and second groups,
and judging whether the sequence of each second transaction in the first certification data is matched with the stored second transaction information through the cross-link verification contract so as to verify whether the sequence of each second transaction in the first certification data is correct.
Specifically, the proofchunk1 further includes a first tree root; FIG. 2 is a schematic diagram of generating a first tree root according to an embodiment of the present invention, and as shown in FIG. 2, a chain tree root is generated according to merkleothorash (tree A) -merkleothorash (tree C), and its value is assumed to be R1;
main chain nodes of the A chain, the B chain and the C chain calculate chain tree roots 'according to tx1, tx2 and tx 11-tx 20 through cross-chain verification contracts, wherein the stored chain tree roots (namely the last chain tree root, the value of which is assumed to be R2) and the value of the chain tree root' is assumed to be R3; if R1 ═ R3, the value of the stored chain tree root is updated from R2 to R1; and the number of the first and second groups,
whether the sequence of tx1, tx2 and tx11 to tx20 in the proofchunk1 is matched with the stored transaction information of tx1, tx2 and tx11 to tx20 is judged through a cross-chain verification contract so as to verify whether the sequence of tx1, tx2 and tx11 to tx20 in the proofchunk1 is correct.
Preferably, the nodes of the two-layer network pay a plurality of deposit on each main chain, and the main chain nodes of each main chain deduct a first amount of deposit when monitoring the sequence is incorrect or verification is incorrect.
The embodiment punishs the nodes of the two-layer network, and further prevents double flowers.
Preferably, the validating each first transaction information by the predictive engine contract includes:
storing each first transaction information into a language prediction machine contract;
determining, by the cross-link verification contract, whether the order of the second transactions in the first attestation data matches the second transaction information stored to verify whether the order of the second transactions in the first attestation data is correct comprises:
requesting each second transaction information from the president contract through the cross-link verification contract;
and judging whether the sequence of each second transaction in the first certification data is matched with the stored second transaction information so as to verify whether the sequence of each second transaction in the first certification data is correct.
The above-described embodiments store each second transaction information in a predictive engine contract. In further embodiments, the rights of each other contract to access each second transaction information may also be configured according to actual requirements, e.g., cross-chain validation contracts may be configured to access each second transaction information, while some other contracts are configured as contracts that do not have access to each second transaction information.
Preferably, generating the first proof data from the sequential second transaction, zero knowledge proof of knowledge proofs comprises:
generating first proof data according to the second transaction information and the zero-knowledge proof evidence;
determining, by the cross-link verification contract, whether the order of the second transactions in the first attestation data matches the second transaction information stored to verify whether the order of the second transactions in the first attestation data is correct comprises:
and judging whether the second transaction information in the first certification data is the same as the stored second transaction information through the cross-link verification contract so as to verify whether the sequence of the second transaction information in the first certification data is correct.
The above-described embodiment reduces the data amount of the first certification data.
Preferably, the sending the first transaction information of each first transaction in sequence to each other main chain comprises:
storing the first transaction information of each first transaction in sequence, and sending each first transaction information to other main chains; and each first transaction information is also used for sending each first transaction information to the first main chain node when the predicting machine monitors the first main chain node of the initial network, so that the first main chain node can store and verify each first transaction information through the contract of the predicting machine.
The embodiment accelerates the speed of synchronizing the main chain block data by the main chain node of the initial network and improves the correctness of the synchronizing main chain block data.
Fig. 3 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
As shown in fig. 3, as another aspect, the present application also provides an apparatus 300 including one or more Central Processing Units (CPUs) 301 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)302 or a program loaded from a storage section 308 into a Random Access Memory (RAM) 303. In the RAM303, various programs and data necessary for the operation of the apparatus 300 are also stored. The CPU301, ROM302, and RAM303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
The following components are connected to the I/O interface 305: an input portion 306 including a keyboard, a mouse, and the like; an output section 307 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 308 including a hard disk and the like; and a communication section 309 including a network interface card such as a LAN card, a modem, or the like. 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, or the like is mounted on the drive 310 as necessary, so that a computer program read out therefrom is mounted into the storage section 308 as necessary.
In particular, according to an embodiment 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 through the communication section 309, and/or installed from the removable medium 311.
As yet another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus of the above-described embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the methods described in the present application.
The flowchart 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 described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, for example, each of the described units may be a software program provided in a computer or a mobile intelligent device, or may be a separately configured hardware device. Wherein the designation of a unit or module does not in some way constitute a limitation of the unit or module itself.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the present application. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (10)

1.一种预言机多主链跨链方法,其特征在于,二层网络上有分别对应于各主链的状态树,各所述状态树的初始根哈希相同,各主链配置有跨链验证合约和预言机合约,所述跨链验证合约中部署有验证交易信息的零知识证明电路,所述方法适用于二层网络的节点,所述方法包括:1. An oracle multi-main chain cross-chain method, characterized in that 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, and each main chain is configured with cross The chain verification contract and the oracle machine contract, the zero-knowledge proof circuit for verifying transaction information is deployed in the cross-chain verification contract, the method is applicable to the nodes of the two-layer network, and the method includes: 在监测到第一主链生成了第一主链区块时,按序同步所述第一主链区块中的各需要调用第一类合约的第一交易;其中,所述第一类合约包括存款合约、取款合约;各所述第一交易在所述第一主链被存证,所述第一主链区块还用于供预言机:When it is detected that the first main chain has generated the first main chain block, the first transactions in the first main chain blocks that need to call the first type of contract are synchronized in sequence; wherein, the first type of contract Including a deposit contract and a withdrawal contract; each of the first transactions is deposited in the first main chain, and the first main chain block is also used for the oracle machine: 将按序的各所述第一交易的第一交易信息发送给其它各主链,以供其它各主链的主链节点通过所述预言机合约存证各所述第一交易信息;Send the first transaction information of each of the first transactions 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; 执行各所述第一交易以更新二层网络上所述第一主链的第一状态树;executing each of the first transactions to update the first state tree of the first main chain on the Layer 2 network; 响应于触发结算条件,按序根据各第二交易的第二交易信息生成零知识证明证据,根据按序的各所述第二交易、所述零知识证明证据生成第一证明数据;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 of the second transactions and the zero-knowledge proof evidence in sequence; 将所述第一证明数据发送给各主链,以供各主链的主链节点:Send the first proof data to each main chain for the main chain nodes of each main chain: 通过所述跨链验证合约判断所述第一证明数据中的各所述第二交易的顺序与所存证的各所述第二交易信息是否匹配以验证所述第一证明数据中的各所述第二交易的顺序是否正确:Determine whether the sequence of each of the second transactions in the first certification data matches the stored second transaction information through the cross-chain verification contract, so as to verify each of the second transactions in the first certification data. Is the order of the second transaction correct: 顺序正确,则将所述零知识证明证据输入所述零知识证明电路以验证各所述第二交易信息是否正确:If the sequence is correct, input the zero-knowledge proof evidence into the zero-knowledge proof circuit to verify whether each of the second transaction information is correct: 验证正确,则结束;If the verification is correct, end; 其中,所述第一交易信息和所述第二交易信息包括操作类型、用户地址、通证数量。Wherein, the first transaction information and the second transaction information include operation type, user address, and number of tokens. 2.根据权利要求1所述的方法,其特征在于,还包括:2. The method of claim 1, further comprising: 在监测到顺序不正确,或,验证不正确时,在二层网络上回滚各主链的状态树至未执行各所述第二交易时的状态;When it is detected that the sequence is incorrect, or the verification is incorrect, roll back the state tree of each main chain on the Layer 2 network to the state when each of the second transactions is not executed; 返回所述按序根据各第二交易的第二交易信息生成零知识证明证据步骤,以重新生成所述零知识证明证据和所述第一证明数据。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 the zero-knowledge proof evidence and the first proof data. 3.根据权利要求1所述的方法,其特征在于,所述按序根据各第二交易的第二交易信息生成零知识证明证据前,还包括:3. The method according to claim 1, wherein before generating zero-knowledge proof evidence according to the second transaction information of each second transaction in sequence, the method further comprises: 接收若干客户端生成的需要调用第二类合约的第三交易;其中,所述第二类合约包括转账合约、跨链转账合约;Receive a third transaction generated by a number of clients that needs to call the 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 specified by the third transaction on the Layer 2 network that needs to be cross-chained, and, the third The third state tree of the third main chain to be cross-chain specified by the transaction; 所述通过所述跨链验证合约判断所述第一证明数据中的各所述第二交易的顺序与所存证的各所述第二交易信息是否匹配以验证所述第一证明数据中的各所述第二交易的顺序是否正确包括:The cross-chain verification contract is used to determine whether the sequence of each of the second transactions in the first proof data matches the stored information of each of the second transactions, so as to verify each of the first proof data. Whether the sequence of the second transaction is correct includes: 通过所述跨链验证合约判断所述第一证明数据中的除去所述第三交易的各所述第二交易的顺序与所存证的各所述第二交易信息是否匹配以验证所述第一证明数据中的各所述第二交易的顺序是否正确。The cross-chain verification contract is used to determine whether the sequence of each of the second transactions in the first certification data excluding the third transaction matches the information of each of the second transactions stored in the certificate to verify the first Prove whether the sequence of each of the second transactions in the data is correct. 4.根据权利要求1所述的方法,其特征在于,所述根据按序的各所述第二交易、所述零知识证明证据生成第一证明数据包括:4. The method according to claim 1, wherein the generating the first proof data according to each of the second transactions and the zero-knowledge proof evidence in sequence comprises: 根据按序的各所述第二交易、第一树根、所述零知识证明证据生成第一证明数据;其中,所述第一树根根据各所述状态树的默克尔树根生成;The first proof data is generated according to each of the second transactions, the first tree root, and the zero-knowledge proof evidence in sequence; wherein, the first tree root is generated according to the Merkle tree root of each of the state trees; 所述通过所述跨链验证合约判断所述第一证明数据中的各所述第二交易的顺序与所存证的各所述第二交易信息是否匹配以验证所述第一证明数据中的各所述第二交易的顺序是否正确包括:The cross-chain verification contract is used to determine whether the sequence of each of the second transactions in the first proof data matches the stored information of each of the second transactions, so as to verify each of the first proof data. Whether the sequence of the second transaction is correct includes: 通过所述跨链验证合约根据各所述第二交易、所存储的第二树根计算第三树根,在所述第三树根与所述第一树根相同时,将所述第二树根的值更新为所述第一树根的值;以及,The third tree root is calculated 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, the second tree root is The value of the tree root is updated to the value of the first tree root; and, 通过所述跨链验证合约判断所述第一证明数据中的各所述第二交易的顺序与所存证的各所述第二交易信息是否匹配以验证所述第一证明数据中的各所述第二交易的顺序是否正确。Determine whether the sequence of each of the second transactions in the first certification data matches the stored second transaction information through the cross-chain verification contract, so as to verify each of the second transactions in the first certification data. Whether the order of the second transaction is correct. 5.根据权利要求1所述的方法,其特征在于,所述将按序的各所述第一交易的第一交易信息发送给其它各主链,以供其它各主链的主链节点通过所述预言机合约存证各所述第一交易信息包括:5 . The method according to claim 1 , wherein the first transaction information of each of the first transactions in sequence is sent to other main chains for the main chain nodes of other main chains to pass through. 6 . Each of the first transaction information stored in the oracle contract includes: 按序存储各所述第一交易的第一交易信息,根据各所述第一交易信息生成第四交易,将所述第四交易发送给其它各主链,以供其它各主链的主链节点通过所述预言机合约执行所述第四交易,在执行所述第四交易成功时存证各所述第一交易信息。Store the first transaction information of each of the first transactions in sequence, generate a fourth transaction according to each of the first transaction information, and send the fourth transaction to other main chains for the main chains of the other main chains The node executes the fourth transaction through the oracle contract, and stores the first transaction information when the execution of the fourth transaction is successful. 6.根据权利要求5所述的方法,其特征在于,所述通过所述预言机合约存证各所述第一交易信息包括:6. The method according to claim 5, wherein the depositing each of the first transaction information through the oracle contract comprises: 将各所述第一交易信息存证到所述预言机合约中;depositing each of the first transaction information into the oracle contract; 所述通过所述跨链验证合约判断所述第一证明数据中的各所述第二交易的顺序与所存证的各所述第二交易信息是否匹配以验证所述第一证明数据中的各所述第二交易的顺序是否正确包括:The cross-chain verification contract is used to determine whether the sequence of each of the second transactions in the first certification data matches the stored second transaction information, so as to verify each of the first certification data. Whether the sequence of the second transaction is correct includes: 通过所述跨链验证合约向所述预言机合约请求各所述第二交易信息;Request each of the second transaction information from the oracle contract through the cross-chain verification contract; 判断所述第一证明数据中的各所述第二交易的顺序与所存证的各所述第二交易信息是否匹配以验证所述第一证明数据中的各所述第二交易的顺序是否正确。Judging whether the sequence of each of the second transactions in the first certification data matches the information of each of the second transactions stored in the certificate to verify whether the sequence of each of the second transactions in the first certification data is correct . 7.根据权利要求1所述的方法,其特征在于,所述根据按序的各所述第二交易、所述零知识证明证据生成第一证明数据包括:7. The method according to claim 1, wherein the generating the first proof data according to each of the second transactions and the zero-knowledge proof evidence in sequence comprises: 根据各所述第二交易信息、所述零知识证明证据生成第一证明数据;generating first proof data according to each of the second transaction information and the zero-knowledge proof evidence; 所述通过所述跨链验证合约判断所述第一证明数据中的各所述第二交易的顺序与所存证的各所述第二交易信息是否匹配以验证所述第一证明数据中的各所述第二交易的顺序是否正确包括:The cross-chain verification contract is used to determine whether the sequence of each of the second transactions in the first certification data matches the stored second transaction information, so as to verify each of the first certification data. Whether the sequence of the second transaction is correct includes: 通过所述跨链验证合约判断所述第一证明数据中的各所述第二交易信息与所存证的各所述第二交易信息是否相同以验证所述第一证明数据中的各所述第二交易信息的顺序是否正确。Determine whether each of the second transaction information in the first certification data is the same as each of the second transaction information stored in the certificate through the cross-chain verification contract, so as to verify each of the second transaction information in the first certification data. 2. Whether the order of transaction information is correct. 8.根据权利要求1所述的方法,其特征在于,所述将按序的各所述第一交易的第一交易信息发送给其它各主链包括:8. The method according to claim 1, wherein the sending the first transaction information of each of the first transactions in sequence to other main chains comprises: 按序存储各所述第一交易的第一交易信息,并将各所述第一交易信息发送给其它各主链;各所述第一交易信息还用于供预言机在监测到初入网的第一主链节点时,将各所述第一交易信息发送给所述第一主链节点,以供所述第一主链节点通过所述预言机合约存证各所述第一交易信息。The first transaction information of each of the first transactions is stored in sequence, and each of the first transaction information is sent to other main chains; When the first main chain node is used, each of the first transaction information is sent to the first main chain node, so that the first main chain node can store the first transaction information through the oracle contract. 9.一种计算机设备,其特征在于,所述设备包括:9. A computer device, wherein the device comprises: 一个或多个处理器;one or more processors; 存储器,用于存储一个或多个程序,memory for storing one or more programs, 当所述一个或多个程序被所述一个或多个处理器执行时,使得所述一个或多个处理器执行如权利要求1-8中任一项所述的方法。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-8. 10.一种存储有计算机程序的存储介质,其特征在于,该程序被处理器执行时实现如权利要求1-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-8 is implemented.
CN202111661946.9A 2021-12-31 2021-12-31 Oracle multi-main chain cross-chain method, device and storage medium Active CN114202425B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111661946.9A CN114202425B (en) 2021-12-31 2021-12-31 Oracle multi-main chain cross-chain method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111661946.9A CN114202425B (en) 2021-12-31 2021-12-31 Oracle multi-main chain cross-chain method, device and storage medium

Publications (2)

Publication Number Publication Date
CN114202425A true CN114202425A (en) 2022-03-18
CN114202425B CN114202425B (en) 2025-01-24

Family

ID=80657620

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111661946.9A Active CN114202425B (en) 2021-12-31 2021-12-31 Oracle multi-main chain cross-chain method, device and storage medium

Country Status (1)

Country Link
CN (1) CN114202425B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115392919A (en) * 2022-09-01 2022-11-25 杭州复杂美科技有限公司 Verification method based on third-party prediction machine, computer equipment and storage medium
CN115392920A (en) * 2022-09-01 2022-11-25 杭州复杂美科技有限公司 Predictive machine-based authentication method, computer device, and storage medium
CN115567321A (en) * 2022-11-14 2023-01-03 安徽中科晶格技术有限公司 Chain-crossing system and method based on built-in preplan contract

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021042817A1 (en) * 2019-09-05 2021-03-11 创新先进技术有限公司 Block chain-based default asset processing method, apparatus, and electronic device
CN113139808A (en) * 2021-04-15 2021-07-20 张莹 Cross-chain asset transaction method and device based on prediction machine and storage medium
WO2021203739A1 (en) * 2020-04-08 2021-10-14 江苏复杂美科技有限公司 Blockchain rollback insuring method, device, and storage medium
CN113592475A (en) * 2021-08-02 2021-11-02 杭州复杂美科技有限公司 Cross-chain asset transfer method, computer device, and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021042817A1 (en) * 2019-09-05 2021-03-11 创新先进技术有限公司 Block chain-based default asset processing method, apparatus, and electronic device
WO2021203739A1 (en) * 2020-04-08 2021-10-14 江苏复杂美科技有限公司 Blockchain rollback insuring method, device, and storage medium
CN113139808A (en) * 2021-04-15 2021-07-20 张莹 Cross-chain asset transaction method and device based on prediction machine and storage medium
CN113592475A (en) * 2021-08-02 2021-11-02 杭州复杂美科技有限公司 Cross-chain asset transfer method, computer device, and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115392919A (en) * 2022-09-01 2022-11-25 杭州复杂美科技有限公司 Verification method based on third-party prediction machine, computer equipment and storage medium
CN115392920A (en) * 2022-09-01 2022-11-25 杭州复杂美科技有限公司 Predictive machine-based authentication method, computer device, and storage medium
CN115392919B (en) * 2022-09-01 2025-11-28 杭州复杂美科技有限公司 Verification method based on third-party prophetic machine, computer equipment and storage medium
CN115567321A (en) * 2022-11-14 2023-01-03 安徽中科晶格技术有限公司 Chain-crossing system and method based on built-in preplan contract
CN115567321B (en) * 2022-11-14 2023-03-03 安徽中科晶格技术有限公司 Chain-crossing system and method based on built-in preplan contract

Also Published As

Publication number Publication date
CN114202425B (en) 2025-01-24

Similar Documents

Publication Publication Date Title
CN110910138B (en) Block chain data supervision method and device
CN108848119B (en) Interaction method and device, system and electronic device across blockchain
CN114266665A (en) Contract multi-backbone cross-link method, device and storage medium
CN114202425A (en) Oracle multi-main chain cross-chain method, equipment and storage medium
AU2020279389A1 (en) Methods and apparatus for implementing state proofs and ledger identifiers in a distributed database
US12105735B2 (en) Asynchronous accounting method and apparatus for blockchain, medium and electronic device
CN110263035A (en) Block chain-based data storage, query method and device, and electronic equipment
CN115701078B (en) Cross-chain transaction processing method, device, electronic equipment and storage medium
CN110766410B (en) Trusted cross-chain event construction and verification method and device based on Merkle tree
CN111275438A (en) Consensus method, device, equipment and storage medium for block chain network
CN114283010B (en) Multi-main-chain crossing method based on multi-main-chain two-layer network state tree
JP2024505105A (en) Method and device for validating database query results
CN114386967B (en) Cross-chain asset transfer method, computer device, and storage medium
CN109005208B (en) Method and device for pushing information
WO2025139340A1 (en) Resource management method for blockchain system, blockchain node, and blockchain system
CN114219646A (en) Multi-main chain two-layer network state tree, multi-main chain cross-chain method
CN114138903B (en) Multi-main-chain cross-chain method, computer device and storage medium
CN111340481B (en) Data processing method, device and equipment based on multi-chain block chain network
CN111524011B (en) Parallel link consensus validation method, apparatus, and storage medium
US11706295B2 (en) System and a method implementing a directed acyclic graph (DAG) consensus algorithm via a gossip protocol
CN111524010B (en) Parallel chain consensus method, apparatus and storage medium
CN114037449A (en) Cross-chain asset transfer method, computer device, and storage medium
CN113837735B (en) Transaction method and device for digital currency chip card
CN113837734B (en) Methods and devices for offline loss reporting of digital currency chip cards
CN114553508B (en) Data access method and device

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20240725

Address after: 518110 Longfa road 428 Huayuan street B24 Huayuan street b23b Longhua Street Longyuan community Longhua Street Longhua District Shenzhen City Guangdong Province

Applicant after: Shenzhen Morning Intellectual Property Operations Co.,Ltd.

Country or region after: China

Address before: 310000 Room 702, 7th Floor, Building 6, East Software Park, No. 90 Wensan Road, Xihu District, Hangzhou City, Zhejiang Province

Applicant before: HANGZHOU FUZAMEI TECHNOLOGY Co.,Ltd.

Country or region before: China

GR01 Patent grant
GR01 Patent grant