Construct a new Merkle Patricia Tree.
The root node of the tree.
A Buffer representing the root hash of the tree. Always 256-bits (32 bytes).
The root hash of the tree, as a bigint. Reading this property is more efficient than obtaining a buffer.
Execute a batch of put and delete operations. The execution is batched, so calling this function with multiple updates provides more opportunities for optimization and can be faster than call put() and del() multiple times.
An array of put operations on the tree, of type BatchPut.
An optional array of keys to delete from the tree.
The root that results from this set of operations.
Execute a batch of put and delete operations. The execution of batch operations are performed in a copy on write (cow) fashion.
An array of put operations on the tree, of type BatchPut.
An optional array of keys to delete from the tree.
A new MerklePatriciaTree updated in a cow manner.
Reads multiple keys and returns a concise reply of witnesses
: bulk keys to be read
: Array of witnesses
CopyTreePaths Copies paths that are marked for copy
Given a key, delete any mapping that exists for that key.
The key to unmap.
Copies only the node; leaving its successors the same
: Node for copy
Insert a node with the given value after a search.
The stack as a result of the search
The remainder as a result of the search
The value to insert.
multiSearch searches the tree for all keys and marks nodes for copy
: List of key, value pairs
: List of keys
: True if we want to mark the nodes for copy
Counts the number of nodes in the tree
Insert a new mapping into the tree. If the key is already mapped in the tree, it is updated with the new value.
The key to insert.
A Buffer representing the value.
Serialize a witness into RLP format.
A witness returned from a get() operation on a Merkle Patricia Tree
An RLP serialized witness, with non-essential nodes removed.
Search for the given key, returning a SearchResult which contains the path traversed to search for the key.
The key to search for.
A SearchResult containing the path to the key, and the value if it was present.
Returns the sum of lengths of rlpEncodings of all the nodes in the tree
Generated using TypeDoc
A Merkle Patricia Tree, as defined in the Ethereum Yellow Paper.