A merkle tree hardware acceleration system for blockchain data validation

By designing a hardware acceleration system tailored to the characteristics of Merkle tree structures, the problems of high computational complexity and long processing time in blockchain data verification are solved, achieving efficient and low-power data verification that is suitable for various blockchain application scenarios.

CN119557305BActive Publication Date: 2026-04-21NORTHWESTERN POLYTECHNICAL UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NORTHWESTERN POLYTECHNICAL UNIV
Filing Date
2024-11-22
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Existing Merkle tree verification schemes are computationally complex and time-consuming in blockchains. Existing hardware acceleration solutions fail to fully utilize the characteristics of the Merkle tree structure, resulting in limited improvement in computational efficiency and making it difficult to meet the needs of high-concurrency scenarios.

Method used

The system is designed with a hardware acceleration mechanism optimized for the characteristics of Merkle tree structures. It includes a control module, address generator, storage unit, computing module, and buffer. Through parallel computing and hardware optimization, it achieves low-power operation and improves data verification efficiency.

Benefits of technology

It improves the computational efficiency of blockchain data verification, reduces power consumption, is suitable for different blockchain application scenarios, and provides an efficient and flexible data verification solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557305B_ABST
    Figure CN119557305B_ABST
Patent Text Reader

Abstract

This invention relates to the field of blockchain technology and discloses a Merkle tree hardware acceleration system for blockchain data verification. The system includes a control module for coordinating and controlling various modules; an address generator for generating addresses of sibling and parent nodes in the Merkle tree based on the indices of the input leaf nodes; a storage unit for storing the leaf, internal, and root node data of the Merkle tree; a computation module for performing data concatenation, hashing, and comparison on the Merkle tree nodes based on the addresses provided by the address generator, and generating intermediate and verification results; and a buffer for temporarily storing node data read from the storage unit and intermediate results output by the computation module. This invention designs a hardware acceleration architecture tailored to the structural characteristics of Merkle trees, improving the computational efficiency of blockchain data verification, achieving low-power operation, and is suitable for the performance requirements of various blockchain application scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain technology, and in particular to a Merkle tree hardware acceleration system for blockchain data verification. Background Technology

[0002] Merkle trees are tree-like data structures widely used in blockchain systems for efficiently verifying data integrity and consistency. By hashing data blocks and building a hash tree layer by layer, Merkle trees can quickly determine whether data has been tampered with. Therefore, in blockchains, Merkle trees are used as an important tool to ensure data security. However, as the scale of blockchain data continues to expand and verification requirements increase, the computational load of Merkle tree verification also increases, leading to longer verification times and becoming a bottleneck affecting Merkle tree verification performance.

[0003] Currently, traditional Merkle tree verification is typically implemented in software, resulting in high computational complexity and long processing times. As data volumes increase, the processing speed of software verification schemes can no longer meet the demands of some high-concurrency scenarios. Meanwhile, existing acceleration solutions mainly rely on general-purpose hardware such as CPUs or GPUs. While these solutions can improve processing speed to some extent, their general applicability makes it difficult to deeply optimize for the characteristics of the Merkle tree structure, limiting the improvement in computational efficiency. Existing hardware acceleration solutions lack a deep understanding and optimization of the Merkle tree structure, failing to fully utilize the hierarchical structure and hash operation characteristics of the Merkle tree, thus hindering further improvements in computational efficiency. Summary of the Invention

[0004] The purpose of this invention is to provide a Merkle tree hardware acceleration system for blockchain data verification. The hardware acceleration architecture is designed based on the characteristics of the Merkle tree structure to improve the computational efficiency of blockchain data verification. Low-power operation is achieved through hardware optimization, making it suitable for the performance requirements of different blockchain application scenarios and providing an efficient and flexible blockchain data verification solution.

[0005] To achieve the above objectives, the present invention provides the following solution:

[0006] A Merkle tree hardware acceleration system for blockchain data verification includes:

[0007] The control module is used to coordinate and control the various modules in the system.

[0008] An address generator is used to generate the addresses of sibling nodes and parent nodes in a Merkle tree based on the indices of the input leaf nodes.

[0009] Storage unit, used to store the leaf nodes, internal nodes and root node data of the Merkle tree;

