Blockchain system, operating method, electronic device, and storage medium

CN116938522BActive Publication Date: 2026-09-18SHENZHEN SHULUN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310692272.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2023-05-25
Filing Date
2023-06-12
Publication Date
2026-09-18
Estimated Expiration
2043-06-12

AI Technical Summary

Technical Problem

其中,通过区块头的信息只能追溯同一账本在不同区块时刻对应的区块

Benefits of technology

[0010]The beneficial effects of this application are as follows: by performing hash calculations on the hash value in the recursive zero-knowledge proof hash of the current block and the hash value in the current block hash, the composite hash of the current block is obtained, and the hash pointer is used to construct the connection structure of blocks generated between different ledgers through upper-level block composite and lower-level block composite, that is: the blocks generated by the upper-level ledger and the lower-level ledger have a connection relationship between the upper and lower levels, and the verification speed is improved when verifying the correctness of other ledgers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116938522B_ABST
    Figure CN116938522B_ABST
Patent Text Reader

Abstract

The application provides a blockchain system, a running method, an electronic device and a storage medium. The system comprises an upper ledger and a lower ledger. A block header of a block generated by the ledger comprises a current block recursive zero-knowledge proof hash, a current block hash, a current block composite hash, an upper block composite, a lower block composite and a parent block composite. Hash values in the current block recursive zero-knowledge proof hash and the current block hash are subjected to hash calculation to obtain a composite hash value, and the composite hash value is stored in the current block composite hash of the ledger. In the above manner, the current block composite hash is obtained by subjecting the current block recursive zero-knowledge proof hash and the current block hash to hash calculation. The upper block composite and the lower block composite are used by means of a hash pointer to make the blocks generated by the upper ledger and the lower ledger have a connection relationship between the upper and lower layers, and to improve the verification speed when verifying the correctness of other ledgers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The disclosed embodiments of this application relate to the field of blockchain technology, and more specifically, to blockchain systems, operating methods, electronic devices, and storage media. Background Technology

[0002] In existing blockchain technology, the block header stores information such as the current block hash and the parent block or Merkle root. The information in the block header can only trace the blocks corresponding to the same ledger at different times. Summary of the Invention

[0003] According to embodiments of this application, this application proposes a blockchain system, operating method, electronic device, and storage medium to solve the above-mentioned problems.

[0004] This application provides a blockchain system comprising: an upper-layer ledger and a lower-layer ledger. The block header of a block generated by the upper-layer ledger includes: a first current block recursive zero-knowledge proof hash, a first current block hash, a first current block composite hash, a first upper-layer block composite, a first lower-layer block composite, and a first parent block composite. The first current block composite hash of the upper-layer ledger stores a first composite hash value, which is obtained by hashing the hash values ​​in the first current block recursive zero-knowledge proof hash and the first current block hash. The block header of a block generated by the lower-layer ledger includes: a second current block recursive zero-knowledge proof hash, a second current block hash, a second current block composite hash, a second upper-layer block composite, a second lower-layer block composite, and a second parent block composite. The second current block composite hash of the lower-layer ledger stores a second composite hash value, which is obtained by hashing the hash values ​​in the second current block recursive zero-knowledge proof hash and the second current block hash.

[0005] Specifically, the first lower-level block composite of the upper-level ledger at the next block time points to the second current block composite hash of the lower-level ledger at the previous block time; the second upper-level block composite of the lower-level ledger at the next block time points to the first current block composite hash of the upper-level ledger at the previous block time; the second parent block composite of the lower-level ledger at the next block time points to the second current block composite hash of the lower-level ledger at the previous block time; and the first parent block composite of the upper-level ledger at the next block time points to the first current block composite hash of the upper-level ledger at the previous block time.

[0006] This application provides another blockchain operation method, which includes obtaining the hash value in the recursive zero-knowledge proof hash of the first current block and the hash value in the hash of the first current block in the upper-layer ledger. A hash calculation is performed on the hash value in the recursive zero-knowledge proof hash of the first current block and the hash value in the hash of the first current block to obtain a first composite hash value, and the first composite hash value is stored in the first current block composite hash of the upper-layer ledger. The first composite hash value in the first current block composite hash of the previous block in the upper-layer ledger is obtained, and the first composite hash value is stored in the second upper-layer block composite of the lower-layer ledger, using the first composite hash value in the second upper-layer block composite of the lower-layer ledger to point to the upper-layer ledger at the previous block time. The first composite hash value in the first current block composite hash of the previous block in the upper-layer ledger is obtained, and the first composite hash value is stored in the first parent block composite of the upper-layer ledger, using the first composite hash value in the first parent block composite of the upper-layer ledger to point to the upper-layer ledger at the previous block time.

[0007] Alternatively, obtain the hash value from the recursive zero-knowledge proof hash of the second current block and the hash value from the hash value of the second current block in the lower-level ledger. Perform a hash calculation on the hash value from the recursive zero-knowledge proof hash of the second current block and the hash value from the hash value of the second current block to obtain a second composite hash value, and store the second composite hash value in the second current block composite hash of the lower-level ledger. Obtain the second composite hash value from the second current block composite hash of the previous block in the lower-level ledger, store the second composite hash value in the first lower-level block composite of the upper-level ledger, and use the second composite hash value in the first lower-level block composite of the upper-level ledger to point to the lower-level ledger at the previous block time. Obtain the second composite hash value from the second current block composite hash of the previous block in the lower-level ledger, store the second composite hash value in the second parent block composite of the lower-level ledger, and use the second composite hash value in the second parent block composite of the lower-level ledger to point to the lower-level ledger at the previous block time.

[0008] This application provides an electronic device, including a memory and a processor, wherein the memory and the processor are coupled to each other, and the processor is used to execute program instructions stored in the memory to implement the blockchain system described above, or to implement the blockchain operation method described above.

[0009] This application provides a computer storage medium storing program instructions, which, when executed by a processor, implement the aforementioned blockchain system or the aforementioned blockchain operation method.

[0010] The beneficial effects of this application are as follows: by performing hash calculations on the hash value in the recursive zero-knowledge proof hash of the current block and the hash value in the current block hash, the composite hash of the current block is obtained, and the hash pointer is used to construct the connection structure of blocks generated between different ledgers through upper-level block composite and lower-level block composite, that is: the blocks generated by the upper-level ledger and the lower-level ledger have a connection relationship between the upper and lower levels, and the verification speed is improved when verifying the correctness of other ledgers.

[0011] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application. Attached Figure Description

[0012] The present application will be further described below with reference to the accompanying drawings and embodiments. In the drawings:

[0013] Figure 1 This is a schematic diagram of a blockchain ledger structure according to an embodiment of this application;

[0014] Figure 2 This is a schematic diagram of a blockchain system structure according to an embodiment of this application;

