A data storage method based on an adaptive merkle tree suitable for high-performance blockchains

CN117692123BActive Publication Date: 2026-09-18FUDAN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311488601.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-09
Publication Date
2026-09-18
Estimated Expiration
2043-11-09

AI Technical Summary

Technical Problem

随机读取操作相对于顺序读取操作需要更多的时间开销,磁盘中的LevelDB,随机读性能非常低下,每次读取数据会消耗大量时间

Benefits of technology

[0030] The adaptive Merkle tree (AMT) of this invention features a large node span, which reduces the tree's height while providing adaptive adjustment. The implementation employs four types of adaptive nodes, each with a fixed branch width. During use, the most suitable adaptive node is selected based on the data. For example, the largest branch width is used near the root, while a smaller branch width is used near leaf nodes. When inserting data, if the remaining space of an adaptive node is insufficient, the node is expanded and copied, replacing it with another adaptive node of greater capacity. Deletion follows the same principle. In summary, the adaptive adjustment scheme minimizes space consumption while ensuring that adaptive nodes do not frequently change, thus avoiding excessive time consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117692123B_ABST
    Figure CN117692123B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of blockchains, and particularly relates to a data storage method based on an adaptive Merkle tree suitable for high-performance blockchains. The Merkle tree of the application comprises four self-adaptive nodes with different widths in the tree nodes, the most suitable type is selected according to the space usage, and the space waste in the nodes is reduced, so that the space consumption of the Merkle tree is reduced. The novel Merkle tree of the application uses a larger node span, can reduce the height of the Merkle tree, so that the number of disk read-write I / Os can be reduced, and space waste can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of blockchain technology, specifically, it relates to a data storage method based on an adaptive Merkle tree suitable for high-performance blockchains. Background Technology

[0002] With the rise of blockchain technology and the continuous expansion of its application scenarios, the development of blockchain and its potential impact have been closely watched. Due to its technical characteristics and unique properties, it was initially applied in the financial sector and is gradually extending to other industries, such as supply chain, intellectual property protection, and the Internet of Things. How to make blockchain systems operate more efficiently and how to improve their performance have become key aspects of blockchain research.

[0003] To improve the throughput of blockchain systems, it is necessary to address the performance bottlenecks of the consensus mechanism and transaction execution, which are orthogonal to each other. Regarding consensus mechanisms, researchers have been conducting in-depth research in this area in recent years and have achieved some results. For example, the Conflux consensus algorithm can now process more than 3,000 transactions per second. This in-depth research on consensus mechanisms has filled a gap in the performance of blockchain systems. However, another problem remains in public blockchains—low transaction execution performance, referring to the performance of nodes in the blockchain network at the data storage layer in processing transactions and executing smart contracts.

[0004] When establishing a full node on a server and synchronizing blockchain transactions, the transaction execution performance of the Ethereum client Geth is 700 TPS, which is lower than that of many new consensus protocols. In the worst case, Ethereum requires over 10,000 random disk I / O operations to process a block containing 100 transactions, taking hundreds of milliseconds even on data center-grade SSDs. Therefore, after the performance bottleneck of the consensus mechanism is resolved, the low transaction execution performance of the blockchain has become a new bottleneck limiting the overall performance of the blockchain.

[0005] When executing a transaction, an account-based blockchain first needs to read the system's state data to determine if execution is possible, and then modify the data accordingly. Blockchains like Ethereum use Merkle Patricia Trees (MPTs) to store system state data locally on the nodes. The Merkle Patricia Tree (MPT) is an improvement on the Trie, using account addresses as indexes. Account state data is stored in leaf nodes, and account addresses are distributed along the path from the root node to the leaf nodes.

[0006] Each node in MPT can be represented as a key-value pair, where the key is the node's hash value and the value is the node's content. The state tree, composed of state data, is stored in the LevelDB database as key-value pairs. Because account addresses and node hash values ​​can be considered random values, node positions are randomized in storage, and searching can be viewed as performing random reads. Random read operations require more time overhead than sequential read operations. LevelDB on disk has very poor random read performance, consuming a significant amount of time with each data read. Also due to the randomness of its addresses, branch node space near leaf nodes is not fully utilized.

