Hex-prefix (aka compact) encoding used by Ethereum's Merkle Patricia Trie.
Trie leaf and extension nodes encode their nibble path as a compact byte string. The first nibble carries node kind and parity flags:
0x0= extension, even path length0x1= extension, odd path length0x2= leaf, even path length0x3= leaf, odd path length
Paths are represented as nibble lists ([0..15]).
Summary
Functions
Decodes Ethereum hex-prefix bytes into {nibbles, is_leaf}.
Encodes a nibble path using Ethereum hex-prefix rules.