[0015] Figure 3 This is a flowchart illustrating a blockchain operation method according to an embodiment of this application;

[0016] Figure 4 This is a flowchart illustrating a blockchain operation method according to another embodiment of this application;

[0017] Figure 5 This is a schematic diagram of a blockchain system structure according to another embodiment of this application;

[0018] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application;

[0019] Figure 7 This is a schematic diagram of the structure of a non-volatile computer-readable storage medium according to an embodiment of this application. Detailed Implementation

[0020] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0021] In this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Additionally, the character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, "many" in this application means two or more. Moreover, the term "at least one" in this application means any combination of at least two of any one or more of a plurality of objects. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C. Furthermore, the terms "first," "second," and "third" in this application are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features.

[0022] Before introducing this application, the following detailed background information is provided:

[0023] Zero-knowledge proof commitments can be used in blockchains, specifically referring to the ability of a prover to convince a verifier that a statement is true without providing any useful information to the verifier. Ledgers are used to manage data such as accounts or transaction records, supporting functions such as categorized accounting, reconciliation, clearing, and settlement. In a blockchain, multiple nodes form a consensus group, and each consensus group has its own ledger. The consensus group maintains the ledger, packaging transactions that occurred between the previous block time and the current time to generate the current block. Furthermore, the block generated at the previous block time is the parent block of the block generated at the next block time, and the block generated at the next block time is the child block of the block generated at the previous block time. That is, there is an inheritance relationship between the blocks generated at the previous block time and the blocks generated at the next block time; child blocks inherit from parent blocks or extend and expand upon parent blocks. For example, by recording transactions for all residents of a village, a ledger for that village is generated. This ledger's consensus group consists of all residents of the village. By finding and recording all transactions that occurred in the village during January, the village's January ledger can be generated. Similarly, a February ledger is generated. The February ledger is based on the January ledger, extending from subsequent transactions in the January ledger. Therefore, the January ledger can be considered the parent block, and the February ledger can be considered the child block. Together, the January and February ledgers constitute the village's ledger.

[0024] Furthermore, a blockchain-generated block consists of a block header and a block body. The block header is a data structure containing key information, describing the basic information of a block, storing the current block hash, parent block or Merkle root, etc., and serving as a unique identifier for the block. It can be used to verify the integrity of the entire blockchain and also serves as the basic framework for information transmission between nodes in the blockchain network. The block body stores all transactions or other data that occurred within the consensus group at a specific point in time, such as smart contract source code, on-chain state change information, node data, etc.

[0025] In the blockchain system of this application, different ledgers exist in a hierarchical relationship, with the upper-level ledger being the parent ledger of the lower-level ledgers, and the lower-level ledgers being child ledgers of the upper-level ledgers, with the upper-level ledger being the primary one. The parent and child ledgers refer to an inheritance relationship between the two ledgers; the child ledger inherits from the parent ledger or extends and expands upon it. For example, if the mall's net profit ledger is defined as the upper-level ledger, and this ledger includes the mall's expense ledger and revenue ledger, then the mall's expense and revenue ledgers are defined as the lower-level ledgers. In this case, the net profit ledger has a parent-child relationship with both the mall's expense and revenue ledgers; that is, the net profit ledger is the parent ledger of both the mall's expense and revenue ledgers, while the mall's expense and revenue ledgers are child ledgers of the net profit ledger. Furthermore, the parent ledger is the primary one between the parent and child ledgers, and interactions between child ledgers must be conducted through the parent ledger. For example: Ledger A creates ledgers B and C. Ledgers B and C are child ledgers of ledger A, and ledger A is the parent ledger of both ledgers B and C. If ledgers B and C need to interact, they must go through ledger A, i.e., from ledger B to ledger A and then to ledger C. Further, ledger B creates ledger D, which is a child ledger of ledger B, and ledger B is the parent ledger of ledger D. Ledger C creates ledger E, which is a child ledger of ledger C, and ledger C is the parent ledger of ledger E. If ledgers D and E need to interact, they must go through ledgers B, A, and C, i.e., from ledger D to ledger B to ledger A to ledger C and then to ledger E. Similarly, if ledgers D and C need to interact, they must go through ledgers B and A, i.e., from ledger D to ledger B to ledger A and then to ledger C.

[0026] In this approach, a node that can participate in both the upper-level and lower-level ledgers is called a composite node. Specifically, a node participates in both the consensus group of the upper-level ledger (parent ledger) and the consensus group of the lower-level ledger (child ledger). The first node program of this node is deployed on the upper-level ledger, and the second node program is deployed on the lower-level ledger. The method of this application can be executed on a composite node.

[0027] Please see Figure 1 , Figure 1 This is a schematic diagram of a blockchain ledger structure according to an embodiment of this application. The method for constructing this blockchain ledger structure is as follows: receiving a first ledger creation instruction and creating a first ledger; receiving a second ledger creation instruction and creating at least one second ledger under the first ledger, wherein the first ledger constitutes an upper-level ledger, and the second ledger constitutes a sub-ledger or lower-level ledger of the first ledger. The first and second ledgers can mutually perform zero-knowledge proof commitments.

[0028] In this embodiment, after receiving a first ledger creation instruction, a first ledger is created. Upon receiving a second ledger creation instruction, at least one second ledger is created under the first ledger, meaning the number of second ledgers created is greater than or equal to one. Subsequently, upon receiving a third ledger creation instruction, at least one third ledger is created under the second ledger, meaning the number of third ledgers created is greater than or equal to one, where the number of third ledgers created equals the number of second ledgers created, and so on. The first ledger is the upper-level ledger of the second ledger, the second ledger is the lower-level ledger of the first ledger, the second ledger is the upper-level ledger of the third ledger, and so on, forming a ring-shaped blockchain. The layer containing the first ledger is defined as Layer 1 (L1), the layer containing the second ledger as Layer 2 (L2), the layer containing the third ledger as Layer 3 (L3), and so on. The blockchain system generates a creation instruction when it determines that a new ledger is needed for recording transactions, thereby generating a new ledger.

[0029] To enable those skilled in the art to better understand the technical solution of this application, the technical solution of this application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0030] Please see Figure 2 , Figure 2 This is a schematic diagram of a blockchain system structure according to an embodiment of this application. Figure 2(While the names in the block headers of each block do not explicitly include the first and second descriptions, to avoid ambiguity, in the following text descriptions, the first description will be added before the names of blocks generated by the upper-layer ledger, and the second description will be added before the names of blocks generated by the lower-layer ledger.) In this diagram, the blockchain system includes an upper-layer ledger and a lower-layer ledger. The block header of a block generated by the upper-layer ledger includes: a first current block recursive zero-knowledge proof hash, a first current block hash, a first current block composite hash, a first upper-layer block composite, a first lower-layer block composite, and a first parent block composite. Specifically, a first composite hash value is obtained by hashing the hash values ​​in the first current block recursive zero-knowledge proof hash and the first current block hash, and this first composite hash value is stored in the first current block composite hash of the upper-layer ledger. The block header of the lower-level ledger generates blocks including: the recursive zero-knowledge proof hash of the second current block, the hash of the second current block, the composite hash of the second current block, the composite hash of the second upper-level block, the composite hash of the second lower-level block, and the composite hash of the second parent block. Among them, the hash values ​​in the recursive zero-knowledge proof hash of the second current block and the hash values ​​in the hash of the second current block are hashed to obtain the second composite hash value, and the second composite hash value is stored in the second current block composite hash of the lower-level ledger.