[0007] In conclusion, designing data storage technology for high-performance blockchains to address the problem of low transaction execution performance, combined with updates to the consensus mechanism, can ultimately improve the overall performance of the blockchain system. This will enable blockchain to be applicable to more application scenarios and achieve further development, making it a research of great significance. Summary of the Invention

[0008] To address the slow data reading issue of MPT (Multi-Level Transmission), this invention proposes a novel Merkle tree—the Adaptive Merkle Tree (AMT)—and its operation method. Compared to the nibbles operated on by MPT, AMT uses a larger span, allowing account addresses to be manipulated directly at the byte level. Using a larger span reduces the tree height, mitigating I / O amplification. AMT can also adjust the size of branch nodes based on data conditions to reduce space consumption. The speed difference between memory and disk queries is significant; by optimizing and reducing the tree's size, more node data can be cached in memory, reducing the number of disk accesses. Reducing the tree height decreases the number of intermediate nodes accessed when searching data on disk, further reducing I / O operations and thus improving transaction execution speed.

[0009] The specific technical solution adopted in this invention is as follows.

[0010] This invention provides an adaptive Merkle tree suitable for high-performance blockchains. Tree nodes are categorized into empty nodes, extended nodes, leaf nodes, and adaptive nodes. When an adaptive node branches along the tree path, it uses the current byte in the branch as the key, mapping it to the corresponding child node. The branch node stores pointers to its child nodes, allowing access to the next node. There are four types of adaptive nodes with fixed-width data structures of varying capacities: NodeA, NodeB, NodeC, and NodeD. The appropriate type is selected based on the data requirements.

[0011] The branch width of a NodeA type adaptive node is 4, meaning it can store a maximum of 4 branches and a minimum of 2 branches;

[0012] Use one array of length 4 to record the keys and another array of length 4 to record the pointers. The array keys are ordered, and the keys and pointers are stored in the corresponding positions in the arrays respectively.

[0013] The branch width of a NodeB type adaptive node is 16, and each branch is divided into bytes to store 5-16 branches; internally, the node uses an array of length 16 to record the key and another array of length 16 to record pointers.

[0014] The branch width of the NodeC type adaptive node is 48. It uses an array of length 256 and directly indexes the current byte. At the same time, it uses a second pointer array of length 48, which stores pointers to child nodes.

[0015] The width of the NodeD type adaptive node branch is 256, which is suitable for storing 49-256 child pointers, represented by a pointer array child of length 256.

[0016] In this invention, an empty node indicates that the data is empty and is used when the AMT is first created. The type in the node records the type of the node, and the hash is the hash value of the node.

[0017] The extended node is the same as the empty node. The type and hash record the type of the node and the hash value of the node, respectively. In the extended node, pKey represents a part of the original account address stored in the extended node, and child is the child node. The extended node saves several nodes in the path together, thereby reducing the height of the tree.

[0018] The leaf node records the account address corresponding to that leaf node, the endkey represents the remaining part of the key, the address stores the complete account address, and the value represents the account data stored in the leaf node, including the account nonce and balance;

[0019] In an adaptive node, type and hash record the node's type and hash value, respectively. num represents the number of children of the branch node, maxChild represents the maximum number of branches of the node, minChild represents the minimum number of branches of the node, and node represents the specific type of adaptive node.

[0020] This invention also provides a method for operating the aforementioned adaptive Merkle tree, which includes three parts: an AMT search algorithm, an AMT insertion algorithm, and an AMT deletion algorithm; wherein:

[0021] AMT's search algorithm: It performs a search operation based on the input address, executes different operations based on the different types of nodes, and finally returns a leaf node or an empty node, searching in the tree for the existence of a certain account data;