[0010] The calculation module is used to perform data concatenation, hash operation and data comparison on the Merkle tree nodes based on the address provided by the address generator, and generate intermediate results and verification results.

[0011] A buffer is used to temporarily store node data read from the storage unit and intermediate results output by the computing module;

[0012] The calculation module includes a splicing module, a hashing module, a node comparison module, and a status register. The splicing module is used to splice data between the leaf nodes and their sibling nodes of the Merkle tree. The hashing module is used to perform hash operations on the spliced ​​data. The node comparison module is used to compare the operation result with the root node of the Merkle tree to verify the integrity of the data. The status register is used to record the current status of the calculation module and generate a calculation status signal to feed back to the control module.

[0013] Furthermore, the control module includes an arbitration unit, an encoding unit, a scheduling unit, and an instruction fetching unit. The arbitration unit monitors the computation status signals fed back by each computing module and generates control signals. The encoding unit receives the control signals from the arbitration unit, encodes the instructions to be extracted by the instruction fetching unit and the scheduling unit, and generates execution instructions. The instruction fetching unit extracts the execution instructions from the encoding unit and sends an address generation signal to the address generator. The scheduling unit extracts the execution instructions from the encoding unit, sends a data selection signal to the data selector, and allocates different computation tasks to each computing module through the data selector.

[0014] Furthermore, the control module operates as follows:

[0015] After the control module receives the computation status signal, the arbitration unit generates a control signal based on the computation status signals fed back by each computation module. The encoding unit receives the control signal from the arbitration unit, encodes the instructions to be extracted by the instruction fetching unit and the scheduling unit, and generates an execution instruction. The instruction fetching unit extracts the execution instruction from the encoding unit and sends an address generation signal to the address generator to extract the node data in the Merkle tree. The scheduling unit extracts the execution instruction from the encoding unit and sends a data selection signal to the data selector. The data selector allocates different computation tasks to each computation module according to the task priority, thereby realizing the parallel processing of computation tasks.

[0016] Furthermore, the address generator includes an index update unit, a sibling node index calculation unit, an address translation unit, and a control unit. The index update unit is used to update the current node index of each level using an iterative algorithm and output the currently processed level. The sibling node index calculation unit is used to obtain the sibling node index based on the current node index. The address translation unit is used to receive the sibling node index and the currently processed level, and calculate the corresponding node address using a formula based on the index. The control unit is used to obtain the currently processed level and, based on the total number of levels in the Merkle tree, use a counter to control the number of iterations to end the iterative algorithm loop of the index update unit.

[0017] Furthermore, the address generator operates as follows:

[0018] First, the index update unit receives the input leaf node index and, according to the instructions of the control unit, uses an iterative algorithm to update the node index that needs to be calculated.

[0019] Subsequently, the sibling node index calculation unit generates the sibling node index by XOR operation based on the updated node index. In this process, it determines whether the current node needs to continue index updating or whether the root node has been reached. If m is less than n, it continues to recursively calculate the parent node and sibling node indexes of the current node. If m equals n, it means that the root node has been reached and the recursive operation stops. Here, m represents the current processing level and n represents the total number of levels in the Merkle tree.

[0020] Finally, the address translation unit converts the node index generated by the sibling node index calculation unit into a node address, which is then used to read the corresponding node data from the storage unit.

[0021] Furthermore, in the storage unit, the data of leaf nodes, internal nodes, and root nodes are stored sequentially according to a tree-like hierarchical structure; all leaf node data is located at the top level of the storage unit and is stored sequentially from top to bottom; internal nodes are stored layer by layer downwards according to the results of hash operations, and the root node is located at the bottom level.

[0022] Furthermore, the hash module adopts a parallel computing structure to improve the efficiency of Merkle tree verification; the concatenation module and the hash module pass intermediate results through a buffer to avoid data processing bottlenecks.

[0023] Furthermore, the intermediate results include the concatenated data and the results of the hash operation.

[0024] Furthermore, the computing module operates as follows:

[0025] The calculation module, based on the address provided by the address generator, concatenates data between the leaf nodes and their sibling nodes of the Merkle tree corresponding to the blockchain data. It then generates the hash value of the parent node of the leaf node through hash operations, calculating the hash value of the parent node at each level through layer-by-layer hash operations until the root node hash value of the Merkle tree is finally generated. During this process, the node comparison module generates a complete "hash path," which is all the intermediate hash values ​​from the leaf node to the root node. Once a new root node hash value is generated, the node comparison module compares it with the original Merkle tree root node hash value stored in the system. If they match, the blockchain data is determined not to have been tampered with, the verification passes, and the data integrity is confirmed. If they do not match, the blockchain data is determined to have been tampered with or is incomplete, and the verification fails.

[0026] Furthermore, the storage unit includes a memory for storing leaf nodes, internal nodes, and root node data of the Merkle tree, and the system also includes a storage read / write unit, which is used to perform node data read / write operations on the memory according to the address provided by the address generator.

[0027] According to specific embodiments provided by the present invention, the following technical effects are disclosed: The Merkle tree hardware acceleration system for blockchain data verification provided by the present invention can solve the problems of high power consumption, slow speed, and insufficient flexibility in the Merkle tree verification process of existing blockchain data verification platforms; the system is based on a hardware acceleration architecture, specifically designed for Merkle tree verification, aiming to improve the efficiency of blockchain data verification, and achieves low-power operation through hardware optimization. Furthermore, through the optimized configuration of multiple computing modules, the present invention can process different computing tasks in parallel, effectively addressing the performance requirements in different blockchain application scenarios, and providing an efficient and flexible blockchain data verification solution. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in 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.

[0029] Figure 1 A schematic diagram of the structural framework of the Merkle tree hardware acceleration system for blockchain data verification provided by the present invention;

[0030] Figure 2 This is a flowchart illustrating the workflow of the Merkle tree hardware acceleration system for blockchain data verification according to the present invention.

[0031] Figure 3 This is a schematic diagram of the control module in this invention;

[0032] Figure 4 This is a schematic diagram of the computing module in this invention;

[0033] Figure 5 This is a schematic diagram of the data structure of the storage unit in this invention;

[0034] Figure 6 This is a schematic diagram of the address generator in this invention;

[0035] Figure 7 This is a schematic diagram of the address generator's workflow in this invention;

[0036] Figure 8 This is a diagram showing the calculated state of the status register in this invention. Detailed Implementation

[0037] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0038] The Merkle tree hardware acceleration system for blockchain data verification provided by this invention designs a hardware acceleration architecture tailored to the characteristics of the Merkle tree structure, improves the computational efficiency of blockchain data verification, and achieves low-power operation through hardware optimization. It is suitable for the performance requirements of different blockchain application scenarios and provides an efficient and flexible blockchain data verification solution.

[0039] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0040] like Figure 1 As shown, the present invention provides a Merkle tree hardware acceleration system for blockchain data verification, including a control module, an address generator, a storage unit, a computing module, and a buffer; the entire system achieves efficient Merkle tree verification through the collaborative work of each module, thereby accelerating the blockchain data verification process.

[0041] like Figure 2 As shown, the Merkle tree hardware acceleration system based on blockchain data verification first receives control signal I and blockchain data D to be verified from the user end. iThen, based on the control signals, the address generator and storage read / write unit extract the data corresponding to the Merkle path from the storage unit, and then combine the extracted data with the blockchain data to be verified (D). i The data is sequentially processed through data selector 1 and data selector 2 to obtain the final root hash value. Finally, the calculated root hash value is compared with the stored root node value to obtain the verification result.

[0042] The following sections describe each module in the Merkle tree hardware acceleration system used for blockchain data verification:

[0043] First, the control module

[0044] The control module provided in this embodiment of the invention is used to coordinate and control the various modules in the system.

[0045] The control module includes an arbitration unit, an encoding unit, a scheduling unit, and an instruction fetching unit. The arbitration unit monitors the computation status signals fed back by each computing module, generates control signals to ensure that conflicts between computing tasks are handled promptly, and guarantees the correct and smooth execution of each computing task. The encoding unit receives the control signals from the arbitration unit, encodes the instructions to be fetched by the instruction fetching unit and the scheduling unit, generates execution instructions, and guides the computing modules and storage units to perform corresponding operations. The instruction fetching unit extracts the execution instructions from the encoding unit and sends an address generation signal to the address generator to extract relevant node data from the Merkle tree. The scheduling unit extracts instructions from the encoding unit, sends a data selection signal to the data selector 2, and allocates different computing tasks to each computing module to achieve parallel processing of computing tasks.