[0031] Specifically, the first lower-level block composite hash of the upper-level ledger at the next block time points to the second current block composite hash of the lower-level ledger at the previous block time; the second upper-level block composite hash of the lower-level ledger at the next block time points to the first current block composite hash of the upper-level ledger at the previous block time; the second parent block composite hash of the lower-level ledger at the next block time points to the second current block composite hash of the lower-level ledger at the previous block time; and the first parent block composite hash of the upper-level ledger at the next block time points to the first current block composite hash of the upper-level ledger at the previous block time.

[0032] The specific process of generating a hash value using a hash function can be as follows: The message to be calculated is encoded according to a certain format so that the computer can recognize and process it. Then, a specific hash algorithm is used to process the encoded information to obtain a fixed-length message digest, which is then converted into a readable string.

[0033] In this embodiment, the block header of a block includes the current block recursive zero-knowledge proof hash, the current block hash, the current block composite hash, the upper-level block composite hash, the lower-level block composite hash, and the parent block composite hash. Specifically, the hash values ​​from the current block recursive zero-knowledge proof hash and the current block hash are obtained, and the current block composite hash is generated using hash calculation. Hash pointers are then used to establish the structural relationship between upper and lower level blocks generated by the upper and lower level ledgers through the current block composite hash, the upper-level block composite hash, and the lower-level block composite hash. Specifically, the lower-level block composite hash in the block header of a block generated by the upper level ledger points to the lower level block by storing the hash value in the current block composite hash of the lower level block at the previous block time of the lower level ledger. Similarly, the upper-level block composite hash in the block header of a block generated by the lower level ledger points to the upper level block by storing the current block composite hash of the upper level block at the previous block time of the upper level ledger. In this context, the block generated at the previous block time in the same ledger is the parent block of the block generated at the next block time, and the block generated at the next block time is the child block of the block generated at the previous block time. Therefore, the parent block composite is used to connect the current block composite hash of the parent block at the previous time. If the block is the initial block of the blockchain, then the value of the recursive zero-knowledge proof of the parent block of this block is empty. Meanwhile, since there is only one upper-level ledger and one lower-level ledger in this embodiment, the composite value of the first upper-level block of the upper-level ledger is empty, and the composite value of the second lower-level block of the lower-level ledger is also empty. In an embodiment, there are four ledgers, where the first ledger is the upper-level ledger of the second and third ledgers, the third and second ledgers are the lower-level ledgers of the first ledger, the fourth ledger is the lower-level ledger of the second ledger, and the second ledger is the upper-level ledger of the fourth ledger. In this case, the composite value of the upper-level block of the first ledger is empty, the composite value of the lower-level block of the fourth and third ledgers is empty, and the composite value of the upper-level block and the lower-level block of the second ledger is not empty.

[0034] For details on how to connect upper-level and lower-level ledgers, please refer to [link / reference needed]. Figure 3 , Figure 3 This is a flowchart illustrating a blockchain operation method according to an embodiment of this application.

[0035] Step S31: Obtain the hash value in the recursive zero-knowledge proof hash of the first current block and the hash value in the hash of the first current block in the upper-level ledger.

[0036] In this embodiment, the content of the upper-layer ledger is obtained, the content is input into a hash function, a unique hash value is generated based on the content, and this hash value is stored in the first current block hash. The zero-knowledge proof commitment of the upper-layer ledger is obtained, the zero-knowledge proof commitment is input into a hash function, a unique hash value is generated based on the content, and this hash value is stored in the first current block zero-knowledge proof hash.

[0037] Step S32: Perform hash calculation on the hash value in the recursive zero-knowledge proof hash of the first current block and the hash value in the hash of the first current block to obtain the first composite hash value, and store the first composite hash value in the first current block composite hash of the upper-level ledger.

[0038] Step S33: Obtain the first composite hash value from the first current block composite hash of the previous block in the upper-level ledger, store the first composite hash value in the second upper-level block composite hash of the lower-level ledger, and use the first composite hash value in the second upper-level block composite hash of the lower-level ledger to point to the upper-level ledger at the previous block time.

[0039] In this embodiment, the first composite hash value in the first current block composite hash of the previous block in the upper-level ledger is stored in the second upper-level block composite of the lower-level ledger, and the hash pointer is used to connect the lower-level ledger with the upper-level ledger at the previous block time.

[0040] Step S34: Obtain the first composite hash value from the first current block composite hash of the previous block in the upper-level ledger, store the first composite hash value in the first parent block composite of the upper-level ledger, and use the first composite hash value in the first parent block composite of the upper-level ledger to point to the upper-level ledger at the previous block time.

[0041] In this embodiment, the first composite hash value in the first current block composite hash of the previous block in the upper-level ledger is stored in the first parent block composite of the upper-level ledger, and the hash pointer is used to connect the upper-level ledger with the upper-level ledger at the previous block time.

[0042] The process of storing the first composite hash value in the first parent block composite of the upper-level ledger and storing the first composite hash value in the second upper-level block composite of the lower-level ledger can be different from the writing order, or in specific embodiments, they can occur simultaneously.

[0043] Or please see Figure 4 , Figure 4 This is a flowchart illustrating a blockchain operation method according to another embodiment of this application.

[0044] Step S41: Obtain the hash value in the recursive zero-knowledge proof hash of the second current block and the hash value in the hash of the second current block in the lower-level ledger.

[0045] In this embodiment, the content of the lower-level ledger is obtained, the content is input into a hash function, a unique hash value is generated based on the content, and this hash value is stored in the second current block hash. The zero-knowledge proof commitment of the lower-level ledger is obtained, the zero-knowledge proof commitment is input into a hash function, a unique hash value is generated based on the content, and this hash value is stored in the second current block zero-knowledge proof hash.

[0046] Step S42: Perform hash calculation on the hash value in the recursive zero-knowledge proof hash of the second current block and the hash value in the hash of the second current block to obtain the second composite hash value, and store the second composite hash value in the second current block composite hash of the lower-level ledger.