[0022] AMT's insertion algorithm: Insert a new account address into AMT and return the leaf node formed by the insertion operation;

[0023] AMT's deletion algorithm: Delete the account address and its corresponding leaf node in AMT.

[0024] In this invention, adaptive nodes with the largest branch width are used near the root of the tree, while those with smaller branch widths are used near the leaf nodes. During insertion, if the remaining space of an adaptive node is insufficient, the node is expanded and copied, replaced by another adaptive node with a larger capacity. Deleting a node from an adaptive node involves taking the adaptive node as input and the key byte to be deleted as input, and outputting the completed adaptive node. First, the `Del` function deletes the byte inside the node. Then, by comparing the number of branches in the node with the minimum branch count limit, it is determined whether the node has reached a critical state. If it has, the `Shrink` function shrinks the node, copying the original data within the node. After the shrinking operation is complete, the adaptive node is finally returned.

[0025] Furthermore, this invention provides an algorithm for operating adaptive nodes in the aforementioned adaptive Merkle tree, comprising three parts: an intra-node search algorithm, an intra-node insertion algorithm, and an intra-node deletion algorithm; wherein:

[0026] In the intra-node search algorithm, the pointer corresponding to the input key byte is searched within the adaptive node. The input is the adaptive node and the key byte being searched within it; the output is either the child node corresponding to the key byte or a null pointer. When the adaptive node is NodeA, the node content is traversed using a loop. When the adaptive node is NodeB, a binary search function is called to perform a binary search on an array of length 16. When the adaptive node is NodeC, the index of the current byte is directly obtained from the byte array, and then the corresponding pointer is obtained from the pointer array. When the adaptive node is NodeD, the pointer is directly obtained from the pointer array.

[0027] In the node insertion algorithm, a new branch is inserted into an adaptive node. The input of the algorithm is the adaptive node and the new node to be inserted, and the output is the adaptive node that has completed the operation. First, the current number of branches of the node is compared with the maximum number of branches of the node to determine whether the node has reached the critical state. If it has reached the critical state, the node is expanded by copying the original data in the node. After the expansion operation is completed, the node that was originally to be inserted is added to the new adaptive node, and finally the adaptive node is returned.

[0028] In the node deletion algorithm, a branch is deleted from an adaptive node. The input of the algorithm is the adaptive node and the node to be deleted, and the output is the adaptive node after the operation is completed. After the deletion is completed, it is checked whether the adaptive node needs to be shrunk.

[0029] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0030] The adaptive Merkle tree (AMT) of this invention features a large node span, which reduces the tree's height while providing adaptive adjustment. The implementation employs four types of adaptive nodes, each with a fixed branch width. During use, the most suitable adaptive node is selected based on the data. For example, the largest branch width is used near the root, while a smaller branch width is used near leaf nodes. When inserting data, if the remaining space of an adaptive node is insufficient, the node is expanded and copied, replacing it with another adaptive node of greater capacity. Deletion follows the same principle. In summary, the adaptive adjustment scheme minimizes space consumption while ensuring that adaptive nodes do not frequently change, thus avoiding excessive time consumption. Attached Figure Description

[0031] Figure 1 For the current Merkel Patricia tree.

[0032] Figure 2 The present invention proposes an adaptive Merkle tree (AMT) model, which is an improvement on the MPT model.

[0033] Figure 3 This is the adaptive node NodeA in this invention.

[0034] Figure 4 This refers to the adaptive node NodeB in this invention.

[0035] Figure 5 This refers to the adaptive node NodeC in this invention.

[0036] Figure 6 This refers to the adaptive node NodeD in this invention. Detailed Implementation

[0037] The technical solution of the present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0038] I. Adaptive Merkle Tree (AMT)

[0039] AMT has two main characteristics:

[0040] Larger node spans: The span determines the length of the elements stored in a node and the width of branch nodes. MPT has a span of 4 and a branch node width of 16, while AMT has a span of 8 and a node width of 256, allowing each node to store more elements and perform operations directly on a byte-by-byte basis. A 160-bit binary account address in MPT would require 40 nibbles to convert. AMT, with its larger span, converts the account address to 20 bytes. In extreme cases, the AMT tree can reach a height of 20 levels, only half the height of MPT.

[0041] From a data search perspective, a larger span means a branch can find more data, reducing the tree height, the number of intermediate nodes traversed, and the speed at which the target data is found. AMT (Advanced Methods of Meaning) has a smaller height, allowing it to access the state data in the leaf nodes with fewer intermediate nodes, thus reducing disk I / O operations.

[0042] Adaptive scaling: AMT's use of larger spans also has drawbacks. In MPT, a branch node with a width of 16 has relatively little wasted space if some child pointers are null. However, a branch node with a width of 256 will waste a significant amount of space if not fully utilized. The best space efficiency is achieved by expanding the node space after each data insertion, rather than pre-allocating array space, but adjusting the node size also incurs additional overhead.

[0043] Therefore, AMT has an adaptive adjustment function, and in its implementation, it uses four types of adaptive nodes, each with a fixed branch width. During use, it selects the most suitable adaptive node based on the data conditions. For example, it uses the largest branch width near the root and a smaller branch width near the leaf nodes. When inserting a node into the tree, if the remaining space of the adaptive node is insufficient, the node is expanded and copied, replacing it with another adaptive node with a larger capacity. The deletion operation works similarly. When deleting a node from an adaptive node, the input is the adaptive node and the critical byte to be deleted, and the output is the adaptive node after the operation. First, the `Del` function is used to delete the byte inside the node. Then, by comparing the number of branches in the node with the minimum branch count limit, it is determined whether the node has reached the critical state. If it has reached the critical state, the `Shrink` function is used to shrink the node, and the original data inside the node is copied. After the shrinking operation is completed, the adaptive node is finally returned.

[0044] In summary, the adaptive adjustment scheme aims to minimize space consumption while ensuring that the adaptive nodes do not change frequently, thus consuming more time.

[0045] AMT has four types of nodes:

[0046] 1. Empty node: An empty node indicates that the data is empty. It is used when AMT is first created. The type in the node records the type of the node, and the hash is the hash value of the node.

[0047] 2. Extended Node: Similar to an empty node, `type` and `hash` record the node's type and hash value, respectively. `pKey` represents a portion of the original account address stored in this extended node, and `child` represents the child nodes. Extended nodes can store several nodes in a path together, thereby reducing the height of the tree;

[0048] 3. Leaf node: The leaf node records the account address corresponding to the leaf node. The endkey represents the remaining part of the key, the address stores the complete account address, and the value represents the account data stored in the leaf node, including the account nonce, balance, etc.

[0049] 4. Adaptive Nodes: There are four different types of adaptive nodes. In actual use, the appropriate node type will be selected according to the needs, as shown in the table below:

[0050]

[0051] In the adaptive node, when the tree path branches, the current byte in the branch is used as the key to map to the corresponding child node, thus obtaining the next node, similar to the branch node in MPT. The adaptive node is key to AMT's adaptive adjustment; in its implementation, four fixed-width data structures with different capacities are used. Each data structure is designed to facilitate efficient lookup, insertion, and deletion operations.

[0052] The NodeA type adaptive node is the smallest adaptive node, with a branch width of 4. It can store a maximum of 4 branches and a minimum of 2 branches. It uses one array of length 4 to record keys and another array of length 4 to record pointers. The array keys are ordered, and the keys and pointers are stored in their corresponding positions within the arrays, such as... Figure 3 As shown. The NodeB-type adaptive node has the same branch width as the MPT, 16 bytes, but each branch is divided into byte-level segments, used to store 5-16 branches. Internally, the node uses one 16-byte array to record the key and another 16-byte array to record pointers. For faster data searching, binary search is used, such as... Figure 4 As shown.

