Crate mpt_trie

Source
Expand description

Utilities and types for working with Ethereum partial tries.

While there are other Ethereum trie libraries (such as eth_trie), these libraries are not a good fit if:

  • You only need a portion of an existing larger trie.
  • You need this partial trie to produce the same hash as the full trie.

The core of this library is the PartialTrie type, which represents a trie that is a subset of an existing larger one. Nodes that are not to be included in the PartialTrie are replaced with Hash nodes, which contains the merkle hash of the node it replaces.

Modules§

builder
A builder for constructing a partial trie from a collection of proofs.
debug_tools
Additional methods that may be useful when diagnosing tries from this library.
nibbles
Define Nibbles and how to convert bytes, hex prefix encodings and strings into nibbles.
partial_trie
Definitions for the core types PartialTrie and Nibbles.
special_query
Specialized queries that users of the library may need that require knowledge of the private internal trie state.
trie_ops
Defines various operations for PartialTrie.
trie_subsets
Logic for calculating a subset of a PartialTrie from an existing PartialTrie.
utils
Various types and logic that don’t fit well into any other module.