[0047] Step S43: Obtain the second composite hash value from the second current block composite hash of the previous block in the lower-level ledger, store the second composite hash value in the first lower-level block composite of the upper-level ledger, and use the second composite hash value in the first lower-level block composite of the upper-level ledger to point to the lower-level ledger at the previous block time.

[0048] In this embodiment, the second composite hash value in the second current block composite hash of the previous block in the lower ledger is stored in the first lower block composite of the upper ledger, and the hash pointer is used to connect the upper ledger with the lower ledger at the previous block time.

[0049] Step S44: Obtain the second composite hash value from the second current block composite hash of the previous block in the lower-level ledger, store the second composite hash value in the second parent block composite of the lower-level ledger, and use the second composite hash value in the second parent block composite of the lower-level ledger to point to the lower-level ledger at the previous block time.

[0050] In this embodiment, the second composite hash value in the second current block composite hash of the previous block in the lower ledger is stored in the second parent block composite of the lower ledger, and the hash pointer is used to connect the lower ledger with the lower ledger at the previous block time.

[0051] The process of storing the first composite hash value in the second parent block composite of the lower-level ledger and storing the first composite hash value in the first lower-level block composite of the upper-level ledger can be different from the writing order, or in specific embodiments, they can occur simultaneously.

[0052] Therefore, in the above embodiments, by performing hash calculations on the hash value in the recursive zero-knowledge proof hash of the current block and the hash value in the current block hash, the composite hash of the current block is obtained. Then, by using hash pointers to construct the connection structure of blocks generated between different ledgers through upper-level block composite and lower-level block composite, that is, to enable the blocks generated by the upper-level ledger and the lower-level ledger to have a connection relationship between the upper and lower levels, and to improve the verification speed when verifying the correctness of other ledgers.

[0053] In some other embodiments of this application, tracing between the upper-level ledger and the lower-level ledger includes: obtaining a first composite hash value in the second upper-level block composite of the block generated by the lower-level ledger, using the first composite hash value to find the upper-level block at the previous block time, for querying the transactions that occurred in the upper-level block at the previous block time of the upper-level ledger; or obtaining a second composite hash value in the first lower-level block composite of the block generated by the upper-level ledger, using the second composite hash value to find the lower-level block at the previous block time, for querying the transactions that occurred in the lower-level block at the previous block time of the lower-level ledger.

[0054] In this embodiment, the first composite hash value of the first current block composite hash in the upper-level block generated by the upper-level ledger at the previous block time is stored in the second upper-level block composite of the lower-level block generated by the lower-level ledger. This enables the lower-level ledger at the next block time and the upper-level ledger at the previous block time to have a pointing or connection relationship. That is, the upper-level ledger at the previous block time can be traced through the lower-level ledger at the next block time, and the upper-level ledger at the next block time can trace the lower-level ledger at the previous block time in the same way as described above.

[0055] In other embodiments of this application, the process of obtaining the hash value in the recursive zero-knowledge proof hash of the first current block in the upper-level ledger includes:

[0056] Obtain the zero-knowledge proof commitment from the upper-level ledger at the previous block time and the transaction information from the upper-level ledger at the current block time. Perform zero-knowledge proof calculations to obtain the zero-knowledge proof commitment from the upper-level ledger at the current block time, and store this commitment in the first current block recursive zero-knowledge proof of the block generated by the upper-level ledger. Perform hash calculations on the zero-knowledge proof commitment from the upper-level ledger at the current block time to obtain a hash value, and store this hash value in the first current block recursive zero-knowledge proof hash of the upper-level ledger.

[0057] The specific process of generating a hash value using a hash function can be as follows: The message to be calculated is encoded according to a certain format so that the computer can recognize and process it. Then, a specific hash algorithm is used to process the encoded information to obtain a fixed-length message digest, which is then converted into a readable string. Therefore, after the upper-level ledger generates a zero-knowledge proof commitment, the first current block recursive zero-knowledge proof hash value of the upper-level block corresponding to that block moment is generated based on this zero-knowledge proof commitment.

[0058] In this embodiment, the specific process of generating a zero-knowledge proof commitment by the upper-layer ledger can be as follows: Obtain the transactions that occurred from the previous block time to the current block time, and the zero-knowledge proof of the upper-layer block generated by the upper-layer ledger at the previous block time. Calculate the zero-knowledge proof to obtain the zero-knowledge proof of the upper-layer block generated by the upper-layer ledger at the current block time. Alternatively, obtain the transactions that occurred from the previous block time to the current block time, the zero-knowledge proof of the upper-layer block generated by the upper-layer ledger at the previous block time, and / or the zero-knowledge proof of the lower-layer block generated by the lower-layer ledger at the previous block time. Calculate the zero-knowledge proof to obtain the zero-knowledge proof of the upper-layer block generated by the upper-layer ledger at the current block time.

[0059] In other embodiments of this application, the process of obtaining the hash value in the recursive zero-knowledge proof hash of the second current block in the lower-level ledger includes:

[0060] Obtain the zero-knowledge proof commitment from the lower-level ledger at the previous block time and the transaction information from the lower-level ledger at the current block time. Perform zero-knowledge proof calculations to obtain the zero-knowledge proof commitment from the lower-level ledger at the current block time, and store this commitment in the second current block recursive zero-knowledge proof of the block generated by the lower-level ledger. Perform hash calculations on the zero-knowledge proof commitment from the lower-level ledger at the current block time to obtain a hash value, and store this hash value in the second current block recursive zero-knowledge proof hash of the lower-level ledger.

[0061] The principle and process of this embodiment are the same as those described above for obtaining the hash value in the recursive zero-knowledge proof hash of the first current block in the upper-level ledger, and will not be elaborated further here.

[0062] In some other embodiments of this application, the zero-knowledge proof commitment tracing between the upper-level ledger and the lower-level ledger includes: obtaining the first composite hash value in the second upper-level block composite hash in the lower-level ledger, using the first composite hash value to find the first current block composite hash in the upper-level block at the previous block time, and using the first current block composite hash to obtain the zero-knowledge proof commitment generated by the upper-level block at the previous block time in the recursive zero-knowledge proof of the upper-level ledger in the first current block; or obtaining the second composite hash value in the first lower-level block composite hash in the upper-level ledger, using the second composite hash value to find the second current block composite hash in the lower-level block at the previous block time, and using the second current block composite hash to obtain the zero-knowledge proof commitment generated by the lower-level block at the previous block time in the recursive zero-knowledge proof of the lower-level ledger in the second current block.

[0063] In this embodiment, the third hash value of the first current block composite hash of the upper-level ledger at the previous block time is stored in the second upper-level block composite in the lower-level block of the lower-level ledger. The hash pointer is used to establish a pointing or connection relationship between the lower-level ledger at the next block time and the upper-level ledger at the previous block time. That is, the upper-level ledger at the previous block time can be traced through the lower-level ledger at the next block time. Then, the zero-knowledge proof commitment stored in the first current block recursive zero-knowledge proof of the block header of the upper-level ledger at the previous block time is found. Similarly, the upper-level ledger at the next block time can trace the zero-knowledge proof commitment in the lower-level ledger at the previous block time.

