AMTs-based blockchain verifiable storage method
By storing version information in the AMTs tree and generating proofs using the Merkle tree, the problem of low storage efficiency of AMTs is solved, and more efficient blockchain storage updates and queries are achieved.
Patent Information
- Application Number
- CN202211569397.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-08
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-12-08
AI Technical Summary
The existing AMTs methods use expensive elliptic curve multiplication operations in blockchain storage, resulting in slow state updates and cannot effectively solve the bottleneck problem of underlying storage I/O read and write.
By constructing the AMTs tree to store keywords and version information, and using the Merkle tree to store keywords, versions and data value information, the version number is updated by adding operation, multiplication calculation is reduced, and the Merkle tree generates proofs to improve storage efficiency.
It has achieved faster proof generation and maintenance, improved blockchain storage efficiency, 7 times faster than existing MPT solutions and 2.7 times faster than simple AMTs solutions.
Smart Images

Figure CN115952235B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of big data processing and information technology, and more specifically, to a blockchain verifiable storage method based on Authenticated Multipoint Evaluation Trees (AMTs). Background Art
[0002] As blockchain technology develops and its application scenarios gradually expand, a complete blockchain system will inevitably include a storage module. Overall, blockchain systems can indeed play a role in data persistence. Currently, typical blockchain systems use a key-value format to store blockchain ledger state, with the primary key being the keyword and the value being the value.
[0003] Key-value distributed storage systems offer fast query speeds, large data volumes, and high concurrency, making them ideal for queries based on primary keys. A key-value database stores data as key-value pairs, similar to a Java map. The entire database can be thought of as a large map, where each key corresponds to a unique value.
[0004] However, key-value distributed storage systems cannot perform complex conditional queries. When modifying a key-value pair, the hashes of all nodes on the path from the leaf node to the root node need to be calculated and updated.
[0005] See also Figure 1 , Figure 1 The following is a schematic diagram of the structure of a key-value distributed storage system. Figure 1 As shown, each update along the path amplifies the I / O read and write operations of the underlying storage. For example, a simple payment transaction involves at least two state updates to the ledger, namely, deducting and increasing the balances of two accounts. As the throughput of new blockchains approaches thousands of transactions per second, storage has become a new bottleneck in blockchain development.
[0006] Currently, there are some solutions in the industry to optimize the above problems, such as the AMTs (authenticated multipoint evaluation tree)-based method for scheduled updates, which can reduce I / O reading and writing.
[0007] For example, taking n = 8, AMTs calculates its Lagrangian interpolation, that is, satisfying f(i) = a i (where 1≤I≤8), the principle is as follows:
[0008] First, split F(X) into two functions: F0(X) and F1(X), that is
[0009] F(X)=F0(X)+F1(X)
[0010] in,
[0011]
[0012]
[0013] Similarly, by splitting down in sequence, F0(X) can be split into F 0,0 (X) and F 0,1 (X), that is, F0(X)=F 0,0 (X)+F 0,1 (X), repeat the above steps to obtain the composition of each node of AMTs.
[0014] See also Figure 2 , Figure 2 The figure shows the structure diagram of AMTs that can verify the composition of each node tree. Figure 2 As shown, each node in the AMTs tree consists of two parts:
[0015] (1) The commitment form of the function;
[0016] (2) Batch proof of the index for which this function is always 0.
[0017] Please refer to Figure 3 , Figure 3 The figure shows the change path and verifiable proof points involved when the value at x=7 is updated in AMTs verifiable storage. Figure 3 As shown in the figure, when a storage entry needs to be updated, AMTs will go from the root to the leaf node corresponding to the entry and update the associated elements on the path. The other nodes remain unchanged, and when proving, it is only necessary to prove that the value of its neighbor node is 0; therefore, the AMTs scheme can spend less time maintaining the proof than the MPT scheme.
[0018] However, the AMTs method also has its shortcomings. It uses complex and expensive elliptic curve multiplication operations, and the state update may be slower than MPT (Merkle Patricia Tree). That is, although AMTs takes less time to update the commitment proof, it is still very time-consuming for the blockchain system. The following figure shows the test results on an Intel i9-10900K machine. The elliptic curve calculation time of AMTs takes about 0.1ms, which is even slower than accessing disk storage (e.g. Figure 4 shown).
[0019] The reason for this is that the AMTs approach uses a complex and expensive elliptic curve multiplication operation, namely, C' = C + δ*G, where C' represents the new state to be calculated, C represents the previous state, δ represents the difference along the path of change, and G is the starting point parameter of the selected elliptic curve. When the elliptic curve is fixed, G is a constant. Because of the use of elliptic curve multiplication, state updates can be slower than the existing MPT (Merkle Patricia Tree). Therefore, using AMTs alone cannot effectively solve the problem of underlying storage I / O read and write bottlenecks.
[0020] In other words, although the AMTs solution can improve the amount of proof maintenance and save time, it cannot truly solve the problem of efficient verifiable storage because it uses expensive elliptic multiplication calculations. Summary of the Invention
[0021] The purpose of the present invention is to provide a blockchain verifiable storage method based on AMTs, which can effectively improve the efficiency of blockchain storage.
[0022] To achieve the above object, the technical solution of the present invention is as follows:
[0023] A blockchain verifiable storage method based on AMTs, comprising an AMTs-based blockchain storage step S1 and a verification step S2:
[0024] The step S1 specifically includes:
[0025] Step S11: Constructing an AMTs tree for the updated version. Each node in the AMTs tree consists of two parts:
[0026] ①、Commitment form of function;
[0027] ②. Prove that there is a function outside this function that is always 0;
[0028] Furthermore, the AMTs tree is used to store key and version information of verifiable storage data. When a storage entry needs to be added, the key of the node is calculated based on the storage entry, and the version is set to the initial value. When a storage entry of the node needs to be updated, the key and version information of the verifiable storage data on the node are updated from the root of the AMTs tree to the node corresponding to the storage entry. That is, when the data of the leaf node changes, it is only necessary to increase the version number of the associated node on the path from the node to the root node by 1.
[0029] Step S12: Expand the data of the storage entries in each block to construct a Merkle tree to store the keyword, version and data value information (key, version, value) of each transaction block;
[0030] When the AMTs tree needs to add a storage entry, the Merkle tree adds a new node, sets the key, version number information to 1, and the value of Value to a node in the Merkle tree, forming the key, version, and data value information (key, version, value) and generating a verifiable storage proof;
[0031] When the AMTs tree needs to modify a storage entry, the Merkle tree adds a new node, and the keyword Key, the version number information increased by 1, and the value of Value are stored in a node of the Merkle tree to form the keyword, version, and data value information (key, version, value), and generate a verifiable storage proof;
[0032] The verifiable step S2 includes:
[0033] Using the node added to the Merkle tree, the verifiable storage proof finds the value of the Value of the node on the AMTs tree according to the keyword and version number information (key, version) of the node on the AMTs tree.
[0034] The present invention also proposes a readable storage medium storing executable instructions, which are used to execute the AMTs-based blockchain verifiable storage method.
[0035] The present invention also provides a data processing terminal, which is used to serve as a consensus node of a P2P network, receive, verify consensus, and store blocks in the P2P network. The data processing terminal includes:
[0036] The above-mentioned readable storage medium;
[0037] A processor that retrieves and executes executable instructions in the readable storage medium to perform a blockchain verifiable storage method based on AMTs.
[0038] The present invention also proposes a P2P network, wherein the consensus node of the P2P network is the above-mentioned data processing terminal.
[0039] It can be seen from the above technical solution that the present invention proposes a new blockchain verifiable storage method based on the AMTs tree and updating the proof in a versioned manner. Compared with the existing MPT solution and the pure AMTs solution, the generation and maintenance of proof are faster, which can effectively improve the efficiency of blockchain storage. Through experimental data comparison, compared with the existing MPT solution, the speed is 7 times faster, and compared with the pure AMTs solution, the speed is 2.7 times faster. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 The diagram shows the structure of a key-value distributed storage system.
[0041] Figure 2 The diagram shows the structure of the tree structure of each node that can be verified and stored by AMTs.
[0042] Figure 3 A diagram showing the change path and verifiable proof points involved when the value at x=7 is updated in AMTs verifiable storage.
[0043] Figure 4 Schematic diagram showing the time taken for ellipse calculation related operations of the prior art AMTs method
[0044] Figure 5 Schematic diagram of using AMTs tree to store version number information in an embodiment of the present invention
[0045] Figure 6 This is a schematic diagram of a preferred embodiment of the AMTs-based blockchain verifiable storage method of the present invention. DETAILED DESCRIPTION
[0046] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0047] It should be noted that in the following specific embodiments, when describing the embodiments of the present invention in detail, in order to clearly represent the structure of the present invention for the convenience of explanation, the structures in the accompanying drawings are not drawn according to general proportions, and are partially enlarged, deformed and simplified. Therefore, it should be avoided to understand this as a limitation of the present invention.
[0048] In the following specific embodiments of the present invention, please refer to Figure 5 , Figure 5 The figure shows a schematic diagram of using AMTs tree to store version number information in an embodiment of the present invention. Figure 5 As shown, the method includes an AMTs-based blockchain storage step S1 and a verification step S2.
[0049] In the LVMT-based blockchain storage step S1, the present invention proposes a new versioned blockchain verifiable storage method based on the AMTs solution. The core idea of the invention is: using the AMTs tree to store the keywords and version number information of the verifiable storage data, namely (key, version); and then using the Merkle tree to store the keyword, version and data value information (key, version, value).
[0050] The step S1 specifically includes:
[0051] Step S11: Constructing an AMTs tree for the updated version. Each node in the AMTs tree consists of two parts:
[0052] ①、Commitment form of function;
[0053] ②. Prove that there exists a function outside this function that is always 0.
[0054] Please refer to Figure 6 , Figure 6 The figure shows a schematic diagram of data storage method on AMTs in an embodiment of the present invention. Figure 6 As shown on the left, the AMTs tree is used to store the keyword and version (key, version) information of each node; when a storage entry needs to be added, the node's keyword Key is calculated based on the storage entry, and the version Version is set to the initial value; when a storage entry of the node needs to be updated, the data changes of the version information in the node (key, version) are updated from the root Root of the AMTs tree to the node corresponding to the storage entry. That is, when the data of the leaf node changes, it is only necessary to add 1 to the version number of the associated node on the path from the node to the root node, and generate a verifiable storage proof.
[0055] Please check again Figure 5 ,AMTs tree is used to update version changes, that is, to update node keywords and version (key, version) information data changes. When the node information data changes, it is only necessary to add 1 to the version number on the path from the node to the root node. The operation performed is an addition operation, C'=C+G, where C' represents the new state to be calculated, C represents the previous state, and G represents the starting parameter of the elliptic curve. When the elliptic curve is determined, it is a constant.
[0056] Please refer to Figure 6 As shown on the right:
[0057] Step S12: Expand the data of the storage entries in each block to construct a Merkle tree to store the keyword, version and data value information (key, version, value) of each transaction block;
[0058] When the AMTs tree needs to add a storage entry, the Merkle tree adds a new node, and the keyword Key, version number information and Value value are stored on one of the nodes of the Merkle tree to form the keyword, version and data value information (key, version, value) data.
[0059] When the AMTs tree needs to modify a storage entry, the Merkle tree adds a new node, sets the keyword Key, version number information to plus 1, and the value of Value, and stores it on one of the nodes of the Merkle tree to form the keyword, version and data value information (key, version, value) data.
[0060] In other words, the extended Merkle tree can be used to store keywords, versions, and data value information (key, version, value). It takes advantage of the Merkle tree's fast node addition and proof generation (since data modification and updating are slow, the Merkle tree is not updated). It only adds data, so that each block generates a corresponding Merkle tree, and each version change must be added as a node in the Merkle tree.
[0061] Therefore, it can be seen from the above technical solution of the present invention that it is unnecessary to perform the multiplication calculation for proof on the AMTs tree, but instead turns it into an addition calculation (the multiplication calculation requires 160us, while the addition calculation only requires 1us), which saves a lot of time in the generation and maintenance of verifiable storage.
[0062] Furthermore, by generating keyword, version, and data value information (key, version, value) nodes on the extended merkle tree, changes in value will not be updated on the merkle tree. Instead, new nodes will be added to the merkle tree through version changes and proofs will be generated, saving a lot of time.
[0063] The verifiable step S2 includes:
[0064] Using the node added to the Merkle tree, the verifiable storage proof finds the value of the Value of the node on the AMT tree according to the keyword and version number information (key, version) of the node on the AMTs tree.
[0065] To summarize, in an embodiment of the present invention, if the stored value Value is to be modified, it is necessary to add 1 to the version information on the AMTs and generate a proof, and to store the (key, version, value) information on the extended merkle tree and generate a proof.
[0066] Specifically, to modify the value of a storage node, first find the corresponding AMTs point based on the key value and increment the version number by 1. At the same time, the node versions along the line are also incremented by 1. In other words, the AMTs tree is used to store version number information, and the change in the node value is replaced by the change in the version number. The polynomial multiplication operation of AMTs is converted into an addition operation, saving computing time and reducing the number of read and write operations of the underlying I / O.
[0067] Furthermore, a node is added to the expanded Merkle tree, and the key, the version number incremented by 1, and the value of the value are stored in a new node of the Merkle tree. A verifiable storage proof is generated to prove that the value of the value can indeed be found based on (key, version). In other words, the expanded Merkle tree is used to store (key, version, value) and generate a proof. The tree only adds nodes to store the value without modifying the value, which improves the efficiency of verifiable storage.
[0068] The present invention also proposes a readable storage medium storing executable instructions, which are used to execute the AMTs-based blockchain verifiable storage method.
[0069] The present invention also proposes a data processing terminal, which is used to serve as a consensus node of a P2P network, receive, consensus verify and store blocks in the P2P network. The data processing terminal includes: a readable storage medium; a processor, which is used to call and execute executable instructions in the readable storage medium to execute a blockchain verifiable storage method based on AMTs.
[0070] Those skilled in the art will appreciate that all or part of the steps in the above method can be performed by instructing relevant hardware (e.g., a processor) through a program, and the program can be stored in a readable storage medium, such as a read-only memory, a disk, or an optical disk. All or part of the steps in the above embodiment can also be implemented using one or more integrated circuits. Accordingly, each module in the above embodiment can be implemented in the form of hardware, such as by implementing its corresponding functions through an integrated circuit, or in the form of a software functional module, such as by executing a program / instruction stored in a memory through a processor to implement its corresponding function. The embodiments of the present invention are not limited to any particular form of combination of hardware and software.
[0071] The present invention also proposes a P2P network, wherein the consensus node of the P2P network is the aforementioned data processing terminal.
[0072] The above descriptions are merely preferred embodiments of the present invention, and the embodiments are not intended to limit the scope of patent protection of the present invention. Therefore, any equivalent structural changes made using the description and drawings of the present invention should also be included in the scope of protection of the present invention.
Claims
1. A blockchain verifiable storage method based on a verifiable multi-point evaluation tree, characterized in that: It includes the AMTs-based blockchain storage step S1 and the verification step S2: The step S1 specifically includes: Step S11: Constructing an AMTs tree for the updated version. Each node in the AMTs tree consists of two parts: ①、Commitment form of function; ②. Prove that there is a function outside this function that is always 0; Furthermore, the AMTs tree is used to store the key and version information of the verifiable stored data, i.e., (key, version) information. When a storage entry needs to be added, the key of the node is calculated based on the storage entry, and the version is set to the initial value. When a storage entry of the node needs to be updated, the version information in the key and version of the verifiable stored data on the node is updated from the root of the AMTs tree to the node corresponding to the storage entry. That is, when the data of a leaf node changes, it is only necessary to increase the version number of the associated node on the path from the node to the root node by 1. Step S12: Expand the data of the storage entries in each block to construct a Merkle tree to store the keyword, version and data value information (key, version, value) of each transaction block; When the AMTs tree needs to add a storage entry, the Merkle tree adds a new node and stores the key, version number information and value in one of the nodes of the Merkle tree to form the key, version and data value information (key, version, value) and generate a verifiable storage proof; When the AMTs tree needs to modify a storage entry, the Merkle tree adds a new node and stores the keyword Key, the version number information increased by 1, and the value of Value on the node of the Merkle tree to form the keyword, version, and data value information (key, version, value) and generate a verifiable storage proof; The verifiable step S2 includes: Using the node added to the Merkle tree, the verifiable storage proof finds the value of the Value of the node on the AMTs tree according to the keyword and version number information (key, version) of the node on the AMTs tree.
2. A readable storage medium storing executable instructions for executing the blockchain verifiable storage method based on a verifiable multi-point evaluation tree as claimed in claim 1.
3. A data processing terminal, configured to serve as a consensus node in a P2P network, receiving, performing consensus verification, and storing blocks in the P2P network, the data processing terminal comprising: The readable storage medium according to claim 2; A processor that retrieves and executes executable instructions in the readable storage medium to perform a blockchain verifiable storage method based on a verifiable multi-point evaluation tree.
4. A P2P network, characterized in that: The consensus node of the P2P network is the data processing terminal described in claim 3.
Citation Information
Patent Citations
Bill file processing method and device, medium and electronic equipment
CN110598007A
Automatically storing metrics relating to payments in a blockchain
US20210264420A1