Ethereum Merkle Patricia Trie (MPT) root computation.
The trie is path-compressed (nibble-by-nibble keys, hex-prefix compact
encoding for leaves and extensions) and content-addressed: each node is
RLP-encoded, and a child reference is either the raw RLP payload (when
byte_size(RLP(node)) < 32) or keccak256(RLP(node)) otherwise.
Implements the recursive patricialize strategy from Ethereum's execution
specs, producing roots compatible with geth/revm for the same inputs.
Summary
Types
Raw trie key bytes and value bytes (nil means deletion in sequential updates).
Nibble values used for trie paths.
Functions
Computes the MPT root hash from {key, value} pairs.
Computes the secure-trie MPT root hash.
Types
Raw trie key bytes and value bytes (nil means deletion in sequential updates).
@type nibble() :: 0..15
Nibble values used for trie paths.
Functions
Computes the MPT root hash from {key, value} pairs.
Keys are inserted as-is (non-secure trie). Entries are applied sequentially;
if a key appears multiple times, later values overwrite earlier ones. A nil
value deletes the key.
Computes the secure-trie MPT root hash.
Secure tries pre-hash each key with Keccak-256 before insertion.