[0064] In some other embodiments of this application, after obtaining the zero-knowledge proof commitment generated by the upper-level block at the previous block time in the recursive zero-knowledge proof of the upper-level ledger using the composite hash of the first current block, the process includes: nodes in the consensus group corresponding to the lower-level ledger determining whether the zero-knowledge proof commitment of the upper-level block of the upper-level ledger meets the verification requirements. If it meets the requirements, the node determines that the upper-level ledger is reliable and allows cross-chain transactions between the upper-level ledger and the lower-level ledger; if it does not meet the requirements, the node determines that the upper-level ledger is unreliable and does not allow cross-chain transactions between the upper-level ledger and the lower-level ledger.

[0065] In this embodiment, the upper-layer ledger generates zero-knowledge proof commitments to prove the reliability and trustworthiness of the lower-layer ledger. The lower-layer ledger at the next block time connects with the upper-layer ledger at the previous block time to obtain the zero-knowledge proof commitments stored in the block header of the upper-layer ledger at the previous block time. The zero-knowledge proof commitments are verified by nodes in the consensus group corresponding to the lower-layer ledger. When a preset number of nodes in the consensus group determine that the zero-knowledge proof commitments of the upper-layer ledger meet the verification requirements, the upper-layer ledger is reliable. When a preset number of nodes in the consensus group determine that the zero-knowledge proof commitments of the upper-layer ledger meet the verification requirements, the upper-layer ledger is unreliable. The nodes that verify the zero-knowledge proof commitments do not have to be composite nodes. If a zero-knowledge proof commitment fails to meet the verification requirements, it indicates the presence of an illegal transaction in the upper-layer ledger. Cross-chain transactions between the upper and lower-layer ledgers are not permitted. The illegal transaction must be rolled back, and the upper-layer ledger must generate a new zero-knowledge proof commitment. The lower-layer ledger then verifies this commitment until it meets the verification requirements. Only then is a cross-chain transaction between the upper and lower-layer ledgers permitted. Furthermore, cross-chain transactions between the upper and lower-layer ledgers will be recorded by the lower-layer ledger. In this embodiment, the verification method for the zero-knowledge proof commitment is a non-interactive zero-knowledge proof process. This allows a user to initiate a transaction, proving they have sufficient balance to pay for it, without disclosing any information related to their account, password, or balance. Alternatively, the verification method for the zero-knowledge proof commitment can be interactive zero-knowledge proof.

[0066] In some other embodiments of this application, after obtaining the zero-knowledge proof commitment generated by the lower-level block at the previous block time in the recursive zero-knowledge proof of the lower-level ledger using the composite hash of the second current block, the process includes: nodes in the consensus group corresponding to the upper-level ledger determining whether the zero-knowledge proof commitment of the lower-level block of the lower-level ledger meets the verification requirements. If it meets the requirements, the node determines that the lower-level ledger is reliable and allows cross-chain transactions between the lower-level ledger and the upper-level ledger; if it does not meet the requirements, the node determines that the lower-level ledger is unreliable and does not allow cross-chain transactions between the lower-level ledger and the upper-level ledger.

[0067] The principle and process of this embodiment are the same as those of the zero-knowledge proof commitment generated by the upper-level block at the previous block time in the recursive zero-knowledge proof of the upper-level ledger in the above-mentioned method of obtaining the recursive zero-knowledge proof of the first current block using the composite hash of the first current block, and will not be elaborated further.

[0068] Please refer to Figure 5 , Figure 5 This is a schematic diagram of a blockchain system structure according to an embodiment of this application. Figure 5 In this diagram, ledger A is the upper-level ledger, ledger B is the first lower-level ledger, and ledger C is the second lower-level ledger. While the block header names of each block do not explicitly use the terms "first," "third," and "fourth," to avoid ambiguity, in the following descriptions, "first" will be added before the names of blocks generated by the upper-level ledger, "third" will be added before the names of blocks generated by the first lower-level ledger, and "fourth" will be added before the names of blocks generated by the second lower-level ledger. (In this diagram, there can be multiple lower-level ledgers; that is, there can be one upper-level ledger but multiple lower-level ledgers. Specifically, the lower-level ledgers include the first lower-level ledger and the second lower-level ledger.) The block header of the first lower-level ledger block includes: the recursive zero-knowledge proof hash of the third current block, the hash of the third current block, the composite hash of the third current block, the composite hash of the third upper-level block, the composite hash of the third lower-level block, and the composite hash of the third parent block. The hash value in the recursive zero-knowledge proof hash of the third current block and the hash value in the hash of the third current block are hashed together to obtain the hash value in the composite hash of the third current block of the first lower-level ledger. The block header of the second lower-level ledger block includes: the recursive zero-knowledge proof hash of the fourth current block, the hash of the fourth current block, the composite hash of the fourth current block, the composite hash of the fourth upper-level block, the composite hash of the fourth lower-level block, and the composite hash of the fourth parent block. The hash value in the recursive zero-knowledge proof hash of the fourth current block and the hash value in the hash of the fourth current block are hashed together to obtain the hash value in the composite hash of the fourth current block of the second lower-level ledger.

[0069] Specifically, at the next block time, the first lower-level block composite of the upper-level ledger points to the third current block composite hash of the first lower-level ledger and the fourth current block composite hash of the second lower-level ledger at the previous block time; at the next block time, the third upper-level block composite of the first lower-level ledger and the fourth upper-level block composite of the second lower-level ledger point to the first current block composite hash of the upper-level ledger at the previous block time; at the next block time, the third parent block composite of the first lower-level ledger points to the third current block composite hash of the first lower-level ledger at the previous block time; and at the next block time, the fourth parent block composite of the second lower-level ledger points to the fourth current block composite hash of the second lower-level ledger at the previous block time.

[0070] Therefore, in this embodiment, the third and fourth upper-level block composites of the first and second lower-level ledgers both store the current block composite hash of the upper-level ledger, while the lower-level block composites of the upper-level ledgers store the third and fourth current block composite hashes of the first and second lower-level ledgers. The third parent block composite of the first lower-level ledger stores the third current block composite hash of the first lower-level ledger at the previous block time, and the fourth parent block composite of the second lower-level ledger stores the fourth current block composite hash of the second lower-level ledger at the previous block time.

[0071] Among them, Figure 5 In this system, there is only one upper-level ledger and two lower-level ledgers. Therefore, the value of the first upper-level block composite in the first upper-level ledger is empty, and the values ​​of the third lower-level block composite and the fourth lower-level block composite in the second and third lower-level ledgers are also empty.

