EIP-7916 · Review · Core · 2025-03-24
EIP-7916: SSZ ProgressiveList
Adds ProgressiveList and ProgressiveBitlist to SSZ: lists with no fixed capacity whose Merkle tree grows in stages, so short lists hash cheaply and each element keeps a stable generalized index forever.
What problem does it solve?
Ethereum's consensus layer serializes and hashes data with SSZ. Today every SSZ list is declared as List[type, N] with a maximum capacity N, and its Merkle tree is always sized for N. That causes three problems:
- Wasted hashing: a list sized for 1,024 items holding 3 still pays for a deep tree full of zero padding, and nested lists multiply the cost.
- Arbitrary limits:
Nis often a guess, set large "just in case". - Unstable proofs: if a fork changes
N, the tree depth changes, every element's generalized index (gindex) moves, and light clients or contracts verifying proofs break.
How it works
EIP-7916 defines a new tree shape, merkleize_progressive. Instead of one balanced tree, the root is a chain of subtrees that grow by a factor of 4:
root
├─ subtree of 1 chunk (chunk 0)
└─ ┬─ subtree of 4 chunks (chunks 1..4)
└─ ┬─ subtree of 16 chunks (chunks 5..20)
└─ ┬─ subtree of 64 ...
└─ 0
Only as many levels as needed are built, so a short list is cheap to hash. Because each subtree has a fixed size, chunk i always lands at the same gindex no matter how long the list grows.
Two new SSZ types use this shape:
ProgressiveList[type]: a variable-length list with no declared limit.ProgressiveBitlist: the bit-list equivalent.ProgressiveByteListis an alias forProgressiveList[byte].
Serialization and JSON mapping are identical to List[type, N] and Bitlist[N]; only the hash tree root differs. The root is mix_in_length(merkleize_progressive(...), len(value)). The initial leaf count (1) and growth factor (4) are fixed, not parameters.
Sample code
Reference merkleization in Python, following the spec:
def merkleize_progressive(chunks, num_leaves=1):
if len(chunks) == 0:
return Bytes32() # zero terminator
a = merkleize(chunks[:num_leaves], num_leaves) # balanced subtree
b = merkleize_progressive(chunks[num_leaves:], num_leaves * 4)
return hash(a + b)
def hash_tree_root_progressive_list(values, is_basic):
if is_basic:
chunks = pack(values)
else:
chunks = [hash_tree_root(v) for v in values]
return mix_in_length(merkleize_progressive(chunks), len(values))
Type declaration in a consensus-spec-style container:
class Example(Container):
validators: ProgressiveList[ValidatorIndex] # no N needed
flags: ProgressiveBitlist
data: ProgressiveByteList
Things to know
- Status: Review. It is not yet part of a scheduled fork.
- Without a declared limit, implementations should enforce context-specific bounds. SSZ's
uint32offsets imply roughly a 4 GB ceiling inside other types, and networking limits are far lower. - Proofs for elements deep in a large list are somewhat longer, though they still grow logarithmically.
- Related SSZ work includes EIP-7495 (progressive containers) and the SSZ transaction format EIP-6404.