[0053] NodeC-type adaptive nodes have a branch width of 48. The NodeC implementation uses a 256-byte array for direct indexing by the current byte. Simultaneously, a second 48-byte pointer array stores pointers to child nodes. For example, if the current byte is 0xff, retrieving the data 47 from position 255 of the first index array will place the pointer at position 47 in the pointer array. This indirect addressing method reduces the time required to find elements. Figure 5 As shown.

[0054] NodeD is the largest adaptive node, with a branch width of 256, suitable for storing 49-256 child pointers. Its internal structure is simple, similar to the branch nodes in MPT, directly represented by a pointer array `child` of length 256. This implementation allows for direct access to the pointer of an array element with a single access, eliminating the need for additional addressing operations. If most entries are not empty, this implementation is efficient and space-saving, as it only needs to store pointers. Figure 6 As shown.

[0055] II. AMT Operation Algorithm

[0056] Before introducing the various operation algorithms of the AMT tree, it is necessary to first introduce the operation algorithms inside the adaptive node. The operation algorithms inside the adaptive node are as follows:

[0057] The search algorithm within the adaptive node (FindChild) takes the adaptive node (node) and the key byte (byte) to search within it as input, and outputs either the child node (child) corresponding to the key byte or a null pointer. When the adaptive node is NodeA, a simple loop iterates through the node's content. When the adaptive node is NodeB, a binary search function is called to perform a binary search on an array of length 16. When the adaptive node is NodeC, the index of the current byte (byte) is directly obtained from the byte array, and then the corresponding pointer is retrieved from the pointer array. When the adaptive node is NodeD, although it is the widest adaptive node, it can be directly retrieved from the pointer array.

[0058] Insertion (InsertInNode): Inserts a new branch into an adaptive node. The algorithm takes the adaptive node `node` and the new node `a` to be inserted as input and outputs the completed adaptive node `node`. First, it compares the current number of branches in the node with the maximum number of branches to determine if the node has reached a critical state. If it has, the node needs to be expanded by copying its original data. After expansion, the node to be inserted is added to the new adaptive node, and finally, the new adaptive node is returned. Deletion is similar; after deletion, it checks whether the adaptive node needs to be shrunk.

[0059] After introducing the internal operation algorithm of the adaptive node, the operation algorithm of AMT is described as follows:

[0060] Search Algorithm: This algorithm searches a tree for the existence of a specific account. The input is the root node of the tree, and the key representing the account address to search for. The output is either the corresponding leaf node or null. This code uses recursion. First, a recursive base is set. The initial node is checked for null; if null, null is returned. If the node is a leaf node, a match is used. If the leaf node's endkey matches one of the remaining keys, the corresponding leaf node is found, and the current leaf node is returned. If no match is found, the target account does not exist in the tree, and null is returned. The pseudocode for the search algorithm is as follows:

[0061]

[0062] Insertion Algorithm: The algorithm takes the root node of the tree as input, the account address key to be inserted, and the state data value. The output is a leaf node. The insertion algorithm is recursive. First, it checks if the initially input node is empty. If it is, a node needs to be inserted there. The replacement process generates a new leaf node using the `MakeLeaf` function, then replaces the original node with the new leaf node and returns the new node. If the node is already a leaf node, after matching it with the account, the insertion algorithm updates the leaf node's content, so the original node is simply replaced.

[0063] If the current node is an adaptive node, the key byte to be searched for in the node needs to be determined first. This can be obtained by taking the first byte of the input parameter `key`. Then, the `FindChild` algorithm is called, with the current node `node` and the key byte `byte` as input parameters. The function's return value is assigned to a new node `n`. It is then checked whether this new node is empty. If the node is empty, it means that the key byte does not exist in this adaptive node. If the key byte does not exist, it means that there is no remaining part in the tree from this point onwards, so a new leaf node needs to be generated. The `endkey` inside the leaf node contains all the remaining keys, and the pointer of the leaf node is inserted into the adaptive node. If `n` is not empty, a recursive operation is performed, calling the `Insert` algorithm with the node, key, and value as input parameters. If this is an extended node, the key of the extended node is first matched. If they match, the recursive call to the insertion algorithm continues. Otherwise, a branch operation is required. The pseudocode of the search algorithm is as follows:

[0064]

[0065] Deletion Algorithm: Delete account data from a tree. The algorithm inputs the root node of the tree (root) and the address key of the account to be deleted (key). The algorithm outputs the deleted leaf node (leaf). The deletion algorithm uses an array of nodes (makeNodes) to store the nodes visited during the account deletion process. First, it checks if the node is empty. If the current node is empty, the deletion operation has been completed or the account data never existed, and the deletion algorithm can end. A for loop is executed, and the loop continues as long as the current node (node) is not empty.

[0066] If the current node is an adaptive node, it needs to be added to the array initially allocated for storage. Then, the corresponding child node in the branch is found. After execution, the node becomes the child node and the next loop is executed.

[0067] If the current node is an extension node, it is necessary to determine whether the extension node is completely in the path. If it is completely in the path, then the node is updated to be a child node of the extension node; otherwise, if the deleted node is not in the tree, the node can be set to empty.

[0068] If the current node is a leaf node, it needs to be assigned to `leaf`, and then the node is deleted. After deletion, a crucial step is to process all nodes traversed along the path of this leaf node. This is done by executing the `ReviseLastNode` function, deleting the nearest extended node above the leaf node, and deleting the corresponding branch of the nearest branch node. Finally, in the next loop, the leaf node is returned by setting `node == nil`. The pseudocode for the deletion algorithm is as follows:

[0069] .

Claims

1. A data storage method based on an adaptive Merkle tree suitable for a high-performance blockchain, characterized in that: The nodes of an adaptive Merkle tree are divided into four types: empty nodes, expanded nodes, leaf nodes, and adaptive nodes; among which: When an adaptive node branches along a path in the tree, it uses the current byte in the branch as an array index to map to the corresponding child node, thus obtaining the next node. There are four types of adaptive nodes, each with a fixed width but different capacities: NodeA, NodeB, NodeC, and NodeD. During data storage, the most suitable type is selected based on space usage. The branch width of a NodeA type adaptive node is 4, meaning it can store a maximum of 4 branches and a minimum of 2 branches; Use one array of length 4 to record the keys and another array of length 4 to record the pointers. The array keys are ordered, and the keys and pointers are stored in the corresponding positions in the arrays respectively. The branch width of a NodeB type adaptive node is 16, and each branch is divided into bytes to store 5-16 branches; internally, the node uses an array of length 16 to record the key and another array of length 16 to record pointers. The branch width of the NodeC type adaptive node is 48. It uses an array of length 256, directly indexes the current byte, and uses a pointer array of length 48. The array stores pointers to child nodes. The width of the NodeD type adaptive node branch is 256, which is suitable for storing 49-256 child pointers, and is represented by child nodes of a pointer array of length 256; In an adaptive node, type and hash record the node's type and hash value, respectively; num represents the number of children of the branch node; maxChild represents the maximum number of branches of the node; minChild represents the minimum number of branches of the node; and node represents the specific type of adaptive node. The operations of adaptive nodes include three parts: intra-node search, intra-node insertion, and intra-node deletion; among which: During the intra-node search, the pointer corresponding to the input key byte is searched within the adaptive node. The input is the adaptive node and the key byte to be searched within the node, and the output is the child node corresponding to the key byte or a null pointer. When the adaptive node is NodeA, the node content is traversed in a loop. When the adaptive node is NodeB, a binary search function is called to perform a binary search on an array of length 16. When the adaptive node is NodeC, the index of the current byte is obtained directly in the byte array, and then the corresponding pointer is obtained in the pointer array. When the adaptive node is NodeD, the pointer is obtained directly in the pointer array. In the node insertion process, a new branch is inserted into an adaptive node. The input is the adaptive node and the new node to be inserted, and the output is the adaptive node after the operation is completed. First, the current number of branches of the node is compared with the maximum number of branches of the node to determine whether the node has reached the critical state. If it has reached the critical state, the node is expanded by copying the original data in the node. After the expansion operation is completed, the node to be inserted is added to the new adaptive node. Finally, the adaptive node is returned. In the deletion process within a node, a branch is deleted from the adaptive node. The input is the adaptive node and the node to be deleted, and the output is the adaptive node after the operation is completed. After the deletion is completed, it is checked whether the adaptive node needs to be shrunk. By comparing the number of branches in a node with the minimum number of branches limit, it is determined whether the node has reached a critical state. If it has reached a critical state, the Shrink function is used to shrink the node, copying the original data within the node. After the shrinking operation is completed, the adaptive node is finally returned.