[0072] A more specific implementation process can be as follows: obtain the third composite hash value from the third current block composite hash at the previous block time in the first lower-level ledger and the fourth composite hash value from the fourth current block composite hash at the previous block time in the second lower-level ledger; store the third composite hash value and the fourth composite hash value in the first lower-level block composite hash of the upper-level ledger; use the third composite hash value in the first lower-level block composite hash of the upper-level ledger to point to the first lower-level ledger at the previous block time and the fourth composite hash value to point to the second lower-level ledger at the previous block time.

[0073] Obtain the first composite hash value from the first current block composite hash of the previous block in the upper-level ledger, store the first composite hash value in the third upper-level block composite of the first lower-level ledger and the fourth upper-level block composite of the second lower-level ledger, use the first composite hash value in the third upper-level block composite of the first lower-level ledger to point to the upper-level ledger at the previous block time, and use the first composite hash value in the fourth upper-level block composite of the second lower-level ledger to point to the upper-level ledger at the previous block time.

[0074] Obtain the third composite hash value from the third current block composite hash of the previous block in the first lower-level ledger, store the third composite hash value in the third parent block composite of the first lower-level ledger, and use the third composite hash value in the third parent block composite of the first lower-level ledger to point to the first lower-level ledger at the previous block time.

[0075] Obtain the fourth composite hash value from the fourth current block composite hash of the previous block in the second lower-level ledger, store the fourth composite hash value in the fourth parent block composite of the second lower-level ledger, and use the fourth composite hash value in the fourth parent block composite of the second lower-level ledger to point to the second lower-level ledger at the previous block time.

[0076] The process of obtaining and storing the first composite hash value, the third composite hash value, and the fourth composite hash value may differ from the writing order, or they may occur simultaneously in a specific embodiment.

[0077] For details, please refer to Figure 5 In this diagram, there exists an upper-level ledger A, lower-level ledgers B and C. The lower-level blocks in the block headers of blocks generated in upper-level ledger A point to the current block hashes of the lower-level blocks in lower-level ledgers B and C by storing the hash values ​​in the current block hashes of the lower-level blocks at the previous block time of lower-level ledgers B and C. Similarly, the upper-level blocks in the block headers of blocks generated in lower-level ledgers B and C point to the current block hashes of the upper-level blocks in upper-level ledger A by storing the current block hashes of the upper-level blocks at the previous block time of upper-level ledger A. The recursive zero-knowledge proof of the lower-level blocks in the block headers of blocks generated in upper-level ledger A points to the current block hashes of the upper-level blocks in upper-level ledger A by storing the recursive zero-knowledge proof hashes of the lower-level blocks at the previous block time of lower-level ledgers B and C. The current block recursive zero-knowledge proof, the upper block recursive zero-knowledge proof in the block header of the block generated by lower ledgers B and C, points to the current block recursive zero-knowledge proof hash of the upper block at the previous block time of the upper ledger A, the lower block composite in the block header of the block generated by the upper ledger A, the hash value in the current block composite hash of the lower block at the previous block time of the lower ledgers B and C, points to the current block composite hash of the lower block of the lower ledgers B and C, the upper block composite in the block header of the block generated by the lower ledgers B and C, the current block composite hash of the upper block at the previous block time of the upper ledger A, points to the current block composite hash of the upper block of the upper ledger A.

[0078] As can be seen from all the above embodiments, constructing a composite ledger hash is the result of hash calculation combining the current block hash and the current block recursive zero-knowledge proof hash. Composite ledger hashes can accelerate the verification of ledger correctness and connect hierarchical ledgers, achieving structure. Furthermore, the upper and lower ledger structures ensure a unique topological structure for the ledgers, achieving spatial and temporal ordering. Secondly, this improves blockchain security. When upper and lower ledgers are related, attacking only the ledger maintained by a single consensus group is useless; adjacent ledgers must also be attacked. Therefore, an attacker needs to reverse all related ledgers to reverse a block, increasing the difficulty of blockchain attacks.

[0079] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0080] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. The electronic device 60 includes a memory 61 and a processor 62 coupled to each other. The processor 62 is used to execute program instructions stored in the memory 61 to implement the steps of the above-described blockchain operation method embodiment, or to implement a blockchain system. In a specific implementation scenario, the electronic device 60 may include, but is not limited to, a microcomputer or a server, and is not limited thereto.

[0081] Specifically, processor 62 controls itself and memory 61 to implement the steps of the embodiments of the blockchain operation method described above, or to implement a blockchain system. Processor 62 may also be referred to as a CPU (Central Processing Unit), and may be an integrated circuit chip with signal processing capabilities. Processor 62 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor. Furthermore, processor 62 may be implemented using integrated circuit chips.

[0082] Please see Figure 7 , Figure 7This is a schematic diagram of the structure of a non-volatile computer-readable storage medium according to an embodiment of this application. The non-volatile computer-readable storage medium 70 is used to store a computer program 71. When executed by the processor 62, the computer program 71 is used to implement the steps of the above-described blockchain operation method embodiment, or to implement a blockchain system.

[0083] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.

[0084] In the several embodiments provided in this application, it should be understood that the disclosed methods and related devices can be implemented in other ways. For example, the related device implementations described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication disconnection shown or discussed may be indirect coupling or communication disconnection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0085] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0086] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0087] Those skilled in the art will readily recognize that numerous modifications and variations can be made to the apparatus and method while maintaining the teachings of this application. Therefore, the above disclosure should be considered limited only by the scope of the appended claims.

Claims