[0046] See Figure 3 The control module, through the collaboration of the instruction fetching unit, scheduling unit, encoding unit, and arbitration unit, effectively completes the scheduling and computation management of system tasks. The workflow of the control module in this embodiment is as follows: Figure 3 As shown. Through the collaboration of the instruction fetching unit, scheduling unit, encoding unit, and arbitration unit, the system can efficiently complete the allocation and execution of computing tasks.

[0047] The control module operates as follows:

[0048] After the control module receives the computation status signal, the arbitration unit generates a control signal based on the computation status signals fed back by each computation module. The encoding unit receives the control signal from the arbitration unit, encodes the instructions to be extracted by the instruction fetching unit and the scheduling unit, and generates an execution instruction. The instruction fetching unit extracts the execution instruction from the encoding unit and sends an address generation signal to the address generator to extract the node data in the Merkle tree. The scheduling unit extracts the execution instruction from the encoding unit and sends a data selection signal to the data selector. The data selector allocates different computation tasks to each computation module according to the task priority, thereby realizing the parallel processing of computation tasks.

[0049] Second, address generator

[0050] The address generator is used to generate the addresses of sibling and parent nodes in a Merkle tree based on the indices of the input leaf nodes. The address generator can recursively generate the addresses of each sibling and parent node based on a given node index, ensuring fast and accurate access to node data within the verification path.