2. The data storage method according to claim 1, characterized in that: An empty node indicates that the data is empty and is used when the AMT is first created. The type in the node records the type of the node, and the hash is the hash value of the node. The expanded node is identical to the empty node, with type and hash recording the node's type and hash value, respectively; In an extended node, pKey represents a portion of the original account address stored in that extended node, and child represents the child node; The leaf node records the account address corresponding to that leaf node, endkey represents the remaining part of the key, address stores the complete account address, and value represents the account data stored in the leaf node, including the account nonce and balance.

3. The data storage method according to claim 1, characterized in that, It includes three parts: AMT search, AMT insertion, and AMT deletion; among which: AMT's search: It performs a search operation based on the input address, executes different operations based on the different types of nodes, and finally returns a leaf node or an empty node, searching in the tree for the existence of a certain account data; Insertion in AMT: Insert a new account address into AMT and return the leaf node formed by the insertion operation; Deleting an account in an AMT: Delete the account address and its corresponding leaf node in an AMT.

4. The data storage method according to claim 3, characterized in that, Adaptive nodes with the largest branch width are used near the root, while adaptive nodes with smaller branch widths are used near the leaf nodes. When performing an insertion operation, if the remaining space of the adaptive node is insufficient, the node is expanded and copied. The program deletes a node within an adaptive node. The input consists of the adaptive node and the key byte to be deleted (byte). The output is the adaptive node after the operation is completed.

5. The data storage method according to claim 3, characterized in that, In AMT's search, a recursive approach is used. First, a recursive base is set, and it is checked whether the root node of the initially passed tree is empty. If it is empty, null is returned directly. If the node is a leaf node, the Match function is used to check for a match. If the endkey of the leaf node matches the remaining keys, it means that the corresponding leaf node has been found, and the current leaf node is returned. If there is no match, it means that the target account does not exist in the tree, and null is returned.

6. The data storage method according to claim 3, characterized in that, In AMT's insertion process, the input is the root node of the tree, the account address key to be inserted, and the status data value. The output is the leaf node. First, it checks if the initially passed root node is empty. If it is empty, a new leaf node is generated using the MakeLeaf function to replace the original node. If it is an adaptive node, the key byte to be searched in the node is determined first, and then Find Child is called. The parameters passed are the current adaptive node node and the key byte. The function's return value is assigned to a new node n. It checks if the new node is empty. If the node is empty, it means that the byte does not exist in this adaptive node, so a new leaf node is generated. The endkey inside the leaf node contains all the remaining keys. The pointer of the leaf node is inserted into the adaptive node. If n is not empty, the recursive operation is performed.

7. The data storage method according to claim 3, characterized in that, In the deletion process of AMT, the input is the root node of the tree and the address key of the account to be deleted, and the output is the leaf node to be deleted. A node array is created using makeNodes to store the nodes passed during the account deletion process. First, it is checked whether node is empty. If the current node is an adaptive node, it is added to the array initially allocated and saved. Then, the corresponding child node in the branch is found. After execution, node becomes the child node and the next loop is executed.