1. A blockchain system, characterized in that, include: Upper-level ledgers and lower-level ledgers; The block header of the upper-level ledger generates a block and includes: a first current block recursive zero-knowledge proof hash, a first current block hash, a first current block composite hash, a first upper-level block composite, a first lower-level block composite, and a first parent block composite. The first current block composite hash of the upper-level ledger is used to store a first composite hash value, which is obtained by hashing the hash value in the first current block recursive zero-knowledge proof hash and the hash value in the first current block hash. The block header of the lower-level ledger generates a block and includes: a second current block recursive zero-knowledge proof hash, a second current block hash, a second current block composite hash, a second upper-level block composite hash, a second lower-level block composite hash, and a second parent block composite hash. The second current block composite hash of the lower-level ledger is used to store a second composite hash value, which is obtained by hashing the hash value in the second current block recursive zero-knowledge proof hash and the hash value in the second current block hash. Wherein, the first lower-level block composite of the upper-level ledger at the next block time points to the second current block composite hash of the lower-level ledger at the previous block time, the second upper-level block composite of the lower-level ledger at the next block time points to the first current block composite hash of the upper-level ledger at the previous block time, the second parent block composite of the lower-level ledger at the next block time points to the second current block composite hash of the lower-level ledger at the previous block time, and the first parent block composite of the upper-level ledger at the next block time points to the first current block composite hash of the upper-level ledger at the previous block time; The upper-level ledger and the lower-level ledger have an inheritance relationship, with the lower-level ledger inheriting from the upper-level ledger, and interactions between the lower-level ledgers need to be carried out through the upper-level ledger; Wherein, the first current block recursive zero-knowledge proof hash is used to store the hash value of the zero-knowledge proof commitment of the upper-level ledger. The zero-knowledge proof commitment of the upper-level ledger at the current block time is obtained by performing zero-knowledge proof calculation through the zero-knowledge proof commitment of the upper-level ledger at the previous block time and the transaction information of the upper-level ledger at the current block time. Wherein, the second current block recursive zero-knowledge proof hash is used to store the hash value of the zero-knowledge proof commitment of the lower-level ledger; the zero-knowledge proof commitment of the lower-level ledger at the current block time is obtained by performing zero-knowledge proof calculation through the zero-knowledge proof commitment of the lower-level ledger at the previous block time and the transaction information of the lower-level ledger at the current block time. In this process, the nodes in the consensus group corresponding to the lower-layer ledger are used to obtain the zero-knowledge proof commitment of the upper-layer ledger and determine whether the zero-knowledge proof commitment meets the verification requirements. If it meets the requirements, the upper-layer ledger is determined to be reliable and cross-chain transactions between the upper-layer ledger and the lower-layer ledger are allowed. If it does not meet the requirements, the upper-layer ledger is determined to be unreliable and cross-chain transactions between the upper-layer ledger and the lower-layer ledger are not allowed.

2. The blockchain system according to claim 1, characterized in that, The lower-level ledger includes: a first lower-level ledger and a second lower-level ledger; The block header of the first lower-level ledger generates a block including: a third current block recursive zero-knowledge proof hash, a third current block hash, a third current block composite hash, a third upper-level block composite hash, a third lower-level block composite hash, and a third parent block composite hash. The third current block composite hash of the first lower-level ledger is used to store the third composite hash value, which is obtained by hashing the hash values ​​in the third current block recursive zero-knowledge proof hash and the hash values ​​in the third current block hash. The block header of the second lower-level ledger generates a block including: a fourth current block recursive zero-knowledge proof hash, a fourth current block hash, a fourth current block composite hash, a fourth upper-level block composite hash, a fourth lower-level block composite hash, and a fourth parent block composite hash. The fourth current block composite hash of the second lower-level ledger is used to store the fourth composite hash value, which is obtained by hashing the hash value in the fourth current block recursive zero-knowledge proof hash and the hash value in the fourth current block hash. Specifically, at the next block time, the first lower-level block composite of the upper-level ledger points to the third current block composite hash of the first lower-level ledger and the fourth current block composite hash of the second lower-level ledger at the previous block time; at the next block time, the third upper-level block composite of the first lower-level ledger and the fourth upper-level block composite of the second lower-level ledger point to the first current block composite hash of the upper-level ledger at the previous block time; at the next block time, the third parent block composite of the first lower-level ledger points to the third current block composite hash of the first lower-level ledger at the previous block time; and at the next block time, the fourth parent block composite of the second lower-level ledger points to the fourth current block composite hash of the second lower-level ledger at the previous block time.

3. A blockchain operation method, characterized in that, include: Obtain the hash value from the recursive zero-knowledge proof hash of the first current block in the upper-level ledger and the hash value from the hash of the first current block; A hash calculation is performed on the hash value in the recursive zero-knowledge proof hash of the first current block and the hash value in the hash of the first current block to obtain a first composite hash value, and the first composite hash value is stored in the first current block composite hash of the upper-level ledger; Obtain the first composite hash value from the first current block composite hash at the previous block time in the upper-level ledger, store the first composite hash value in the second upper-level block composite of the lower-level ledger, use the first composite hash value in the second upper-level block composite of the lower-level ledger to point to the upper-level ledger at the previous block time, obtain the first composite hash value from the first current block composite hash at the previous block time in the upper-level ledger, store the first composite hash value in the first parent block composite of the upper-level ledger, and use the first composite hash value in the first parent block composite of the upper-level ledger to point to the upper-level ledger at the previous block time; The upper-level ledger and the lower-level ledger have an inheritance relationship, with the lower-level ledger inheriting from the upper-level ledger, and interactions between the lower-level ledgers need to be carried out through the upper-level ledger; The process of obtaining the hash value from the recursive zero-knowledge proof hash of the first current block in the upper-level ledger includes: Obtain the zero-knowledge proof commitment generated by the upper-level block at the previous block time in the recursive zero-knowledge proof of the first current block; The nodes in the consensus group corresponding to the lower-level ledger determine whether the zero-knowledge proof commitment of the upper-level block of the upper-level ledger meets the verification requirements; In response to the agreement, the node determines that the upper-layer ledger is reliable and allows the upper-layer ledger to conduct cross-chain transactions with the lower-layer ledger. In response to the non-compliance, the node determines that the upper-layer ledger is unreliable and does not allow the upper-layer ledger to conduct cross-chain transactions with the lower-layer ledger. or Obtain the hash value from the recursive zero-knowledge proof hash of the second current block and the hash value from the hash of the second current block in the lower-level ledger; A hash calculation is performed on the hash value in the recursive zero-knowledge proof hash of the second current block and the hash value in the hash of the second current block to obtain a second composite hash value, and the second composite hash value is stored in the second current block composite hash of the lower-level ledger; Obtain the second composite hash value from the second current block composite hash at the previous block time in the lower-level ledger, store the second composite hash value in the first lower-level block composite of the upper-level ledger, use the second composite hash value in the first lower-level block composite of the upper-level ledger to point to the lower-level ledger at the previous block time, obtain the second composite hash value from the second current block composite hash at the previous block time in the lower-level ledger, store the second composite hash value in the second parent block composite of the lower-level ledger, and use the second composite hash value in the second parent block composite of the lower-level ledger to point to the lower-level ledger at the previous block time; The upper-level ledger and the lower-level ledger have an inheritance relationship; Wherein, the first current block recursive zero-knowledge proof hash is used to store the hash value of the zero-knowledge proof commitment of the upper-level ledger. The zero-knowledge proof commitment of the upper-level ledger at the current block time is obtained by performing zero-knowledge proof calculation through the zero-knowledge proof commitment of the upper-level ledger at the previous block time and the transaction information of the upper-level ledger at the current block time. The second current block recursive zero-knowledge proof hash is used to store the hash value of the zero-knowledge proof commitment of the lower-level ledger; the zero-knowledge proof commitment of the lower-level ledger at the current block time is obtained by performing zero-knowledge proof calculation through the zero-knowledge proof commitment of the lower-level ledger at the previous block time and the transaction information of the lower-level ledger at the current block time.

