EIP-8364 · Draft · Core · 2026-08-04
EIP-8364: SSZ Compact Multiproofs
A compact Merkle multiproof format for SSZ that describes a proof's shape as a bitlist of about two bits per node, so clients can request arbitrary proofs cheaply and servers can produce them in one tree walk.
What problem does it solve?
Light clients and proof-serving APIs often want a multiproof: several leaves of an SSZ Merkle tree proven together against one root, sharing helper nodes. The existing SSZ format identifies nodes by a list of generalized indices, which has two drawbacks when proofs are requested on the fly:
- Bandwidth: every index costs two to eight bytes.
- Server work: given requested indices, the server must compute the helper indices and plan how to walk its tree before it can answer.
EIP-8364 replaces the index list with a proof descriptor, a bitlist that encodes the shape of the proof directly. It works both as the request a client sends and as the framing of the response.
How it works
Walk the tree depth-first, left to right, from the root:
- If the current node is one of the proof nodes (requested or helper, treated the same), emit
1and stop descending. - Otherwise emit
0and visit its left child, then its right child.
A proof with N nodes yields exactly N ones and N - 1 zeros, 2N - 1 bits in total. The list is self-delimiting: it ends at the first point where ones outnumber zeros. Bits are packed most-significant-bit first, with up to seven zero padding bits.
The proof itself is the descriptor followed by the N nodes in traversal order (equivalently, sorted by the binary form of their generalized index). A verifier replays the walk: each 1 consumes a node, each 0 hashes its two children with SHA-256, and the result must equal the known root.
Validity rules make the encoding canonical: at least one 1, no more than seven bits after the final 1, and the ones-exceed-zeros point must be exactly the final 1. Implementations must reject anything else.
Sample code
Building and checking a descriptor, using the spec's worked example (requesting generalized index 42):
def compute_proof_descriptor(proof_indices): # already includes helpers
bits = ""
for idx in sorted(proof_indices, key=bin): # traversal order
b = bin(idx)
bits += "0" * (len(b) - len(b.rstrip("0"))) + "1"
bits += "0" * (-len(bits) % 8)
return int(bits, 2).to_bytes(len(bits) // 8, "big")
# proof nodes for index 42: 4, 20, 42, 43, 11, 3
assert compute_proof_descriptor([4, 20, 42, 43, 11, 3]) == bytes.fromhex("25e0")
assert compute_proof_descriptor([2, 3]) == bytes.fromhex("60") # bits 011
| Descriptor | Valid? | Reason |
|---|---|---|
0x80 |
yes | single node (the root) |
0x00 |
no | no 1 bit |
0xff |
no | ends at bit 0 but more 1s follow |
0x25e000 |
no | more than seven padding bits |
Things to know
- Status: Draft.
- It adds a new format only; existing generalized-index multiproofs and all SSZ data structures are unchanged.
- A descriptor describes positions, not tree structure. A verifier should derive the descriptor itself from the indices it means to check (or compare a supplied one against that), otherwise a peer could prove the wrong positions. For variable-size types such as SSZ lists, also verify the shape (for example the length mix-in) first.
- Validate the descriptor and node count before hashing, cap descriptor length, and prefer an iterative walk: a chain-shaped descriptor can force recursion depth
N. - The format works for any binary Merkle tree, including the progressive shapes of EIP-7916.