Methods for proving and verifying data in blockchain, systems, and media
Patent Information
- Application Number
- HK32026123591
- Authority / Receiving Office
- HK · HK
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-10-15
- Filing Date
- 2026-05-18
- Publication Date
- 2026-08-28
Smart Images

Figure 00000020_0000 
Figure 00000020_0001 
Figure 00000021_0000
Abstract
Description
1. Specification of Methods, Systems, and Media for Proving and Verifying Data in a Blockchain This specification relates to the field of computer technology, and more particularly to a method for proving data in a blockchain, a method for verifying data in a blockchain, a computer system, and a computer-readable non-volatile storage medium. Background Technology Blockchains typically include three basic types: public blockchains, private blockchains, and consortium blockchains. In addition, there are various combinations of types, such as private blockchain + consortium blockchain, consortium blockchain + public blockchain, etc. Public blockchains have the highest degree of decentralization. In consortium blockchains or private blockchains, due to privacy protection needs, ordinary users other than the members of the consortium / private blockchain typically do not have access to all system data in the blockchain system. More specifically, ordinary users can usually only access the block headers of the generated blocks and specific data related to a certain external account they hold. Specific data may include, for example, transactions initiated by the external account, receipts corresponding to transactions initiated by the external account, and the variable values of state variables associated with the external account in the world state corresponding to any block. Thus, ordinary users often find it difficult to trust the legitimacy of block headers provided in consortium blockchains / private blockchains. This specification provides, in one or more embodiments, a method for proving data in a blockchain, a method for verifying data in a blockchain, a computer system, and a computer-readable non-volatile storage medium, which can improve ordinary users' trust in consortium blockchains / private blockchains while meeting privacy protection requirements. This specification provides a method for proving data in a blockchain, comprising: obtaining one or more blocks generated by a first blockchain; generating a zero-knowledge proof to prove the legitimacy of the first block header of the first block in the one or more blocks; sending a first transaction to a second blockchain, the first transaction including the zero-knowledge proof and the first block header information of the first block, and invoking a target smart contract in the second blockchain, the target smart contract being used to verify the zero-knowledge proof, and storing the first block header information in the second blockchain if the verification passes. This specification provides a method for verifying data in a blockchain, the method being executed by a blockchain node in a second blockchain, the method comprising: receiving a first transaction sent by a relay system, the first transaction including a zero-knowledge proof and first block header information of a first block generated by the first blockchain, the first transaction being used to invoke a target smart contract in the second blockchain, the zero-knowledge proof being used to prove the validity of the first block header of the first block;According to the first transaction, the target smart contract is executed to: verify the zero-knowledge proof, and if the verification passes, store the first block header information in the second blockchain. This specification provides a method for verifying data in a blockchain system, the method comprising: obtaining from the second blockchain the first block header information of a first block generated by the first blockchain and related to a target block, wherein the first block header information is stored in the second blockchain after the target smart contract in the second blockchain has passed the zero-knowledge proof verification, and the zero-knowledge proof is used to prove the validity of the first block header of the first block; obtaining the first block header of the first block from the first blockchain; and verifying whether the block header of the target block is valid based on the first block header and the first block header information. This specification provides a computer system including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps: acquiring one or more blocks generated by a first blockchain; generating a zero-knowledge proof to prove the validity of the first block header of the first block (HK 30136969 A 2) in the one or more blocks; sending a first transaction to a second blockchain, the first transaction including the zero-knowledge proof and the first block header information of the first block, and invoking a target smart contract in the second blockchain, the target smart contract being used to verify the zero-knowledge proof, and storing the first block header information in the second blockchain if the verification is successful. This specification provides a computer system including a memory, a processor, and a computer program stored in the memory and executable on the processor. The computer program is implemented as a blockchain node in a second blockchain. When the processor executes the computer program, it performs the following steps: receiving a first transaction sent by a relay system, the first transaction including a zero-knowledge proof and first block header information of a first block generated by a first blockchain, the first transaction being used to call a target smart contract in the second blockchain, the zero-knowledge proof being used to prove the validity of the first block header of the first block; executing the target smart contract according to the first transaction, to: verify the zero-knowledge proof, and, if the verification is successful, store the first block header information in the second blockchain. This specification also provides a computer system including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps: obtaining first block header information of a first block generated by a first blockchain related to a target block from the second blockchain, the first block header information being stored after the target smart contract in the second blockchain has successfully verified the zero-knowledge proof.In the second blockchain, the zero-knowledge proof is used to prove the validity of the first block header of the first block; the first block header of the first block is obtained from the first blockchain; and the validity of the block header of the target block is verified based on the first block header and the first block header information. This specification provides a relay system comprising: a data acquisition unit configured to acquire one or more blocks generated by a first blockchain; a proof generation unit configured to generate a zero-knowledge proof to prove the validity of the first block header of the first block in the one or more blocks; and a transaction processing unit configured to send a first transaction to the second blockchain, wherein the first transaction includes the zero-knowledge proof and the first block header information of the first block, and invokes a target smart contract in the second blockchain, the target smart contract being used to verify the zero-knowledge proof, and storing the first block header information in the second blockchain if the verification passes. This specification provides a blockchain node in a second blockchain, the blockchain node comprising: a transaction receiving unit configured to receive a first transaction sent by a relay system, the first transaction including a zero-knowledge proof and first block header information of a first block generated by a first blockchain, the first transaction being used to invoke a target smart contract in the second blockchain, the zero-knowledge proof being used to prove the validity of the first block header of the first block; and a transaction processing unit configured to execute the target smart contract according to the first transaction, thereby: verifying the zero-knowledge proof, and, if the verification passes, storing the first block header information in the second blockchain. This specification also provides a terminal device including a processor and a memory, the memory storing a computer program, the processor executing the computer program to implement the method described in any of the above embodiments. Finally, this specification provides a computer-readable non-volatile storage medium storing a computer program, the computer program being executed by a processor to implement the method described in any of the above embodiments. The technical solutions adopted in the embodiments of this specification can achieve at least one of the following beneficial effects: First, a zero-knowledge proof is generated based on one or more blocks generated by a first blockchain to prove the validity of the first block header of the first block in the one or more blocks; then, a first transaction is sent to a second blockchain, the first transaction including the zero-knowledge proof and the first block header information of the first block, the transaction being used to invoke a target smart contract in the second blockchain; finally, the second blockchain executes the target smart contract according to the first transaction, thereby verifying the zero-knowledge proof corresponding to the first block header information, and storing the first block header information in the second blockchain if the verification is successful. Thus, ordinary users can obtain the first block header information of the first block from the second blockchain and use the first block header information to verify...The first blockchain verifies the legitimacy of the first block or the block header of a target block preceding the first block provided to ordinary users, thereby increasing ordinary users' trust in the first blockchain. In this process, the first blockchain does not need to expose transaction, receipt, and state data from the first blockchain to the second blockchain, nor does it need to expose transaction, receipt, and state data that ordinary users do not have access to, thus meeting privacy protection requirements. HK 30136969 A 3 Brief Description of the Drawings To more clearly illustrate the technical solutions of the embodiments of this specification, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Figure 1 is a schematic diagram of deploying a smart contract in a blockchain system, provided by example in an embodiment of this specification. Figure 2 is a schematic diagram of calling a smart contract in a blockchain system, provided by example in an embodiment of this specification. Figure 3 is a schematic diagram of a data storage structure in a blockchain system, provided by example in an embodiment of this specification. Figure 4 is a system architecture diagram of the technical solution provided by example in an embodiment of this specification. Figure 5 is a flowchart of a method for proving data in a blockchain according to an embodiment of this specification. Figure 6 is a schematic diagram of Prover generating zero-knowledge proofs according to an embodiment of this specification. Figure 7 is another schematic diagram of Prover generating zero-knowledge proofs according to an embodiment of this specification. Figure 8 is a flowchart of a method for verifying data in a blockchain according to an embodiment of this specification. Figure 9 is a schematic diagram of a relay system according to an embodiment of this specification. Figure 10 is a schematic diagram of a blockchain node according to an embodiment of this specification. Figure 11 is a schematic diagram of a computer system according to an embodiment of this specification. Detailed Description: To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only some embodiments of this specification, not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification. Blockchain can also generally be described as a blockchain system or a blockchain network. As mentioned earlier, blockchains typically include three basic types: public blockchains, private blockchains, and consortium blockchains.(Blockchain). Besides these, there are various combinations, such as private blockchains + consortium blockchains, consortium blockchains + public blockchains, etc. Public blockchains offer the highest degree of decentralization. Typical examples of public blockchains are Bitcoin and Ethereum. Participants in a public blockchain (represented as blockchain nodes in the system) can read on-chain data as needed, participate in transaction execution, and compete for the right to record new blocks. Furthermore, participants can freely join and leave the public blockchain and perform related operations. In addition, ordinary users can use public blockchains as needed, such as writing or reading data, within the bounds of laws and regulations. For private blockchains, data writing permissions are controlled by a specific organization or institution, and data reading permissions are also regulated by that organization or institution. Simply put, a private blockchain can be a weakly centralized system, containing a relatively small number of blockchain nodes, and controlled by a specific organization or institution. This type of blockchain system is more suitable for internal use within a specific organization. Consortium blockchains are a type of blockchain system between public and private blockchains, achieving partial decentralization. In a consortium blockchain, any two different blockchain nodes may belong to different entities or organizations. Participants join the consortium blockchain through authorization, forming a stakeholder alliance to jointly maintain its operation. Whether public, private, or consortium blockchains, besides supporting the transfer of native assets between accounts on the blockchain (or blockchain system), such as transferring Bitcoin or Ethereum, they can also provide smart contract functionality. A smart contract on the blockchain is a program that can be triggered and executed by a transaction. Smart contracts can be defined in the form of contract code. In blockchain systems that support smart contracts, accounts can be divided into two types: contract accounts (CA) and externally owned accounts (EOA). External accounts typically refer to accounts registered by ordinary users in the blockchain system; contract accounts correspond to smart contracts and are used to store the contract code of the relevant smart contract and the values of the state variables defined in the smart contract, usually activated by transactions initiated by external accounts. Both external accounts and contract accounts are identified by account addresses. Account design is essentially a mapping from account addresses to account states. For any account's status, fields typically include, but are not limited to, nonce, balance, storage root, and codeHash. It's important to note that the nonce and balance fields exist in both external accounts and contract accounts (HK 30136969 A 4), while the codeHash and storage root fields are generally only valid for contract accounts. More specifically, for external accounts, the nonce...The value of nonce represents the number of transactions sent from the relevant account address; for contract accounts, the value of nonce can represent the number of other smart contracts created by the relevant smart contract. The value of balance represents the amount of a certain digital resource / token (Token) owned by the relevant account address. The value of storage Root is the hash value of the root node of a tree structure, such as an MPT tree, used to organize the storage structure of state variables in the relevant smart contract. The value of codeHash represents the hash value of the contract code of the relevant smart contract. For external accounts, since smart contracts are not included, the values of storage Root and codeHash fields can generally be empty strings or strings of all zeros. MPT stands for Merkle Patricia Tree, a tree structure that combines Merkle Tree and Patricia Tree (a more space-efficient trie). The Merkle tree algorithm can calculate a hash value for multiple transactions separately, then connect them pairwise and calculate the hash value again, until the top-level Merkle root. Some blockchain systems typically employ modified MPT trees, such as a 16-branch tree structure, often simply referred to as an MPT tree. Below, we first provide an illustrative example of the basic process of deploying and invoking smart contracts in a blockchain system. Taking Ethereum as an example, users can create and invoke complex logic within Ethereum, i.e., create and invoke smart contracts. Ethereum's core as a programmable blockchain system is the Ethereum Virtual Machine (EVM), which runs on every Ethereum node (i.e., a blockchain node). The EVM is a Turing-complete virtual machine, meaning that various complex logics can be implemented through it. Smart contracts published and invoked by users in Ethereum run on the EVM. In fact, the virtual machine directly runs virtual machine code (virtual machine bytecode, hereinafter referred to as "bytecode"). Smart contracts deployed on a blockchain system can be in bytecode form. Referring to Figure 1, Bob can create a transaction (Tx) for deploying a smart contract. The From field of this transaction can include Bob's account address, such as "0xf5e", the To field is null, and the Data field can include the contract code of the smart contract to be deployed, such as bytecode executable in the EVM. After this transaction and its corresponding digital signature, such as "0x68e12cf284…", are sent to Ethereum, if the digital signature of the transaction is verified in Ethereum, and Ethereum nodes reach a consensus on the transaction through the consensus mechanism, the Ethereum node, such as node 1's EVM…The transaction can then be executed to create the smart contract. After the smart contract is created, a corresponding contract account is generated in Ethereum, possessing a specific contract address. For example, "0x6f8ae93…" in Figure 1 represents the contract address of the created smart contract. Users can invoke the smart contract based on its contract address "0x6f8ae93…". Both the smart contract's code and account storage are stored in the contract account. The behavior of the smart contract is controlled by the contract code, while the smart contract's account storage preserves its state. In other words, the transaction used to deploy the smart contract creates a virtual account / contract account on the blockchain system containing both contract code and account storage. As mentioned earlier, in the transaction used to deploy the smart contract, the `data` field includes the smart contract's code, which can be bytecode executable in the EVM. Bytecode consists of a series of bytes, each byte representing an operation. For reasons of development efficiency and readability, developers can choose to write smart contract code in a high-level language instead of directly writing bytecode. Smart contract code written in a high-level language is then compiled into bytecode by a compiler. Ethereum supports a relatively large number of high-level languages, such as Solidity, Serpent, and LLL. Taking Solidity as an example, smart contract code written in Solidity is similar to classes in object-oriented programming languages. Multiple members can be declared within a single smart contract, such as state variables, functions, function modifiers, and events. The contract state of a smart contract includes the values of multiple state variables and is stored in the smart contract's account storage. Please refer to the following example of a simple smart contract code written in Solidity: `Contract SimpleStorage { string storedData; function set(string s) { storedData = s;} function get() constant returns (string) { return storedData; HK 30136969 A 5}}`. Combining code example 1 with Figure 2, still using Ethereum as an example, Bob can generate a transaction to call the smart contract "SimpleStorage". The `From` field of this transaction includes Bob's account address, the `To` field includes the contract address of "SimpleStorage" (e.g., "0x6f8ae93…"), and the `Data` field includes the method used to call "SimpleStorage".(For example, the function identifier "set" in a method function within "SimpleStorage") and parameters (for example, the value "hello" of the state variable storedData, which is of data type string); additionally, the transaction may include a value field to indicate the value of Ether that may be transferred in the transaction. After the transaction and its corresponding digital signature, such as "0x93af05eb02…", are sent to Ethereum, if the digital signature of the transaction is verified in Ethereum, and Ethereum nodes reach a consensus on the transaction through the consensus mechanism, the Ethereum nodes can execute "SimpleStorage" based on the transaction. After the Ethereum node completes the execution of "SimpleStorage" based on the transaction, the value of the state variable storedData may change; for example, the value of the state variable storedData may be modified to "hello". All execution records and states of the smart contract are stored on the blockchain system, so after the transaction used to call the smart contract is executed, the blockchain system stores an immutable and non-lost transaction certificate. For example, Alice can use a client to call a method function in the smart contract "SimpleStorage", such as "SimpleStorage.get()", to view the current value "hello" of storedData from an Ethereum node, such as node 6. The following section provides an example of the system data involved in the blockchain system and its corresponding storage structure. The system data that needs to be persistently stored in the blockchain system mainly includes two parts: block data and state data. Block data includes one or more blocks that increment in block height / block number / version number. A single block can be divided into a block body and a block header. Referring to Figure 3, for a block with block number N, the block header may include the hash value Prev Hash (or parent hash) of the previous block (i.e., the block with block number N-1), timestamp, block number BlockNum, state root, transaction root, receipt root, and nonce, etc. The block body includes a sequence of transactions, and may also include a sequence of receipts. A transaction in a blockchain system refers to a unit of task executed and recorded within the blockchain system. As mentioned earlier, a single transaction typically includes a From field, a To field, and a Data field, etc. The From field includes the account address that initiated the transaction (i.e., the sender's account address), and the To field may include...This includes the address of another account involved in / pointed to by the transaction (i.e., the recipient's account address). For ordinary transfer transactions, the account address included in the To field is the address of an external account; for transactions used to call smart contracts, the To field is the contract address of the called smart contract; for transactions used to deploy smart contracts, the To field is empty. For block number N in the blockchain system, based on the state data of block number N-1 (i.e., the state data corresponding to block N-1, i.e., the world state), the transaction sequence included in block number N can be executed to obtain the receipt sequence corresponding to the transaction sequence, as well as the state data with version number N. The blockchain system can manage state data using a tree structure, with different versions of state data corresponding to different tree structures. A leaf node of this tree structure stores the value of a state variable, and the directed path from the root node to the leaf node stores the key of the state variable; the aforementioned state variable can correspond to the account address of a contract account / external account, or it can be a state variable in a smart contract. The aforementioned tree structure can include, for example, MPT (Merkle Patricia Tree) or SMT (Sparse Merkle Tree), etc. The tree structure used to manage state data can include a state trie, where the hash value of the root node is stored in the State Root in the block header. A leaf node in the state trie can store the account state of an external account / contract account. The directed path from the root node to a leaf node in the state trie stores the account address of an external account / contract account, or part or all of the hash value calculated based on the account address. As mentioned earlier, the account state of a single account typically includes fields such as nonce, balance, storage Root, and codeHash. The nonce and balance fields exist in both external and contract accounts, while codeHash and storage Root are usually only valid for contract accounts. In blockchain systems that support smart contracts, the tree structure used to manage state data can also include a storage trie. The hash value of the root node of the storage trie is stored in the storage Root field of the contract account corresponding to the relevant smart contract, thus locking the contract state of the smart contract to the relevant contract account through the hash value. Similarly, a leaf node of the storage trie stores the value of a state variable defined in the smart contract.The directed path between the leaf nodes stores the state key of a state variable defined in the relevant smart contract. In other words, the partial information in the directed path from the root node to the leaf node of the storage trie, when arranged sequentially, can form the key of a state variable defined in the relevant smart contract, while the leaf node stores the value of that state variable. Please refer to Figure 3. For the state data corresponding to block number N, in the upper-level MPT structure, that is, in the state trie used to manage the state data corresponding to block N, for leaf node A1, the key a711335 is formed by sequentially combining the shared nibble a7 in the root node A8 (Extension Node), slot 1 in the intermediate node A7 (Branch Node), and key-end 1335 in the leaf node A1. That is, a711335 is the account address of an external account or part or all of the hash value calculated based on the account address. In this leaf node, balance=45.0ETH and nonce=n1 are stored. For leaf node A2, the key for the corresponding external account is a77d337, obtained by sequentially combining a7 from the shared nibble in root node A8 (Extension Node), slot 7 in intermediate node A7 (Branch Node), d3 from the shared nibbles in node A6 (Extension Node), slot 3 in intermediate node A5 (Branch Node), and key-end 7 in leaf node A2. This key stores balance=1.00WEI and nonce=n2. For leaf node A3, the key for the corresponding external account is a7f9365, obtained by sequentially combining a7 from the shared nibble in root node A8 (Extension Node), slot f in intermediate node A7 (Branch Node), and key-end 9365 in leaf node A3. This key stores balance=1.1ETH and nonce=n3. For leaf node A4, the connection is established through the shared nibble a7 in the root node A8 (Extension Node), slot 7 in the intermediate node A7 (Branch Node), and d3 in the shared nibbles of node A6 (Extension Node).The key a77d397, obtained by sequentially combining slot 9 in branch node A5 with key-end 7 in leaf node A4, constitutes the key of the contract account corresponding to this leaf node. This leaf node stores balance=0.12ETH, nonce=n4, codehash=c1, and storage root=s1, where s1 can be H(A10), i.e., the hash value of the root node A10 of the next-level MPT. Leaf nodes A1, A2, and A3 store the account status of external accounts, while leaf node A4 stores the account status of the contract account. For the contract account, it contains the next-level MPT, forming a Storage Trie used to manage the values of the state variables in the contract account. Please refer to Figure 3. In the next level of the MPT structure, which is the Storage Trie used to manage the contract state of a smart contract, for leaf node A11, 335b2e4 is obtained by sequentially combining slot 3 in the root node A10 (Branch Node) with the key-end 35b2e4 in leaf node A11. This key constitutes the key of the state variable corresponding to the leaf node. The leaf node stores "Zhang San_A=20", which means that the share of type A digital assets defined in the contract belonging to Zhang San is 20, that is, the balance of Zhang San's type A assets is 20. For leaf node A12, the key of the state variable corresponding to this leaf node is formed by sequentially combining slot 7 in the root node A10 (Branch Node) with c25988 in the key-end of leaf node A12. This leaf node stores "Li Si_B=50", which means that the share of type B digital assets defined in the contract belonging to Li Si is 50, that is, Li Si's balance of type B assets is 50. For leaf node A15, the key of the state variable corresponding to this leaf node is formed by sequentially combining slot f in the root node A10 (Branch Node) with a shared nibble in the intermediate node A13 (Extension Node) with a shared nibble with a slot 6 in the intermediate node A14 (Branch Node) with be33 in the key-end of leaf node A15. This leaf node stores "storedData=s". For leaf node A16, through slot f in the root node A10 (Branch Node) — through the shared nibble a in the intermediate node A13 (Extension Node) — intermediate node.Slot 9 of Branch Node A14—the key-end value 9365 in leaf node A16, sequentially combined to form fa99365, constitutes the key of the state variable corresponding to this leaf node. This leaf node stores "Wang Wu_A=35", for example, indicating that the share of type A digital assets belonging to Wang Wu as defined in the contract is 35, that is, Wang Wu's balance of type A assets is 35. In the node structure of the above MPT tree, the prefix is used to indicate the type of tree node. For example, 0 indicates an Extension Node containing an even number of shared nibbles, 1 indicates an Extension Node containing an odd number of shared nibble(s), 2 indicates a Leaf Node containing an even number of nibbles, and 3 indicates a Leaf Node containing an odd number of nibble(s). In the node structure of the above MPT tree, the hash value of the entire content of the next tree node is filled into the corresponding position of the previous tree node. Thus, in the data storage system, what is actually stored is the key-value mapping of the tree node itself, where the value of the tree node includes all the content stored in the tree node, and the key of the tree node is the hash value of the overall content of the tree node, not the key of its corresponding state variable. Thus, for the block header and MPT in the example of Figure 3 above, the actual stored key-value pairs of the tree nodes are as shown in Table 1 below: Table 1 Key Value (Logical illustration, and needs to be RLP encoded in persistent storage) H(A9) Prev Hash: , Nonce: , Timestamp: , Block Num: , State Root: H(A8), Transaction Root: , Receipt Root: ,… H(A8) prefix:0, shared nibble(s): a7, next node: H(A7) H(A7) 0: ,1: H(A1) ,2: ,3: ,4: ,5: ,6: ,7: H(A6) ,8: ,9: ,a: ,b: ,c: ,d: ,e: ,f: H(A3) , value: H(A1) prefix:2, Key-end:1335, balance: 45.0ETH, nonce: n1 H(A6) value: prefix:0, shared nibble(s):d3, next node: H(A5)H(A3) prefix:2, Key-end:9365, balance: 1.1ETH, nonce: n3 H(A5) 0: ,1: ,2: ,3: H(A2) ,4: ,5: ,6: ,7:,8: ,9: H(A4) ,a: ,b: ,c: ,d: ,e: ,f:, value: H(A2) prefix:0, Key-end:7, balance: 1.00WEI, nonce: n2 H(A4) prefix:0, Key-end:7, balance: 0.12ETH, nonce: n4, codehash:c1, storage root: H(10) H(A10) 0: ,1: ,2: ,3: H(A11) ,4: ,5: ,6: ,7: H(A12) ,8: ,9: ,a: ,b: ,c: ,d: ,e: ,f: H(A13) , value: H(A11) prefix:2, Key-end:35b2e4, value: Zhang San_A=20 H(A12) prefix:2, Key-end:c25988, value: Li Si_B=50 H(A13) prefix:1, shared nibble(s):a, next node: H(A14) H(A14) 0: ,1: ,2: ,3: ,4: ,5: ,6: H(A15) ,7:, 8: ,9: H(A16) ,a: ,b: ,c: ,d: ,e: ,f:, value: H(A15) prefix:2, Key-end: be33, value: storedData=s H(A16) prefix:2, Key-end: 9365, value: Wang Wu_A=35. In Table 1 above, H() represents hash calculation. The hash value of the next tree node is anchored to the previous tree node. In this way, through layer-by-layer hashing, the root hash of the state trie tree can be calculated, that is, the hash value of the root node A8 can be calculated. The root hash is locked to the State Root field included in the block header of block N. The state data corresponding to block N is obtained by executing the transaction sequence in block N based on the state data corresponding to block N-1. Therefore, the State Root included in the block header of block N actually locks the State Root corresponding to all blocks with block numbers not greater than N.The block header of block N contains state data and locks N-1 transaction sequences encompassing all blocks with block numbers no greater than N. For the block header of block N, the transaction sequences included in block N are locked via the Transaction Root, and the corresponding receipt sequences are locked via the Receipt Root. Referring to the previous section, the receipt sequence is obtained by executing the transaction sequences included in block N based on the state data corresponding to block N-1. The Transaction Root is the hash value of the root node of the Merkle tree calculated based on the transaction sequences, and the Receipt Root is the hash value of the root node of the Merkle tree calculated based on the receipt sequences. The State root, Transaction Root, and Receipt Root are core information of block N, used to verify the existence of transactions, receipts, and state variables. However, in consortium or private blockchains, due to privacy protection requirements, ordinary users other than the members of the consortium / private blockchain typically do not have access to all system data in the blockchain system. More specifically, ordinary users typically only have access to the block headers of the generated blocks and specific data associated with a particular external account they hold. This specific data may include, for example, transactions initiated by that external account, receipts for those transactions, and the values of state variables associated with that external account in the world data corresponding to any block. Thus, ordinary users holding external accounts find it difficult to trust the legitimacy of the block headers provided in consortium / private blockchains. More specifically, regarding the block header of block N provided to users by the blockchain system, users may suspect that the consortium / private blockchain nodes themselves have cheated, resulting in the following in the block header of block N: the Transaction Root is not a Merkle root calculated based on the valid transaction sequence included in block N; or the Receipt Root is not a Merkle root calculated based on the valid receipt sequence; or the State Root is not generated by executing the valid transaction sequence included in block N based on the state data corresponding to block N-1; or the Prev Hash is not the hash value of the block header of block N-1, etc. Because ordinary users find it difficult to trust the legitimacy of the block headers provided by the consortium / private blockchain, they may need to use the State Root, Transaction Root, Receipt Root, and related Merkle proofs in the block header to verify a transaction or a specific...When verifying the existence of a receipt or the value of a certain state variable in a consortium blockchain / private blockchain, it is difficult to ensure the correctness of the verification result. Therefore, this specification provides at least one method, computer system, and computer-readable non-volatile medium for proving and verifying data in a blockchain. First, based on one or more blocks generated by a first blockchain, a zero-knowledge proof is generated to prove the validity of the first block header of the first block in the one or more blocks. Then, a first transaction is sent to a second blockchain. This first transaction includes the zero-knowledge proof and the first block header information of the first block. This transaction is used to invoke a target smart contract in the second blockchain. Finally, the second blockchain executes the target smart contract according to the first transaction, thereby verifying the zero-knowledge proof corresponding to the first block header information. If the verification passes, the first block header information is stored in the second blockchain. In this way, ordinary users can obtain the first block header information of the first block from the second blockchain and use it to verify the validity of the block header of the first block or a target block preceding the first block provided to them by the first blockchain, thereby increasing the ordinary user's trust in the first blockchain. In this process, the first blockchain does not need to expose transaction, receipt, and state data from the first blockchain to the second blockchain, nor does it need to expose transaction, receipt, and state data that ordinary users do not have access to, thus meeting privacy protection requirements. Figure 4 is a system architecture diagram of the technical solution provided in the embodiments of this specification. Referring to Figure 4, the system architecture may include a first blockchain 10, a second blockchain 20, a relay system 30, and a terminal device 40. The first blockchain 10 may be a consortium blockchain or a private blockchain, and the second blockchain 20 may typically be a public blockchain. A target smart contract may be deployed in the second blockchain 20, and the contract code of the target smart contract integrates a verifier of a zero-knowledge proof system. The relay system 30 may integrate a prover of a zero-knowledge proof system. The zero-knowledge proof protocol used by the prover and verifier of the zero-knowledge proof system may include, but is not limited to, ZK-SNARKs or ZK-STARKs. The prover and verifier that may be used in the implementation of this specification will be described first by example below. The proof can typically run in a controlled environment provided by the relay system 30. This controlled environment can be a Zero-Knowledge Virtual Machine (ZKVM) or a Hardware Security Module (HSM). The HSM can be a standalone hardware device or a chip-based solution, such as a trusted platform.A zero-knowledge proof system's proof typically consists of two important components: a Trusted Platform Module (TPM) or a Trusted Execution Environment (TEE). ZKVM itself can ensure, to some extent, that the proof is not vulnerable to malware attacks or tampering. In certain technical scenarios, a ZKVM with the proof deployed can also run in an HSM, thereby improving the proof's security. The proof of a zero-knowledge proof system usually includes two important components: a computational circuit and a proof algorithm. Developers can configure the computational circuit according to the target problem to be proven. The computational circuit is a formal description of the proof logic corresponding to the target problem, defining the various constraints associated with the proof logic. These constraints specifically define the logical and / or arithmetic relationships that the various data (including private inputs and public statements) involved in the target problem must satisfy. The computational circuit can include R1CS (Rank-1 Constraint Systems) or AIR (Algebraic Intermediate Representation), etc., with each constraint corresponding to one or more logic gates / operations of the computational circuit. The target problem is "the block header of the first block generated by the first blockchain is valid". Therefore, the computing circuit should include verification logic designed according to the block generation algorithm of the first blockchain, which is used to verify whether the block header of the first block is valid based on relevant data. More specifically, it is used to verify that the block header of the first block is indeed generated by the first blockchain HK 30136969 A 9 based on some valid data based on relevant input data. Referring to the block header data structure of block N in the previous example, the block header of block N is generated based on the block header of block N-1, the world state corresponding to block N-1, and the transaction sequence included in the block body of block N. That is, the block generation process in the first blockchain is continuous. So, assuming that the block number of the first block is N, the input data of the computing circuit can include one or more of the following: the block header (denoted as header NM) of the second block (i.e., block NM) generated by the first blockchain, the world state corresponding to block NM (denoted as state NM), and one or more blocks continuously generated by the first blockchain (denoted as block N-M+1 to block N, or block N-M+1 to block N), where M is an integer not less than 1 and N is an integer greater than 0. The constraints defined by the verification logic and requiring verification can include constraints related to the validity of the first block header (i.e., the block header N of block N), and can include at least the following constraint a1.And / or a2: a1, Each transaction in Block N-M+1 to Block N conforms to the predetermined data structure required by the first blockchain; a2, The block header of any block in Block N-M+1 to Block N is generated by processing the block header of the previous block, the transaction sequence included in the block, and the world state corresponding to the previous block according to the block header generation algorithm of the first blockchain. For the constraint relation a2 in the aforementioned example, it can be decomposed into one or more of the following constraints a21~a27: a21, the state root calculated for state NM is the same as the state root in header NM; a22, for any block from Block N-M+1 to Block N, the transaction root in the block header of that block is calculated based on the transaction sequence included in that block; a23, for any block from Block N-M+1 to Block N, the state root in the block header of that block is generated based on the transaction sequence included in that block and the world state corresponding to the previous block; a24, for any block from Block N-M+1 to Block N, the receipt root in the block header of that block is generated based on the transaction sequence included in that block and the world state corresponding to the previous block; a25, for any block from Block N-M+1 to Block N, the timestamp in the block header of that block... The value of the field is located after the value of the Timestamp field in the block header of the previous block; a26, for any block from Block N-M+1 to Block N, the difference between the block number in the block header of this block and the block number in the block header of the previous block is 1; a27, for any block from Block N-M+1 to Block N, the value of the Prev Hash field in the block header of this block is the same as the hash value calculated from the block header of the previous block. In addition to the verification logic in the aforementioned example, the computation circuit may also include computation logic. The computation logic is used to define how to compute the output variables of the computation circuit to which it belongs. The output variables will be used as public statements for generating zero-knowledge proofs. The output variables may include, but are not limited to, the hash value of header N and / or the hash value of header NM. In other words, the constraints defined by the computational logic in the computational circuit can include: a3, calculating the hash value of header NM and / or the hash value of header N according to the target hash algorithm used to calculate the hash value of the block header in the first blockchain. Depending on the specific design of the computational circuit, this may apply when the computational circuit only includes verification logic and not computational logic.In the input data, the block header N of block N will be used as a public statement for generating the zero-knowledge proof. Furthermore, if the input data includes the block header NM of block NM, header NM will also be used as a public statement for generating the zero-knowledge proof. The remaining data in the input data that is not used as a public statement is considered private input and is not publicly disclosed. Correspondingly, when the computation circuit includes verification logic and computation logic, all data in the input data is considered private input. The hash value of header N (denoted as hash N) and / or the hash value of header NM (denoted as hash NM) obtained / computed by the computation logic will be used as a public statement for generating the zero-knowledge proof. Each verification step required in the verification logic (e.g., presented as one or more computer instructions) and each computation step required in the computation logic corresponds to different constraints. The process of verifying the validity of header N based on input data through verification logic is essentially the process by which the computational circuit determines whether the input data conforms to the "constraints related to the validity of header N"; the process of obtaining / computing output variables through computational logic is essentially the process by which the computational circuit "determines and outputs hash N and / or hash NM based on the constraint relationship a3 in the aforementioned example". Directly defining the computational circuit is very difficult and extremely error-prone, and this task can usually be accomplished using automated tools. For example, developers can write public code based on the target problem using various possible high-level languages. The public code defines the proof logic corresponding to the target problem, including at least the verification logic in the aforementioned example, the design of which depends on the block header generation algorithm of the first blockchain; in addition, it can also include the computational logic in the aforementioned example, the design of which depends on the target hash algorithm used in the first blockchain to calculate the hash value of the block header. Automated tools, such as the built-in compiler in ZKVM (as mentioned in the previous example), can be used to compile public code into computational circuits. These circuits can then be integrated with ZKVM's built-in proof algorithms to form a Prover, thus enabling the deployment of the Prover in a controlled environment like ZKVM. The proof algorithms are typically standardized implementations of cryptographic protocols (such as Groth16 in ZK-SNARKs), provided by publicly available algorithm libraries and built into controlled environments like ZKVM without requiring developers to write them themselves. Alternatively, without considering deployment efficiency, developers can also write their own implementations of the proof algorithms and deploy the Prover. After deploying the Prover, if the zero-knowledge proof protocol uses ZK-SNARKs, further steps can be taken...Trusted Setup generates a Proving Key and a Verification Key bound to the computational circuit. The Proving Key is distributed to the Prover, and the Verification Key is distributed to the Verifier. The Verifier can be integrated into the contract code of the target smart contract deployed on the second blockchain 20. After the target smart contract is deployed to the second blockchain 20, a transaction is sent to the second blockchain 20 to invoke the target smart contract, thus distributing the Verification Key to the Verifier within the target smart contract. In actual use of the Prover, if the input data of the computational circuit satisfies the constraints defined by the computational circuit, the computational circuit will output intermediate variables corresponding to the constraints based on the input data. Additionally, it may output variables that will be publicly declared. The proof algorithm can generate zero-knowledge proofs using witness information and public declarations; the aforementioned witness information includes private inputs in the input data and intermediate variables output by the computational circuit. If the input data does not satisfy the constraints defined by the computational circuit, the computational circuit may not output intermediate variables and directly report an error, or it may output invalid intermediate variables. The proof algorithm will be unable to generate a zero-knowledge proof based on the input data, or even if it generates a zero-knowledge proof based on invalid intermediate variables, the zero-knowledge proof will fail validity verification in the Verifier. Therefore, the relay system also cannot use input data that does not satisfy the constraints defined by the computational circuit to generate a zero-knowledge proof for the block header of the first block that can pass validity verification in the Verifier; that is, the relay system cannot use Prover to generate a valid zero-knowledge proof for the invalid block header of the first block. Depending on the specific design of the proof algorithm, the proof algorithm in Prover may also use information other than witness information and public statements to generate a zero-knowledge proof, or the public statements may include other information that is not part of the input data and output variables. For example, when a zero-knowledge proof protocol uses ZK-SNARKs, the generation of the zero-knowledge proof also requires the use of a Proving Key bound to the computational circuit. Furthermore, to prevent circuit substitution attacks—that is, to prevent intruders from replacing the Prover's computational circuit—the generation of the zero-knowledge proof can also calculate the current hash value of the computational circuit and use this current hash value as part of the public statement to generate the zero-knowledge proof. Because the computational circuit is defined based on the target problem to be proven, the Verifier...Only the validity of the zero-knowledge proof generated by the Prover needs to be verified through the corresponding public declaration. If the zero-knowledge proof is valid, it means that the public declaration is legal, and that the target problem corresponding to the public declaration has been successfully proven. In other words, the Verifier itself is only responsible for verifying the validity of the zero-knowledge proof and does not need to concern itself with the specific content of the target problem corresponding to the computation circuit. The following will mainly describe the process of proving and verifying data in the blockchain in conjunction with the system architecture shown in Figure 4 and the Prover and Verifier that may be used in the embodiments of this specification as exemplarily introduced above. Figure 5 is a flowchart of a method for proving data in the blockchain provided in an embodiment of this specification. This method exemplarily describes the process in which the relay system 30 cooperates with the second blockchain 20 to store the first block header information of the first block in the second blockchain 20 after confirming that the first block header of the first block generated by the first blockchain 10 is legal; in this process, the first blockchain 10 does not need to expose the transaction, receipt and state data in the first blockchain 10 to the second blockchain 20, thus meeting the requirements of privacy protection. As previously mentioned, the first blockchain 10 can be a consortium blockchain or a private blockchain; the second blockchain 20 is typically a public blockchain; the target smart contract is deployed in the second blockchain 20. Referring to Figure 5, the method may include, but is not limited to, some or all of the following steps S501 to S509. Step S501: The relay system obtains one or more blocks generated by the first blockchain. HK 30136969 A 11 The aforementioned one or more blocks can be a single block or multiple blocks. For ease of description, the one or more blocks will still be referred to as block N-M+1 to block N, where M is an integer not less than 1 and N is an integer greater than 0. The block header information of the genesis block in the first blockchain, including the block header of the genesis block or the hash value of the block header of the genesis block, can be pre-stored in the second blockchain, for example, pre-stored in the contract state of the target smart contract or other smart contracts that allow the target smart contract to call. The preceding block (i.e., the second block, block NM) of the aforementioned one or more blocks should be the block in the second blockchain corresponding to the most recently stored block header information of the first blockchain. When the aforementioned one or more blocks are a single block, and only relevant input data is required, satisfying the constraint relationship "a22, for any block from block N-M+1 to block N, the transaction root in the block header of that block is calculated based on the transaction sequence included in that block," that is, when the block header N of block N is considered valid, the relay system can directly execute the following steps.S505, otherwise, steps S503 and S505 can be executed sequentially. Step S503: Obtain the second block header and the corresponding second world state of the second block from the first blockchain, where the second block is the preceding block of the one or more blocks. The relay system can complete the execution of steps S501 and S503 by performing two rounds of information interaction with the blockchain nodes in the first blockchain, or it can complete the execution of steps S501 and S503 by a single round of information interaction. Step S505: Generate a zero-knowledge proof to prove the validity of the first block header of the first block in the one or more blocks. When executing step S505, the zero-knowledge proof can be generated based on the second block header (header NM) and second world state (state NM) obtained in step S503, and blocks N-M+1 to N obtained in step S501. The first block can be the last block in the one or more blocks, i.e., block N in blocks N-M+1 to N. The relay system can periodically execute some or all of the aforementioned steps S501 to S505 on blocks generated by the first blockchain according to a predetermined step size M. Thus, assuming M is 1, the relay system can sequentially use each block generated by the first blockchain as the first block and generate zero-knowledge proofs for it; assuming M is 100, the relay system can sequentially use blocks with block numbers 100, 200, 300, 400… as the first block and generate zero-knowledge proofs for them. As mentioned earlier, the relay system can integrate a zero-knowledge proof system's Prover. The Prover can run in a controlled environment provided by the relay system, which may include, for example, ZKVM or HSM. The Prover includes computational circuitry and a proof algorithm. The computational circuitry includes at least verification logic, and may also include computational logic. The relay system can use the target data as input to the computational circuit in Prover. The circuit's verification logic verifies the constraints related to the validity of header N, and outputs intermediate variables if the verification passes. The target data includes at least blocks N-M+1 to N (i.e., Block N-M+1 to Block N) consecutively generated in the first blockchain. Furthermore, the proof algorithm in Prover can generate zero-knowledge proofs based on public statements and witness information. The public statements include at least the first block header information of block N, and the witness information includes intermediate variables and privacy inputs included in the target data. The constraints related to the validity of header N may include, but are not limited to: a1, ...Each transaction conforms to the predetermined data structure required by the first blockchain; and / or, a22, for any block from Block N-M+1 to Block N, the transaction root in the block header is calculated based on the sequence of transactions included in the block. When performing the aforementioned step S503, the target data may also include header NM and state NM. The constraints related to the validity of header N may also include one or more of the following constraints: a23, the state root calculated for state NM is the same as the state root in header NM; a24, for any block from Block N-M+1 to Block N, the state root in the block header of that block is generated based on the transaction sequence included in that block and the world state corresponding to the previous block; a25, for any block from Block N-M+1 to Block N, the receipt root in the block header of that block is generated based on the transaction sequence included in that block and the world state corresponding to the previous block; a26, for any block from Block N-M+1 to Block N, the value of the Timestamp field in the block header of that block is located after the value of the Timestamp field in the block header of the previous block; a27, for any block from Block N-M+1 to Block N... For any block in the block header, the difference between the block number in the block header and the block number in the block header of the preceding block (HK 30136969 A 12) is 1; a27, for any block from Block N-M+1 to Block N, the value of the Prev Hash field in the block header is the same as the hash value calculated from the block header of the preceding block. When the constraint relationship related to the validity of header N is verified, as shown in Figure 6, if the computation circuit only includes verification logic and not computation logic, the computation circuit will output some intermediate variables (denoted as intermediate variables T1) corresponding to the verification logic to the input data. The proof algorithm can generate a zero-knowledge proof 1 to prove the validity of header N based on the input data of the computation circuit and the intermediate variables T1. In this case, in the input data of the computation circuit, header NM and header N will be used as public statements for generating zero-knowledge proof 1; that is, header NM is used as the second block header information, and header N is used as the first block header information. The intermediate variable T1 and other data in the input data besides header NM and header N are used as witnesses for generating zero-knowledge proof 1. When combined with header...If the constraint relationship related to the legality of N passes verification, referring to Figure 7, if the computational circuit also includes computational logic, it can obtain / calculate the hash value of header NM (denoted as hash NM) through the computational logic, i.e., constraint relationship a3 in the aforementioned example, and calculate the hash value of header N (denoted as hash N) through the computational logic, i.e., constraint relationship a3 in the aforementioned example. hash NM and hash N are output as output variables of the computational circuit. In addition, the computational circuit will also output some intermediate variables (denoted as intermediate variable T2) corresponding to the verification logic and computational logic to the input data. The proof algorithm can generate a zero-knowledge proof 2 to prove the legality of header N (more specifically, to prove the legality of hash N) based on the input data, intermediate variable T2, hash NM, and hash N. In this case, the output variables hash NM and hash N of the computational circuit are used as public statements for generating zero-knowledge proof 2, while intermediate variable T2 and input data are used as witnesses for generating zero-knowledge proof 2. The proof algorithm may also use other information in the process of generating 1 or 2. For example, when the proof algorithm uses ZK-SNARKs as the zero-knowledge proof protocol, the algorithm may need to use the Proving Key bound to the computational circuit in the process of generating 1 or 2. Furthermore, to avoid circuit substitution attacks, the algorithm may also need to calculate and use the current hash value (denoted as HASH x) of the computational circuit in the process of generating 1 or 2. The current hash value HASH x of the computational circuit is also a public statement used to generate 1 / 2. When the current hash value HASH x of the computational circuit is used as a public statement to generate 1 / 2, before using the Prover containing the computational circuit to generate 1 / 2, the target hash value (denoted as hash x) of the computational circuit can be pre-calculated and stored in the second blockchain. In the event of a circuit substitution attack, the current hash value HASH x of the computational circuit and the pre-calculated target hash value hash x may not be the same. The above example of generating zero-knowledge proofs via Prover is merely exemplary; other methods may also be used to generate zero-knowledge proofs. For example, a relay system may deploy a first Prover and a second Prover. The first Prover uses various implementations from the aforementioned examples to generate a first zero-knowledge proof to demonstrate the validity of header N generated by the first blockchain. The second Prover then combines the first zero-knowledge proof output by the first Prover with the proof used to generate the first zero-knowledge proof.The public declaration of the zero-knowledge proof is used as input data to generate a second zero-knowledge proof to prove the validity of the first zero-knowledge proof. Thus, if the second zero-knowledge proof passes validity verification, the validity of the first zero-knowledge proof is indirectly verified, which means that the header N generated by the first blockchain is indirectly proven to be legitimate. The contract code of the target smart contract in the second blockchain integrates the Verifier corresponding to the second Prover, used to verify the second zero-knowledge proof. In step S507, the relay system sends a first transaction to the second blockchain. This first transaction includes the zero-knowledge proof and the first block header information of the first block. This first transaction is used to invoke the target smart contract in the second blockchain. The From field of the first transaction may include the account address corresponding to the external account registered in the second blockchain by the relay system; the To field includes the account address of the contract account corresponding to the target smart contract, i.e., the contract address of the target smart contract; the Data field includes the calling method of the target smart contract (i.e., the identification information of the method function called in the target smart contract, such as F1) and the calling parameters (i.e., the parameters passed to the method function F1 called in the target smart contract). The calling parameters may include, but are not limited to, the zero-knowledge proof generated in step S505 and the first block header information of block NM. Continuing with the example in step S505 above, when the zero-knowledge proof is 1, the first block header information of block N may be header N. When the zero-knowledge proof is 2, the first block header information of block N may be the hash value of header N, i.e., hash N. In some embodiments, when the first block header information is hash N, the Data field of the first transaction may also include the block number of block N, i.e., include block number N. In addition, the first transaction may also include a Value field, the value of which represents the share of a certain resource (e.g., Ether in Ethereum) that may be transferred in the first transaction. More specifically, the value of the Value field can be the maximum share of a certain resource that the relay system allows the second blockchain to consume in order to execute the first transaction. Step S509: The blockchain node in the second blockchain executes the target smart contract according to the first transaction, implementing: verifying the zero-knowledge proof, and storing the first block header information in the second blockchain if the verification passes. As mentioned above, the contract code of the target smart contract integrates a Verifier. When the blockchain node of the second blockchain executes the first transaction, it can use the call parameters included in the Data field of the first transaction as input parameters for a method function, such as method function F1, included in the target smart contract, and execute method function F1 to call the target smart contract.The Verifier, integrated into the contract, enables the verification of zero-knowledge proofs included in the input parameters. The data required for the Verifier to verify the zero-knowledge proof depends on the public statements used to generate it. In one possible scenario, the public statements used to generate zero-knowledge proofs, such as 1 or 2, include the first block header information of block N and the second block header information of block NM, where block NM is the block in the second blockchain corresponding to the target block header information most recently stored in the first blockchain. In this case, the zero-knowledge proof, the first block header information of block N, and the target block header information most recently stored in the second blockchain can serve as input parameters for the Verifier. The Verifier verifies the zero-knowledge proof in the input parameters based on the first and target block header information. The target block header information may be the block header information of the genesis block pre-stored in the second blockchain, or it may be stored in the second blockchain only after the relay system and the second blockchain cooperate to confirm the validity of the second block header. If the zero-knowledge proof verification for the first block (block N) passes, the first block header information of block N can be stored in the second blockchain through the caller of the Verifier, such as the method function F1 in the aforementioned example, or through other method functions in the target smart contract. Afterward, the first block header information of block N is used as the target block header information that the second blockchain has recently stored in the first blockchain. The reason for using the target block header information that the second blockchain has recently stored in the first blockchain to verify the zero-knowledge proof is that, in the process of verifying the validity of the first block header of the first block through the verification logic of the computational circuit, it is essentially a process of determining whether the input data conforms to the "constraints related to the validity of header N" defined by the computational circuit. However, even if the input data satisfies the "constraints related to the validity of header N," it does not actually mean that header N is completely valid / correct. For example, after the first blockchain generates a correct block 300, the first blockchain / relay system might provide the block header of a forged block 300 and the world state corresponding to the forged block 300. Based on this, forged blocks 301 through 400 are generated by sequentially executing 100 correct transaction sequences. In this case, when the block header of the forged block 300, the world state corresponding to the forged block 300, and the forged blocks 301 through 400 are used as target data, this target data might still satisfy the "constraints related to the legality of header N," thereby generating a block 400 that can be used to prove forgery.The zero-knowledge proof is valid only if the second block header information is identical to the target block header information. This prevents the first blockchain or relay system from using a forged second block header to generate a valid zero-knowledge proof that proves the first block header is valid. Referring to the previous description, the second blockchain may store the target hash value (hash x) of the computation circuit included in the Prover. In another possible scenario, the public statement used to generate zero-knowledge proofs such as 1 or 2 may also include the current hash value (hASH x) of the computation circuit. In this case, the input parameters of the Verifier may also include the target hash value (hash x) of the computation circuit pre-stored in the second blockchain. The Verifier can then verify zero-knowledge proofs such as 1 or 2 based on the target hash value (hash x), the target block header information, and the first block header information. Thus, a zero-knowledge proof, such as 1 or 2, can pass verification only if the target hash value `hash x` is the same as the current hash value `HASH x`, thereby preventing circuit substitution attacks. Referring to the preceding text, the second blockchain may also store a Verification Key bound to the computational circuit. When generating a zero-knowledge proof, such as 1 or 2 in the aforementioned example, using a Proving Key bound to the computational circuit (HK 30136969 A 14), the Verifier needs to use the Verification Key to verify 1 or 2. Referring to the preceding text, the first block header information of the first block can be the block header `header N` of the first block, or it can be the hash value `hash N` of the block header. The block header data is relatively large; directly storing the second block header of the second block in the second blockchain would cause the relay system to spend more money purchasing digital resources. Therefore, as a preferred implementation, the first block header information can be the hash value `hash N` of the first block header. The first block header information can be stored in the contract state of the target smart contract, or it can be stored in other ways, such as in the contract state of other smart contracts that the target smart contract is allowed to call. When the first block header information is the hash value of the first block header and the Data field of the first transaction includes the block number of the first block, such as block number N, the block number of the first block and the hash value of the first block header can be stored together in the second blockchain. Through some or all of the aforementioned steps S501 to S509, the first blockchain's information is processed in the second blockchain.After the first block header information of the first block is generated and stored, ordinary users can use the first block header information as needed to verify the legality of the block headers of any block preceding the first block provided to the user by the first blockchain. It is understandable that by repeatedly executing the aforementioned steps S501-S509, the second blockchain, for example, can store the block header information of each of the multiple blocks generated by the first blockchain in the contract state of the target smart contract deployed on the second blockchain. More specifically, after pre-storing the block header information of the genesis block in the first blockchain to the second blockchain, by repeatedly executing some or all of the aforementioned steps S501-S509, the second blockchain may sequentially store the block header information of multiple blocks such as block M, 2*M, 3*M, 4*M, etc., from the first blockchain. In some embodiments, if the zero-knowledge proof generated for block N fails verification, the transaction receipt / receipt generated by the second blockchain for the first transaction may include an event indicating that the zero-knowledge proof failed verification. The relay system can then use the correct target data to generate a new zero-knowledge proof for block N based on this event. Figure 8 is a flowchart of a method for verifying data in a blockchain provided in an embodiment of this specification. This method exemplarily describes the process by which a terminal device collaborates with a first blockchain 10 and a second blockchain 20 to support ordinary users in verifying the legality of the block header of a target block provided by the first blockchain to the terminal device. Step S801: The terminal device obtains the first block header information of the first block generated by the first blockchain, which is related to the target block, from the second blockchain. The first block header information is stored in the second blockchain after the target smart contract in the second blockchain has passed the zero-knowledge proof verification. The zero-knowledge proof is used to prove the legality of the first block header of the first block. The terminal device can send a second transaction to the second blockchain. This second transaction is used to invoke the target smart contract, for example, by invoking method function F2 within the target smart contract. The second transaction may include the block number of the target block to which the block header to be verified belongs. The second blockchain can execute the target smart contract based on the second transaction, for example, by executing method function F2 within the target smart contract. This allows the first block header information to be determined from the second blockchain based on the block number of the target block, where the block number of the first block corresponding to the first block header information is not less than the block number of the target block. Continuing the previous example, by repeatedly executing the method shown in steps S501-509, the contract state of the target smart contract may store the block header information of multiple blocks generated by the first blockchain, such as blocks 0, M, 2*M, 3*M, 4*M, etc. Assume the block number of the target block to which the target block header to be verified belongs is 4*M-K+1, where the value of K is not greater than...M. Referring to the block header information storage method described above, the target smart contract can, based on the block number 4*M-K+1 of the target block, select the block header information corresponding to a block with a block number not less than 4*M-K+1 from the various block header information stored by the second blockchain on the first blockchain, and use it as the first block header information of the first block to be returned. For example, a block header information containing or corresponding to a block number of 4M can be returned to the terminal device as the first block header information. The process of obtaining the first block header information from the second blockchain described above is exemplary, and the terminal device may also obtain the first block header information through other means. For example, the terminal device can obtain multiple block header information stored by the second blockchain on the first blockchain according to the contract state of the target smart contract and arranged in order of storage time by calling the query interface of a blockchain node in the second blockchain; based on the block number of the target block and the preset step size M, the first block header information and the block number of the first block corresponding to the first block can be determined from these multiple block header information. When the block number of the first block is the same as the block number of the target block, the terminal device can then execute step S8031, whereby the terminal device obtains the first block header of the first block from the first blockchain. When the block number of the first block is greater than the block number of the target block, the terminal device can execute step S8033, whereby the terminal device obtains the K block headers of the K consecutive blocks from the target block to the first block from the first blockchain. In steps S8031 and S8033, the terminal device can directly access the first blockchain to obtain the first block header or the K block headers of the K blocks; alternatively, the terminal device can indirectly access the first blockchain through a relay system to obtain the first block header of the first block or the K block headers of the K blocks. For example, the terminal device can send a data query request to the relay system, the data query request indicating the block number of the target block and / or the block number of the first block. For example, the data query request may include block number 4*M-K+1 and block number 4*M. Correspondingly, the relay system can respond to the data query request by obtaining the K block headers of K blocks with block numbers 4*M-K+1 to 4*M from the first blockchain system and returning the K block headers to the terminal device. After the terminal device completes the aforementioned step S8031 or step S8033, it can then proceed to step S805 to verify whether the block header of the target block is valid based on the first block header and the first block header information. Referring to the foregoing, the first block header information can be the block header of the first block, or it can be a block header of the first block.The hash value of the block header. If the first block header information is not a hash value, it can be determined whether the first block header from the first blockchain is the same as the first block header information; otherwise, the block header of the target block is determined to be invalid. If the first block header information is a hash value, the hash value of the first block header from the first blockchain can be calculated, and it can be determined whether the calculated hash value is the same as the first block header information; otherwise, the block header of the target block is determined to be invalid. If the block number of the first block is greater than the block number of the target block, i.e., when the terminal device executes the aforementioned step S8033, the terminal device can further execute the following step S807 based on the aforementioned step S805: For any two adjacent block headers among the K block headers, determine whether the hash value of the preceding block header is contained in the parent hash field of the following block header; otherwise, the block header of the target block is determined to be invalid. The main reason ordinary users focus on the legitimacy of the block header of a target block provided by the first blockchain is usually because they may need to verify the existence or validity of target data (such as the value of a transaction, receipt, or state variable) associated with the target block to which the target block header belongs within the first blockchain. Therefore, after the block header of the target block to be verified passes legitimacy verification on the terminal device, the terminal device may also obtain the Merkle path corresponding to the target data from the first blockchain based on the block number of the target block and the target data to be verified. Then, based on the block header of the target block and the Merkle path, it verifies the existence of the target data in the first blockchain. For example, when the target data is a transaction / receipt, the terminal device can calculate the hash value of the root node of the corresponding Merkle tree based on the Merkle path and the target data, and then obtain the Transaction Root / Receipt Root from the block header of the target block. If this hash value is the same as the Transaction Root / Receipt Root, the target data passes the existence verification. When the target data is the value of a state variable, the terminal device can calculate the hash value of the root node of the corresponding state trie based on the Merkle path and the target data. Then, it obtains the State Root from the block header of the target block. If the hash value is the same as the State Root, the target data passes the existence verification. Based on the same concept as the aforementioned method embodiments, this specification also provides a relay system 30. Referring to FIG9, the relay system 30 includes: a data acquisition unit 301 configured to acquire one or more blocks generated by the first blockchain; and a proof generation unit 303 configured to generate zero-knowledge proofs for proving the existence of the one or more blocks.The first block header of the first block in the first block is valid; the transaction processing unit 305 is configured to send a first transaction to the second blockchain, wherein the first transaction includes the zero-knowledge proof and the first block header information of the first block, and calls a target smart contract in the second blockchain, the target smart contract being used to verify the zero-knowledge proof, and if the verification passes, storing the first block header information in the second blockchain. Based on the same concept as the foregoing method embodiments, this specification embodiment also provides a blockchain node 201 in the second blockchain 20. Referring to Figure 10, the blockchain node 201 includes: a transaction receiving unit 2011, configured to receive a first transaction sent by a relay system, the first transaction including a zero-knowledge proof and the first block header information of a first block generated by the first blockchain, the first transaction being used to call a target smart contract in the second blockchain, the zero-knowledge proof being used to prove the validity of the first block header of the first block; and a transaction processing unit 2013, configured to execute the target smart contract according to the first transaction, thereby: verifying the zero-knowledge proof, and, if the verification is successful, storing the first block header information in the second blockchain. Based on the same concept as the aforementioned method embodiments, this specification also provides a terminal device, including a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the method for verifying data in the blockchain provided in any embodiment of this specification, executed by the terminal device. For ease of description, the above devices or equipment are described separately by function into various units / modules. Of course, in implementing this specification, the functions of each module / unit can be implemented in one or more software and / or hardware. This specification also provides a computer-readable non-transitory storage medium storing a computer program that, when executed by a processor, can be used to perform one or more steps of one or more methods described or illustrated herein, or to provide the functionality described or illustrated herein. Here, one or more computer-readable non-transitory storage media may include one or more semiconductor-based or other integrated circuits (ICs) (e.g., field-programmable gate arrays (FPGAs) or application-specific integrated circuits (ASICs)), hard disk drives (HDDs), hybrid hard disk drives (HHDs), optical disks, optical disk drives (ODDs), magneto-optical disks, magneto-optical disk drives, floppy disks, floppy disk drives (FDDs), magnetic tape, solid-state drives (SSDs), RAM drives, secure digital cards or drives, any other suitable computer-readable non-transitory storage media, or any suitable combination of two or more of these, where appropriate.The properties can be volatile, non-volatile, or a combination of volatile and non-volatile, where appropriate. This specification also provides a computer system. Figure 11 illustrates an exemplary computer system 1000. In a particular embodiment, one or more computer systems 1000 perform one or more steps of one or more methods described or illustrated herein. In a particular embodiment, one or more computer systems 1000 provide the functionality described or illustrated herein. In a particular embodiment, software running on one or more computer systems 1000 performs one or more steps of one or more methods described or illustrated herein, or provides the functionality described or illustrated herein. Specific embodiments include one or more portions of one or more computer systems 1000. Here, references to a computer system may include, where appropriate, a computing device, and vice versa. Furthermore, references to a computer system may include one or more computer systems, where appropriate. This disclosure contemplates any suitable number of computer systems 1000. This disclosure envisions computer systems 1000 taking any suitable physical form. By way of example and not limitation, computer system 1000 may be an embedded computer system, a system-on-a-chip (SOC), a single-board computer system (SBC) (e.g., a computer-on-module (COM) or system-on-module (SOM)), a desktop computer system, a laptop or notebook computer system, an interactive kiosk, a mainframe, a computer system network, a mobile phone, a personal digital assistant (PDA), a server, a tablet computer system, or a combination of two or more of these. Where appropriate, computer system 1000 may include one or more computer systems 1000; single or distributed; spanning multiple locations; spanning multiple machines; spanning multiple data centers; or residing in the cloud, which may include one or more cloud components in one or more networks. Where appropriate, one or more computer systems 1000 may perform one or more steps of one or more methods described or illustrated herein without substantial spatial or temporal limitations. By way of example and not limitation, one or more computer systems 1000 may perform one or more steps of one or more methods described or illustrated herein in real time or in batch mode. Where appropriate, one or more computer systems 1000 may perform one or more steps of one or more methods described or illustrated herein at different times or at different locations. In a particular embodiment, the computer system 1000 includes a processor 1002, a memory 1004, a storage 1006, an input / output (I / O) interface 1008, a communication interface 1010, and a bus 1012. Although this disclosure describes and illustrates a particular arrangement...This disclosure contemplates a specific computer system having a specific number of specific components, but it also contemplates any suitable computer system having any suitable number of any suitable components in any suitable arrangement. In a particular embodiment, processor 1002 includes hardware for executing instructions, such as instructions constituting a computer program. By way of example and not limitation, in order to execute instructions, processor 1002 may retrieve (or fetch) instructions from internal registers, internal caches, memory 1004, or memory 1006; decode and execute them; and then write one or more results to internal registers, internal caches, memory 1004, or memory 1006. In a particular embodiment, processor 1002 may include one or more internal caches for data, instructions, or addresses. This disclosure contemplates processor 1002 including any suitable number of any suitable internal caches where appropriate. By way of example and not limitation, processor 1002 may include one or more instruction caches, one or more data caches, and one or more translation back buffers (TLBs). Instructions in the instruction cache may be copies of instructions in memory 1004 or memory 1006, and the instruction cache may accelerate the retrieval of those instructions by processor 1002. Data in the data cache may be copies of data in memory 1004 or memory 1006 for instruction operations executed at processor 1002; results of previous instructions executed at processor 1002 for subsequent instructions executed at processor 1002 to access or write to memory 1004 or memory 1006; or other suitable data. The data cache may accelerate read or write operations of processor 1002. The TLB may accelerate virtual address translation of processor 1002. In a particular embodiment, processor 1002 may include one or more internal registers for data, instructions, or addresses. This disclosure contemplates that processor 1002 may include any suitable number of any suitable internal registers where appropriate. Where appropriate, processor 1002 may include one or more arithmetic logic units (ALUs), may be a multi-core processor, or may include one or more processors 1002. Although this disclosure describes and illustrates specific processors, any suitable processor is contemplated herein. In a particular embodiment, memory 1004 includes main memory for storing instructions to be executed by processor 1002 or data to be operated by processor 1002. By way of example and not limitation, computer system 1000 may load instructions from memory 1006 or another source (e.g., another computer system 1000) into memory 1004. Processor 1002 may then retrieve instructions from memory.Memory 1004 is loaded into an internal register or internal cache. To execute instructions, processor 1002 can retrieve instructions from the internal register or internal cache and decode them. During or after instruction execution, processor 1002 can write one or more results (which may be intermediate or final results) to the internal register or internal cache. Processor 1002 can then write one or more of these results to memory 1004. In a particular embodiment, processor 1002 executes only the instructions in one or more internal registers, internal caches, or memory 1004 (as opposed to memory 1006 or elsewhere) and operates only on the data in one or more internal registers, internal caches, or memory 1004 (as opposed to memory 1006 or elsewhere). One or more memory buses (each memory bus may include an address bus and a data bus) couple processor 1002 to memory 1004. As described below, bus 1012 may include one or more memory buses. In a particular embodiment, one or more memory management units (MMUs) reside between processor 1002 and memory 1004 and facilitate access to memory 1004 requested by processor 1002. In a particular embodiment, memory 1004 includes random access memory (RAM). Where appropriate, the RAM may be volatile memory. Where appropriate, the RAM may be dynamic RAM (DRAM) or static RAM (SRAM). Furthermore, where appropriate, the RAM may be single-port or multi-port RAM. This disclosure contemplates any suitable RAM. Where appropriate, memory 1004 may include one or more memories 1004. Although this disclosure describes and illustrates specific memories, this disclosure contemplates any suitable memory. In a particular embodiment, memory 1006 includes mass storage for data or instructions. By way of example and not limitation, memory 1006 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, storage 1006 may include removable or non-removable (or fixed) media. Where appropriate, storage 1006 may be internal or external to computer system 1000. In a particular embodiment, storage 1006 is a non-volatile solid-state memory. In a particular embodiment, storage 1006 includes read-only memory (ROM). Where appropriate, the ROM may be a mask-programmable ROM, a programmable ROM (PROM), an erasable PROM (EPROM), or an electrically erasable PROM.(EEPROM), Electrically Modifiable ROM (EAROM), or flash memory, or a combination of two or more of these. This disclosure contemplates a large-capacity storage 1006 in any suitable physical form. Where appropriate, storage 1006 may include one or more storage control units that facilitate communication between processor 1002 and storage 1006. Where appropriate, storage 1006 may include one or more storage units 1006. Although this disclosure describes and illustrates specific storage, this disclosure contemplates any suitable storage. In a particular embodiment, I / O interface 1008 includes hardware, software, or both, providing one or more interfaces for communication between computer system 1000 and one or more I / O devices. Where appropriate, computer system 1000 may include one or more of these I / O devices. One or more of these I / O devices can enable communication between a person and computer system 1000. By way of example and not limitation, I / O devices may include keyboards, keypads, microphones, monitors, mice, printers, scanners, speakers, still cameras, styluses, graphics tablets, touchscreens, trackballs, cameras, other suitable I / O devices, or combinations of two or more of these devices. I / O devices may include one or more sensors. This disclosure contemplates any suitable I / O devices and any suitable I / O interface 1008 for them. Where appropriate, I / O interface 1008 may include one or more devices or software drivers that enable processor 1002 to drive one or more of these I / O devices. Where appropriate, I / O interface 1008 may include one or more I / O interfaces 1008. Although this disclosure describes and illustrates specific I / O interfaces, this disclosure contemplates any suitable I / O interface. In a particular embodiment, communication interface 1010 includes hardware, software, or both, providing one or more interfaces for communication (e.g., packet-based communication) between computer system 1000 and one or more other computer systems 1000 or one or more networks. By way of example and not limitation, the communication interface 1010 may include a network interface controller (NIC) or network adapter for communicating with Ethernet or other wired networks, or a wireless NIC (WNIC) or wireless adapter for communicating with wireless networks such as Wi-Fi networks. This disclosure contemplates any suitable network and any suitable communication interface 1010 for that network. By way of example and not limitation, the computer system 1000 may communicate with ad hoc networks, personal area networks, etc.The computer system 1000 can communicate with one or more portions of a PAN, LAN, WAN, MAN, or the Internet, or a combination of two or more of these. One or more portions of these networks can be wired or wireless. As an example, the computer system 1000 can communicate with a wireless PAN (WPAN) (e.g., Bluetooth WPAN), a Wi-Fi network, a Wi-Fi Max network, a cellular telephone network (e.g., a Global System for Mobile Communications (GSM) network), or other suitable wireless networks, or a combination of two or more of these networks. Where appropriate, the computer system 1000 may include any suitable communication interface 1010 for any of these networks. Where appropriate, the communication interface 1010 may include one or more communication interfaces 1010. Although specific communication interfaces are described and illustrated in this disclosure, any suitable communication interface is contemplated in this disclosure. In a particular embodiment, the bus 1012 includes hardware, software, or both that couple components of the computer system 1000 to each other. By way of example and not limitation, bus 1012 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), an HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an INFINIBAND interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCIe) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or another suitable bus, or a combination of two or more of these buses. Where appropriate, bus 1012 may include one or more buses 1012. Although this disclosure describes and illustrates specific buses, this disclosure contemplates any suitable bus or interconnect. It should also be noted that the terms “comprising,” “including,” or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, product, or apparatus that includes said element. The various embodiments in this specification are described in a progressive manner; similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system implementation...For example, since it is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be referred to in the description of the method embodiment. The above description is only an embodiment of this specification and is not intended to limit this specification. For those skilled in the art, this specification can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this application. HK 30136969 A 1 Claims 1. A method for proving data in a blockchain, the method comprising: obtaining one or more blocks generated by a first blockchain; generating a zero-knowledge proof for proving the validity of a first block header of a first block in the one or more blocks; sending a first transaction to a second blockchain, the first transaction including the zero-knowledge proof and the first block header information of the first block, and for invoking a target smart contract in the second blockchain, the target smart contract being used to verify the zero-knowledge proof, and storing the first block header information in the second blockchain if the verification is successful. 2. 1. The method according to claim 1, wherein the first block header information is the first block header; or, the first block header information is a hash value calculated from the first block header. 2. The method according to claim 1, wherein the one or more blocks are a single block; or, the one or more blocks are multiple blocks. 3. The method according to claim 1, wherein generating a zero-knowledge proof includes: verifying a constraint relationship related to the legality of the first block header using target data as input data through a computing circuit, and outputting an intermediate variable if the verification passes, wherein the target data includes the one or more blocks; generating a zero-knowledge proof based on a public statement and witness information, wherein the public statement includes the first block header information, and the witness information includes the intermediate variable and privacy inputs included in the target data. 4. The method according to claim 4, wherein the constraint relationship includes: each transaction in the one or more blocks has a predetermined data structure that conforms to the requirements of the first blockchain. 5. The method according to claim 4, wherein the constraint relationship includes: the transaction root in the block header of any block in the one or more blocks is calculated based on the transaction sequence contained in that block. 7. The method according to claim 4, wherein the target data further comprises: a second block header of the second block and a second world state corresponding to the second block, the second block being the preceding block of the one or more blocks; wherein the constraint relationship comprises: a state root calculated from the second world state being the same as the state root in the second block header; and any i-th state in the one or more blocks.The state root in the block header of each block is generated based on the transaction sequence included in the i-th block and the world state corresponding to the previous block of the i-th block. 8. The method of claim 7, wherein the public statement further includes the second block header information of the second block. 9. The method of claim 1, wherein the target smart contract is configured to verify the zero-knowledge proof based on the first block header information and the latest target block header information stored in the second blockchain for the first blockchain. 10. The method of claim 4, wherein the public statement further includes the current hash value of the computing circuit. 11. The method of claim 10, wherein the target smart contract is configured to verify the zero-knowledge proof based on the first block header information, the latest target block header information stored in the second blockchain for the first blockchain, and the target hash value of the computing circuit pre-stored in the second blockchain. 12. The method of claim 4, wherein the computing circuit is further configured to, upon successful verification, output at least a portion of the information included in the public statement. 13. According to claim 4, the computing circuit is compiled from publicly available code, which corresponds to the block generation algorithm of the first blockchain. HK 30136969 A 2 14. According to claim 1, the method is executed through a relay system, which has a communication connection with at least one blockchain node in the first blockchain. 15. According to any one of claims 1-14, the second blockchain is a public blockchain, and the first blockchain is a consortium blockchain or a private blockchain. 16. A method for verifying data in a blockchain, the method being executed through a blockchain node in a second blockchain, the method comprising: receiving a first transaction issued by a relay system, the first transaction including a zero-knowledge proof and first block header information of a first block generated by the first blockchain, the first transaction being used to call a target smart contract in the second blockchain, the zero-knowledge proof being used to prove the validity of the first block header of the first block; executing the target smart contract according to the first transaction to: verify the zero-knowledge proof, and, if the verification passes, store the first block header information in the second blockchain. HK 30136969 A 1 Instruction Manual Attachments Figure 1 Figure 2 HK 30136969 A 2 Figure 3 HK 30136969 A 3 First Blockchain 10 Relay System 30 Second Blockchain 20 Terminal Device 40 Verifier Target Smart Contract Prover ZKVM Proofer Verifier Figure 4 Figure 5 HK 30136969 A 4Head N–M, State N–M, and Block N–M+1 to Block N Verification logic calculation circuit intermediate variable T1 Proof algorithm Head NM and Block N block header Head N are used to generate zero-knowledge proof Proof 1 public statement prover Proof 1 Figure 6 Head NM, State NM, and Block N–M+1 to Block N Verification logic calculation logic intermediate variable T2, Hash N–M and Hash N Proof algorithm The hash value of Head NM determined by the calculation logic Hash NM, and the hash value of Block N block header Head N Hash N are used to generate zero-knowledge proof Proof 2 public statement calculation circuit prover Proof 2 Figure 7 HK 30136969 A 5 Figure 8 Figure 9 HK 30136969 A 6 Figure 10 Computer system 1000 Processor 1002 I / O interface 1008 Memory 1004 Storage 1006 Communication interface 1010 Figure 11 HK 30136969 A