4. The method according to claim 3, characterized in that, include: Obtain the first composite hash value in the second upper-level block composite in the block generated by the lower-level ledger, and use the first composite hash value to find the upper-level block at the previous block time, so as to query the transactions that occurred in the upper-level ledger at the previous block time; or Obtain the second composite hash value from the first lower-level block composite in the block generated by the upper-level ledger, and use the second composite hash value to find the lower-level block at the previous block time, so as to query the transactions that occurred in the lower-level ledger at the previous block time.

5. The method according to claim 3, characterized in that, Before obtaining the hash value in the recursive zero-knowledge proof hash of the first current block in the upper-level ledger, the following steps are included: Obtain the zero-knowledge proof commitment of the upper-layer ledger at the previous block time and the transaction information of the upper-layer ledger at the current block time, perform zero-knowledge proof calculation, obtain the zero-knowledge proof commitment of the upper-layer ledger at the current block time, and store the zero-knowledge proof commitment of the upper-layer ledger at the current block time in the first current block recursive zero-knowledge proof of the upper-layer ledger. A hash value is calculated on the zero-knowledge proof commitment of the upper-level ledger at the current block time, and the hash value is stored in the first current block recursive zero-knowledge proof hash of the upper-level ledger.

6. The method according to claim 5, characterized in that, include: Obtain the first composite hash value in the second upper-level block composite in the lower-level ledger, use the first composite hash value to find the first current block composite hash in the upper-level block at the previous block time, and use the first current block composite hash to obtain the zero-knowledge proof commitment generated by the upper-level block at the previous block time in the recursive zero-knowledge proof of the first current block.

7. The method according to claim 6, characterized in that, The step of obtaining the zero-knowledge proof commitment generated by the upper-level block at the previous block time in the recursive zero-knowledge proof of the upper-level ledger using the composite hash of the first current block includes: The nodes in the consensus group corresponding to the lower-level ledger determine whether the zero-knowledge proof commitment of the upper-level block of the upper-level ledger meets the verification requirements; In response to the agreement, the node determines that the upper-layer ledger is reliable and allows the upper-layer ledger to conduct cross-chain transactions with the lower-layer ledger. In response to the non-compliance, the node determines that the upper-layer ledger is unreliable and does not allow the upper-layer ledger to conduct cross-chain transactions with the lower-layer ledger.

8. The method according to claim 3, characterized in that, Before obtaining the hash value in the recursive zero-knowledge proof hash of the second current block in the lower-level ledger, the following steps are included: Obtain the zero-knowledge proof commitment of the lower-level ledger at the previous block time and the transaction information of the lower-level ledger at the current block time, perform zero-knowledge proof calculation, obtain the zero-knowledge proof commitment of the lower-level ledger at the current block time, and store the zero-knowledge proof commitment of the lower-level ledger at the current block time in the second current block recursive zero-knowledge proof of the lower-level ledger; A hash value is calculated on the zero-knowledge proof commitment of the lower-level ledger at the current block time, and the hash value is stored in the second current block recursive zero-knowledge proof hash of the lower-level ledger.

9. The method according to claim 8, characterized in that, include: Obtain the second composite hash value in the first lower-level block composite in the upper-level ledger, use the second composite hash value to find the second current block composite hash in the lower-level block at the previous block time, and use the second current block composite hash to obtain the zero-knowledge proof commitment generated by the lower-level block at the previous block time in the recursive zero-knowledge proof of the lower-level ledger.

10. The method according to claim 9, characterized in that, The step of obtaining the zero-knowledge proof commitment generated by the lower-level block at the previous block time in the recursive zero-knowledge proof of the lower-level ledger using the composite hash of the second current block includes: The nodes in the consensus group corresponding to the upper-layer ledger determine whether the zero-knowledge proof commitment of the lower-layer block of the lower-layer ledger meets the verification requirements; In response to the agreement, the node determines that the lower-level ledger is reliable and allows the lower-level ledger to conduct cross-chain transactions with the upper-level ledger. In response to the non-compliance, the node determines that the lower-level ledger is unreliable and does not allow the lower-level ledger to conduct cross-chain transactions with the upper-level ledger.

11. The method according to claim 3, characterized in that, The lower-level ledger includes: a first lower-level ledger and a second lower-level ledger; The step of using the second composite hash value in the first lower-level block composite of the upper-level ledger to point to the lower-level ledger at the previous block time includes: obtaining the third composite hash value in the third current block composite hash of the previous block time in the first lower-level ledger and the fourth composite hash value in the fourth current block composite hash of the previous block time in the second lower-level ledger; storing the third composite hash value and the fourth composite hash value in the first lower-level block composite of the upper-level ledger; and using the third composite hash value in the first lower-level block composite of the upper-level ledger to point to the first lower-level ledger at the previous block time and the fourth composite hash value to point to the second lower-level ledger at the previous block time. The step of using the first composite hash value in the second upper-level block composite of the lower-level ledger to point to the upper-level ledger at the previous block time includes: obtaining the first composite hash value in the first current block composite hash of the previous block time in the upper-level ledger, storing the first composite hash value in the third upper-level block composite of the first lower-level ledger and the fourth upper-level block composite of the second lower-level ledger, using the first composite hash value in the third upper-level block composite of the first lower-level ledger to point to the upper-level ledger at the previous block time, and using the first composite hash value in the fourth upper-level block composite of the second lower-level ledger to point to the upper-level ledger at the previous block time; The step of using the second composite hash value in the second parent block composite of the lower-level ledger to point to the lower-level ledger at the previous block time includes: obtaining the third composite hash value in the third current block composite hash of the previous block time in the first lower-level ledger, storing the third composite hash value in the third parent block composite of the first lower-level ledger, and using the third composite hash value in the third parent block composite of the first lower-level ledger to point to the first lower-level ledger at the previous block time; or obtaining the fourth composite hash value in the fourth current block composite hash of the previous block time in the second lower-level ledger, storing the fourth composite hash value in the fourth parent block composite of the second lower-level ledger, and using the fourth composite hash value in the fourth parent block composite of the second lower-level ledger to point to the second lower-level ledger at the previous block time.

12. An electronic device, characterized in that, The device includes a memory and a processor, the memory and the processor being coupled to each other, the processor being used to execute program instructions stored in the memory to implement the blockchain operation method according to any one of claims 3 to 11.

13. A computer storage medium storing program instructions thereon, characterized in that, When the program instructions are executed by the processor, they implement the blockchain operation method according to any one of claims 3 to 11.

Citation Information

Patent Citations

  • Parallel processing of blockchain procedures

    US20220038257A1

  • Parallel-chain architecture for blockchain systems

    WO2019055585A1