[0051] The structural diagram and working principle diagram of the address generator in this embodiment are as follows: Figure 6 and Figure 7 As shown in the diagram, the index update unit, sibling node index calculation unit, and address translation unit work together to generate and update the node address. The index update unit is responsible for receiving the current node index i. k (This represents the index of the currently processed node in the Merkle tree). The current node index is updated using an iterative algorithm, specifically a right shifter. The sibling node index calculation unit calculates the sibling node index based on the current node index, typically used to verify sibling nodes in the Merkle tree. The address translation unit receives the sibling node index and the currently processed level m (indicating the height of the node's tree level), performs further address calculations, and generates the final node address. The control unit receives the currently processed level and uses a counter to control the calculation process to end the loop. Figure 7 As shown, the address generator recursively generates the addresses of sibling nodes and parent nodes, thus providing the necessary data support for Merkle tree verification.

[0052] The address generator works as follows:

[0053] First, the index update unit receives the input leaf node index and updates the node index that needs to be calculated according to the instructions of the control unit. The control unit is responsible for overall scheduling and task allocation, determining the sibling node or parent node to be processed next by updating the input index. Then, the sibling node index calculation unit generates the sibling node index using an XOR operation based on the updated node index. During this process, the system... Figure 7The system uses an m / n structure (where m represents the current processing level and n represents the total number of levels in the Merkle tree) to determine whether the current node needs further index updates or whether the root node has been reached. If m is less than n, the system continues to recursively calculate the indices of the current node's parent and sibling nodes; if m equals n, it indicates that the root node has been reached, and the recursive operation stops. Finally, the address translation unit converts the node index generated by the sibling node index calculation unit into a memory address, ensuring that the corresponding node's data can be accurately read from the storage unit. This address translation operation is a crucial part of the hardware acceleration system. By directly calculating the physical address of the node in storage, it avoids traditional recursive traversal and significantly improves the efficiency of data access.

[0054] The entire process is carried out in an orderly manner under the scheduling of the control unit, ensuring that node index updates, calculations and transformations can be performed quickly and efficiently during large-scale data verification, thereby achieving rapid Merkle tree verification.

[0055] Third, storage unit

[0056] The storage unit is used to store the leaf nodes, internal nodes, and root node data of the Merkle tree.

[0057] Figure 5 The diagram illustrates how storage units store data in a hierarchical structure. The design of these storage units ensures efficient data storage and retrieval, thereby supporting a rapid data verification process.

[0058] By tightly integrating an address generator and an index update unit, the storage unit can quickly locate the corresponding node data based on the input leaf node index. Simultaneously, the storage unit also allows for the generation of parent and sibling node addresses using recursive algorithms, ensuring efficient access to each required node within the verification path.

[0059] See Figure 5 The storage unit in this embodiment, through a reasonable structural design, achieves efficient storage of leaf nodes, internal nodes, and the root node, supporting fast read and write operations for hardware-accelerated verification. The specific working principle is as follows:

[0060] In the storage units of a Merkle tree, leaf nodes, internal nodes, and the root node are stored sequentially in a tree-like hierarchical structure. The storage location of each node is calculated by an address generator, which allocates the node's storage address through hardware based on the node's index and the current hierarchical relationship. The entire process is automatic, without the need for complex recursive traversal, ensuring that the node's address calculation can be completed in constant time, thereby improving storage and access efficiency.

[0061] Specifically, the index update unit first determines the node index that needs to be stored, which indicates the location of a node in the Merkle tree. Next, the sibling node index calculation unit uses an XOR operation to generate the sibling node index of the current node, ensuring that related sibling nodes are calculated and stored simultaneously. Then, the address translation unit translates the node's index into a physical storage address, ensuring that the physical storage location of data within the storage unit is unique and efficient.

[0062] exist Figure 5 In this storage structure, all leaf nodes are located at the top level of the storage unit and are stored sequentially from top to bottom. Internal nodes are stored layer by layer downwards according to the hash calculation results, with the root node located at the bottom level. Since the storage location of each node is dynamically calculated by an address generator, this ensures efficient access to data during read and write processes. The system directly obtains the physical address of the node through hardware, avoiding complex recursive lookups in software processing, thereby significantly improving the access speed of the storage unit.

[0063] The storage unit includes a memory for storing leaf nodes, internal nodes, and root node data of the Merkle tree. The system also includes a storage read / write unit, which is used to perform node data read / write operations on the memory according to the address provided by the address generator.

[0064] Furthermore, hardware-accelerated verification can directly access the node's storage address when reading or writing data, without needing to go through complex path lookups. Each node's address is calculated and then directly stored in physical memory. When verification is required, the system only needs to access the node data directly based on the address, thus significantly shortening the data access time during the verification process and achieving efficient storage and retrieval operations.

[0065] In summary, by rationally designing the structure of the storage unit and combining it with the hardware acceleration mechanism of the address generator and address translation unit, the system can achieve efficient storage and fast access to each node in the Merkle tree, significantly improving the performance of blockchain data verification.

[0066] Fourth, the calculation module

[0067] The calculation module is used to perform data concatenation, hash operation and data comparison on Merkle tree nodes based on the address provided by the address generator, and generate intermediate results and verification results.

[0068] The computation module is one of the core modules of the entire system, responsible for data concatenation, hash operations, and comparison. For example... Figure 4As shown, the calculation module includes a splicing module, a hashing module, a node comparison module, and a status register. The splicing module is used to splice data between the leaf nodes and their sibling nodes of the Merkle tree. The hashing module is used to perform hash operations on the spliced ​​data based on the SHA-256 algorithm. The node comparison module is used to compare the operation result with the root node of the Merkle tree to verify the integrity of the data. The status register is used to record the calculation status of the calculation module and generate a calculation status signal to feed back to the control module.

[0069] The hash module employs a parallel computing structure to improve the efficiency of Merkle tree verification; the concatenation module and the hash module exchange intermediate results via a buffer to avoid data processing bottlenecks. The intermediate results include the concatenated data and the hash operation result.

[0070] When the system receives blockchain data to be verified (such as a transaction in the blockchain), it first uses the data as a leaf node of the Merkle tree and begins to perform layer-by-layer hashing operations.

[0071] The calculation module works as follows:

[0072] The calculation module, based on the address provided by the address generator, concatenates data between the leaf nodes and their sibling nodes of the Merkle tree corresponding to the blockchain data. It then generates the hash value of the parent node of each leaf node through hash operations, calculating the hash value of the parent node at each level through layer-by-layer hash operations until the root node hash value of the Merkle tree is finally generated. During this process, the node comparison module generates a complete "hash path," that is, all intermediate hash values ​​from the leaf node to the root node. Once a new root node hash value is generated, the node comparison module compares the new root node hash value with the original Merkle tree root node hash value stored in the system. If they match, the blockchain data is determined not to have been tampered with, the verification passes, and the data integrity is confirmed. If they do not match, the blockchain data is determined to have been tampered with or is incomplete, and the verification fails. Therefore, the node comparison module ensures the integrity of data during transmission and processing by comparing the calculated root node with the originally stored root node.

[0073] In this embodiment, the status register, as part of the computing module, is responsible for recording the progress of the computing task and feeding back the status signals to the control module. The status bits of the status register indicate the working state of the computing module, such as... Figure 8 As shown, the status register displays states such as "Calculating", "Calculation Completed", or "Idle". Its purpose is to help the control module understand the progress of the calculation in real time, ensuring that the next operation can be initiated or adjusted promptly.

[0074] See Figure 8 This demonstrates the tracking and recording of various states during the computation process, ensuring the system can monitor the execution progress of each computation task in real time. The status register plays a crucial role in task scheduling and priority adjustment; the control module can adjust task allocation promptly based on feedback from the status register, thereby ensuring the system's efficient operation.

[0075] Fifth, buffer zone

[0076] The buffer is used to temporarily store node data read from the storage unit and intermediate results output by the computing module.

[0077] In this embodiment, the buffer acts as an intermediate cache between data reading and computation, storing node data read from the storage unit and intermediate results generated during computation. By setting up the buffer, the data transmission pressure between modules can be effectively alleviated, data transmission bottlenecks can be avoided, and the system can still operate efficiently in a high-concurrency environment.

[0078] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus the necessary hardware platform. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the work or control methods described in the various embodiments or some parts of the embodiments.

[0079] Those skilled in the art will understand that embodiments of the present invention can be implemented in various forms, including methods, systems, or computer program products. Therefore, the present invention can be implemented as a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention can also be implemented as a computer program product on a computer-usable storage medium, containing computer-usable program code.

[0080] The present invention has been described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and / or computer program products in the embodiments. It should be understood that each flow and / or block in the flowchart illustrations and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device so that the instructions, which execute via the processor of the computer or other programmable device, implement the function specified in one or more flows in the flowchart and / or one or more blocks in the block diagram.

[0081] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that can perform the functions specified in one or more flowcharts and / or one or more blocks in a block diagram.

[0082] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other apparatus so as to implement the processing by instructions that execute on the computer or other programmable apparatus, thereby providing steps for performing one or more processes in the flowchart and / or one or more blocks in the block diagram that specify the functions.

[0083] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A Merkle tree hardware acceleration system for blockchain data verification, characterized in that, include: The control module is used to coordinate and control the various modules in the system. The control module includes an arbitration unit, an encoding unit, a scheduling unit, and an instruction fetching unit. The operation method of the control module is as follows: After the control module receives the computation status signal, the arbitration unit generates a control signal based on the computation status signals fed back by each computation module; the encoding unit receives the control signal from the arbitration unit, encodes the instructions to be extracted by the instruction fetching unit and the scheduling unit, and generates an execution instruction; the instruction fetching unit extracts the execution instruction from the encoding unit and sends an address generation signal to the address generator to extract the node data in the Merkle tree; the scheduling unit extracts the execution instruction from the encoding unit, sends a data selection signal to the data selector, and the data selector allocates different computation tasks to each computation module according to the task priority, thereby realizing the parallel processing of computation tasks; An address generator is used to generate the addresses of sibling nodes and parent nodes in a Merkle tree based on the indices of the input leaf nodes. Storage unit, used to store the leaf nodes, internal nodes and root node data of the Merkle tree; The calculation module is used to perform data concatenation, hash operation and data comparison on the Merkle tree nodes based on the address provided by the address generator, and generate intermediate results and verification results. A buffer is used to temporarily store node data read from the storage unit and intermediate results output by the computing module; The calculation module includes a concatenation module, a hashing module, a node comparison module, and a status register. The concatenation module concatenates data between leaf nodes and their sibling nodes of a Merkle tree. The hashing module performs hash operations on the concatenated data. The node comparison module compares the operation result with the root node of the Merkle tree to verify the data integrity. The status register records the current state of the calculation module and generates a calculation status signal to feed back to the control module. The calculation status signal includes "in progress," "computation complete," or "idle." The hashing module adopts a parallel computing structure. Intermediate results are passed between the concatenation module and the hashing module through a buffer. The calculation module works as follows: The calculation module, based on the address provided by the address generator, concatenates data between the leaf nodes and their sibling nodes of the Merkle tree corresponding to the blockchain data. It then generates the hash value of the parent node of the leaf node through hash operations, calculating the hash value of the parent node at each level through layer-by-layer hash operations until the root node hash value of the Merkle tree is finally generated. The node comparison module generates a complete "hash path," which is all the intermediate hash values ​​from the leaf node to the root node. Once a new root node hash value is generated, the node comparison module compares the new root node hash value with the original Merkle tree root node hash value stored in the system. If they match, the blockchain data is determined not to have been tampered with, the verification passes, and the data integrity is confirmed. If they do not match, the blockchain data is determined to have been tampered with or is incomplete, and the verification fails.

2. The Merkle tree hardware acceleration system for blockchain data verification according to claim 1, characterized in that, The arbitration unit is used to monitor the computing status signals fed back by each computing module and generate control signals; the encoding unit is used to receive the control signals from the arbitration unit, encode the instructions to be extracted by the instruction fetching unit and the scheduling unit, and generate execution instructions; the instruction fetching unit is used to extract the execution instructions from the encoding unit and send an address generation signal to the address generator; the scheduling unit is used to extract the execution instructions from the encoding unit, send a data selection signal to the data selector, and allocate different computing tasks to each computing module through the data selector.

3. The Merkle tree hardware acceleration system for blockchain data verification according to claim 1, characterized in that, The address generator includes an index update unit, a sibling node index calculation unit, an address translation unit, and a control unit. The index update unit is used to update the current node index of each level using an iterative algorithm and output the currently processed level. The sibling node index calculation unit is used to obtain the sibling node index based on the current node index. The address translation unit is used to receive the sibling node index and the currently processed level, and calculate the corresponding node address using a formula based on the index. The control unit is used to obtain the currently processed level and, based on the total number of levels in the Merkle tree, use a counter to control the number of iterations to end the iterative algorithm loop of the index update unit.

4. The Merkle tree hardware acceleration system for blockchain data verification according to claim 3, characterized in that, The address generator works as follows: First, the index update unit receives the input leaf node index and, according to the instructions of the control unit, uses an iterative algorithm to update the node index that needs to be calculated. Subsequently, the sibling node index calculation unit generates the sibling node index by XOR operation based on the updated node index. In this process, it determines whether the current node needs to continue index updating or whether the root node has been reached. If m is less than n, it continues to recursively calculate the parent node and sibling node indexes of the current node. If m equals n, it means that the root node has been reached and the recursive operation stops. Here, m represents the current processing level and n represents the total number of levels in the Merkle tree. Finally, the address translation unit converts the node index generated by the sibling node index calculation unit into a node address, which is then used to read the corresponding node data from the storage unit.

5. The Merkle tree hardware acceleration system for blockchain data verification according to claim 1, characterized in that, In the storage unit, the data of leaf nodes, internal nodes and root nodes are stored sequentially according to a tree-like hierarchical structure; all leaf node data is located at the top level of the storage unit and is stored sequentially from top to bottom; internal nodes are stored layer by layer downwards according to the results of hash operations, and the root node is located at the bottom level.

6. The Merkle tree hardware acceleration system for blockchain data verification according to claim 1, characterized in that, The hash module adopts a parallel computing structure; the concatenation module and the hash module pass intermediate results through a buffer.

7. The Merkle tree hardware acceleration system for blockchain data verification according to claim 1, characterized in that, The intermediate results include the concatenated data and the results of the hash operation.

8. The Merkle tree hardware acceleration system for blockchain data verification according to claim 1, characterized in that, The storage unit includes a memory for storing leaf nodes, internal nodes, and root node data of the Merkle tree. The system also includes a storage read / write unit, which is used to perform node data read / write operations on the memory according to the address provided by the address generator.

Citation Information

Patent Citations

  • State verification method and device in block chain system, node and block chain system

    CN115641141A