{"eip":7916,"title":"SSZ ProgressiveList","description":"SSZ types for efficiently hashing short lists","authors":["Zsolt Felföldi (@zsfelfoldi)","Cayman (@wemeetagain)","Etan Kissling (@etan-status)"],"status":"Review","type":"Standards Track","category":"Core","created":"2025-03-24","discussionsTo":"https://ethereum-magicians.org/t/eip-7916-ssz-progressivebytelist/23254","repo":"EIPs","label":"EIP-7916","officialUrl":"https://eips.ethereum.org/EIPS/eip-7916","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7916.md","url":"https://eips.huatuo.xyz/eip-7916/","tldr":{"en":"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.","ja":"SSZ に ProgressiveList と ProgressiveBitlist を追加する。固定の容量を持たず、Merkle ツリーが段階的に成長するリストで、短いリストは安くハッシュでき、各要素は永続的に安定した一般化インデックスを保つ。","ko":"SSZ에 ProgressiveList와 ProgressiveBitlist를 추가한다. 고정된 용량이 없고 Merkle 트리가 단계적으로 커지는 리스트로, 짧은 리스트는 해시 비용이 낮고 각 요소는 영구적으로 안정적인 일반화 인덱스를 유지한다.","zh":"为 SSZ 增加 ProgressiveList 和 ProgressiveBitlist：没有固定容量的列表，其 Merkle 树分阶段增长，因此短列表的哈希成本很低，并且每个元素的广义索引永远保持稳定。"},"tags":["ssz","consensus","merkle","serialization","core"],"explainers":{"en":{"lang":"en","tldr":"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.","tags":["ssz","consensus","merkle","serialization","core"],"related":[7495,6404],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7916/","markdown":"## What problem does it solve?\n\nEthereum'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:\n\n- **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.\n- **Arbitrary limits**: `N` is often a guess, set large \"just in case\".\n- **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.\n\n## How it works\n\nEIP-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:\n\n```\nroot\n ├─ subtree of 1 chunk      (chunk 0)\n └─ ┬─ subtree of 4 chunks  (chunks 1..4)\n    └─ ┬─ subtree of 16 chunks (chunks 5..20)\n       └─ ┬─ subtree of 64 ...\n          └─ 0\n```\n\nOnly 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.\n\nTwo new SSZ types use this shape:\n\n- `ProgressiveList[type]`: a variable-length list with **no declared limit**.\n- `ProgressiveBitlist`: the bit-list equivalent.\n- `ProgressiveByteList` is an alias for `ProgressiveList[byte]`.\n\nSerialization 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.\n\n## Sample code\n\nReference merkleization in Python, following the spec:\n\n```python\ndef merkleize_progressive(chunks, num_leaves=1):\n    if len(chunks) == 0:\n        return Bytes32()                       # zero terminator\n    a = merkleize(chunks[:num_leaves], num_leaves)          # balanced subtree\n    b = merkleize_progressive(chunks[num_leaves:], num_leaves * 4)\n    return hash(a + b)\n\ndef hash_tree_root_progressive_list(values, is_basic):\n    if is_basic:\n        chunks = pack(values)\n    else:\n        chunks = [hash_tree_root(v) for v in values]\n    return mix_in_length(merkleize_progressive(chunks), len(values))\n```\n\nType declaration in a consensus-spec-style container:\n\n```python\nclass Example(Container):\n    validators: ProgressiveList[ValidatorIndex]   # no N needed\n    flags: ProgressiveBitlist\n    data: ProgressiveByteList\n```\n\n## Things to know\n\n- **Status: Review.** It is not yet part of a scheduled fork.\n- Without a declared limit, implementations should enforce context-specific bounds. SSZ's `uint32` offsets imply roughly a 4 GB ceiling inside other types, and networking limits are far lower.\n- Proofs for elements deep in a large list are somewhat longer, though they still grow logarithmically.\n- Related SSZ work includes [EIP-7495](/eip-7495/) (progressive containers) and the SSZ transaction format [EIP-6404](/eip-6404/).\n"},"ja":{"lang":"ja","tldr":"SSZ に ProgressiveList と ProgressiveBitlist を追加する。固定の容量を持たず、Merkle ツリーが段階的に成長するリストで、短いリストは安くハッシュでき、各要素は永続的に安定した一般化インデックスを保つ。","tags":["ssz","consensus","merkle","serialization","core"],"related":[7495,6404],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7916/","markdown":"## 何を解決するのか\n\nEthereum のコンセンサスレイヤーは、SSZ でデータをシリアライズしてハッシュ化します。現在、すべての SSZ リストは最大容量 `N` を持つ `List[type, N]` として宣言され、その Merkle ツリーは常に `N` に合わせた大きさになります。これは 3 つの問題を引き起こします。\n\n- **無駄なハッシュ計算**: 1,024 個分で宣言されたリストに 3 個しか入っていなくても、ゼロパディングだらけの深いツリーのコストを払うことになり、リストがネストするとそのコストが掛け算になります。\n- **恣意的な上限**: `N` は多くの場合推測で、「念のため」大きく設定されます。\n- **不安定な証明**: フォークで `N` が変わるとツリーの深さが変わり、すべての要素の一般化インデックス（gindex）が動き、証明を検証するライトクライアントやコントラクトが壊れます。\n\n## 仕組み\n\nEIP-7916 は、`merkleize_progressive` という新しいツリー形状を定義します。1 つの平衡ツリーの代わりに、ルートは 4 倍ずつ大きくなるサブツリーの連鎖になります。\n\n```\nroot\n ├─ subtree of 1 chunk      (chunk 0)\n └─ ┬─ subtree of 4 chunks  (chunks 1..4)\n    └─ ┬─ subtree of 16 chunks (chunks 5..20)\n       └─ ┬─ subtree of 64 ...\n          └─ 0\n```\n\n必要な数だけの階層しか構築されないので、短いリストは安くハッシュできます。各サブツリーのサイズは固定なので、リストがどれだけ長くなっても、チャンク `i` は常に同じ gindex に配置されます。\n\nこの形状を使う、新しい SSZ 型が 2 つあります。\n\n- `ProgressiveList[type]`: **上限を宣言しない**可変長リスト。\n- `ProgressiveBitlist`: ビットリスト版。\n- `ProgressiveByteList` は `ProgressiveList[byte]` のエイリアスです。\n\nシリアライズと JSON のマッピングは `List[type, N]` や `Bitlist[N]` と同一で、異なるのはハッシュツリーのルートだけです。ルートは `mix_in_length(merkleize_progressive(...), len(value))` です。最初のリーフ数（1）と成長係数（4）は固定で、パラメータではありません。\n\n## サンプルコード\n\n仕様に沿った、Python による参照 merkleization:\n\n```python\ndef merkleize_progressive(chunks, num_leaves=1):\n    if len(chunks) == 0:\n        return Bytes32()                       # zero terminator\n    a = merkleize(chunks[:num_leaves], num_leaves)          # balanced subtree\n    b = merkleize_progressive(chunks[num_leaves:], num_leaves * 4)\n    return hash(a + b)\n\ndef hash_tree_root_progressive_list(values, is_basic):\n    if is_basic:\n        chunks = pack(values)\n    else:\n        chunks = [hash_tree_root(v) for v in values]\n    return mix_in_length(merkleize_progressive(chunks), len(values))\n```\n\nコンセンサス仕様スタイルのコンテナでの型宣言:\n\n```python\nclass Example(Container):\n    validators: ProgressiveList[ValidatorIndex]   # no N needed\n    flags: ProgressiveBitlist\n    data: ProgressiveByteList\n```\n\n## 知っておくべきこと\n\n- **ステータス: Review。** まだ予定されたフォークには含まれていません。\n- 上限が宣言されないため、実装はコンテキストごとの上限を強制すべきです。SSZ の `uint32` オフセットは、他の型の内部ではおよそ 4 GB の上限を意味し、ネットワーク上の制限はそれよりはるかに低くなります。\n- 大きなリストの深い位置にある要素の証明はやや長くなりますが、それでも対数的にしか増えません。\n- SSZ に関する関連作業には、[EIP-7495](/eip-7495/)（progressive container）と、SSZ トランザクション形式の [EIP-6404](/eip-6404/) があります。\n"},"ko":{"lang":"ko","tldr":"SSZ에 ProgressiveList와 ProgressiveBitlist를 추가한다. 고정된 용량이 없고 Merkle 트리가 단계적으로 커지는 리스트로, 짧은 리스트는 해시 비용이 낮고 각 요소는 영구적으로 안정적인 일반화 인덱스를 유지한다.","tags":["ssz","consensus","merkle","serialization","core"],"related":[7495,6404],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7916/","markdown":"## 어떤 문제를 해결하나요?\n\n이더리움 합의 레이어는 SSZ로 데이터를 직렬화하고 해시합니다. 현재 모든 SSZ 리스트는 최대 용량 `N`이 있는 `List[type, N]`으로 선언되며, 그 Merkle 트리는 항상 `N`에 맞춰 크기가 정해집니다. 이로 인해 세 가지 문제가 생깁니다.\n\n- **낭비되는 해시 계산**: 1,024개용으로 선언된 리스트에 3개만 들어 있어도 제로 패딩으로 가득 찬 깊은 트리의 비용을 치러야 하며, 리스트가 중첩되면 비용이 곱절로 늘어납니다.\n- **임의적인 한도**: `N`은 흔히 추측으로 정해지고 \"혹시 몰라\" 크게 설정됩니다.\n- **불안정한 증명**: 포크에서 `N`이 바뀌면 트리 깊이가 달라지고, 모든 요소의 일반화 인덱스(gindex)가 이동하며, 증명을 검증하는 라이트 클라이언트나 컨트랙트가 깨집니다.\n\n## 어떻게 동작하나요?\n\nEIP-7916은 `merkleize_progressive`라는 새로운 트리 모양을 정의합니다. 균형 트리 하나 대신, 루트가 4배씩 커지는 하위 트리의 사슬이 됩니다.\n\n```\nroot\n ├─ subtree of 1 chunk      (chunk 0)\n └─ ┬─ subtree of 4 chunks  (chunks 1..4)\n    └─ ┬─ subtree of 16 chunks (chunks 5..20)\n       └─ ┬─ subtree of 64 ...\n          └─ 0\n```\n\n필요한 만큼의 층만 만들어지므로 짧은 리스트는 해시 비용이 낮습니다. 각 하위 트리의 크기가 고정되어 있으므로, 리스트가 아무리 길어져도 청크 `i`는 항상 같은 gindex에 놓입니다.\n\n이 모양을 사용하는 새 SSZ 타입이 두 개 있습니다.\n\n- `ProgressiveList[type]`: **한도를 선언하지 않는** 가변 길이 리스트.\n- `ProgressiveBitlist`: 비트 리스트에 해당하는 타입.\n- `ProgressiveByteList`는 `ProgressiveList[byte]`의 별칭입니다.\n\n직렬화와 JSON 매핑은 `List[type, N]`, `Bitlist[N]`과 같고, 해시 트리 루트만 다릅니다. 루트는 `mix_in_length(merkleize_progressive(...), len(value))`입니다. 초기 리프 개수(1)와 성장 계수(4)는 파라미터가 아니라 고정값입니다.\n\n## 샘플 코드\n\n명세를 따른 Python 참조 merkleization:\n\n```python\ndef merkleize_progressive(chunks, num_leaves=1):\n    if len(chunks) == 0:\n        return Bytes32()                       # zero terminator\n    a = merkleize(chunks[:num_leaves], num_leaves)          # balanced subtree\n    b = merkleize_progressive(chunks[num_leaves:], num_leaves * 4)\n    return hash(a + b)\n\ndef hash_tree_root_progressive_list(values, is_basic):\n    if is_basic:\n        chunks = pack(values)\n    else:\n        chunks = [hash_tree_root(v) for v in values]\n    return mix_in_length(merkleize_progressive(chunks), len(values))\n```\n\n합의 명세 스타일 컨테이너에서의 타입 선언:\n\n```python\nclass Example(Container):\n    validators: ProgressiveList[ValidatorIndex]   # no N needed\n    flags: ProgressiveBitlist\n    data: ProgressiveByteList\n```\n\n## 알아둘 점\n\n- **상태: Review.** 아직 예정된 포크에 포함되어 있지 않습니다.\n- 선언된 한도가 없으므로 구현체는 상황별 한도를 강제해야 합니다. SSZ의 `uint32` 오프셋은 다른 타입 내부에서 대략 4GB의 상한을 의미하며, 네트워크 제한은 이보다 훨씬 낮습니다.\n- 큰 리스트 깊숙한 곳에 있는 요소의 증명은 다소 길어지지만, 여전히 로그 규모로만 늘어납니다.\n- SSZ 관련 작업으로는 [EIP-7495](/eip-7495/)(progressive container)와 SSZ 트랜잭션 형식인 [EIP-6404](/eip-6404/)가 있습니다.\n"},"zh":{"lang":"zh","tldr":"为 SSZ 增加 ProgressiveList 和 ProgressiveBitlist：没有固定容量的列表，其 Merkle 树分阶段增长，因此短列表的哈希成本很低，并且每个元素的广义索引永远保持稳定。","tags":["ssz","consensus","merkle","serialization","core"],"related":[7495,6404],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7916/","markdown":"## 它解决什么问题？\n\n以太坊共识层使用 SSZ 对数据进行序列化和哈希。目前每个 SSZ 列表都声明为带有最大容量 `N` 的 `List[type, N]`，其 Merkle 树始终按 `N` 来确定大小。这会带来三个问题：\n\n- **浪费哈希计算**：按 1,024 项声明的列表即使只存了 3 项，也要为充满零填充的深层树付出代价，而嵌套列表会让这一成本成倍增加。\n- **随意的上限**：`N` 往往只是一个猜测值，\"以防万一\"地设得很大。\n- **不稳定的证明**：如果某次分叉改变了 `N`，树的深度就会变化，每个元素的广义索引（gindex）都会移动，验证证明的轻客户端或合约就会失效。\n\n## 它如何运作\n\nEIP-7916 定义了一种新的树形，即 `merkleize_progressive`。根节点不再是一棵平衡树，而是由一串每次扩大 4 倍的子树组成的链：\n\n```\nroot\n ├─ subtree of 1 chunk      (chunk 0)\n └─ ┬─ subtree of 4 chunks  (chunks 1..4)\n    └─ ┬─ subtree of 16 chunks (chunks 5..20)\n       └─ ┬─ subtree of 64 ...\n          └─ 0\n```\n\n只会构建所需数量的层级，因此短列表的哈希成本很低。由于每个子树的大小是固定的，无论列表增长到多长，第 `i` 个数据块始终位于相同的 gindex。\n\n有两种新的 SSZ 类型使用这种树形：\n\n- `ProgressiveList[type]`：**不声明上限**的变长列表。\n- `ProgressiveBitlist`：对应的比特列表。\n- `ProgressiveByteList` 是 `ProgressiveList[byte]` 的别名。\n\n序列化和 JSON 映射与 `List[type, N]` 和 `Bitlist[N]` 完全一致；只有哈希树根不同。根为 `mix_in_length(merkleize_progressive(...), len(value))`。初始叶子数（1）和增长系数（4）是固定的，不是参数。\n\n## 示例代码\n\n按照规范编写的 Python 参考 merkleization：\n\n```python\ndef merkleize_progressive(chunks, num_leaves=1):\n    if len(chunks) == 0:\n        return Bytes32()                       # zero terminator\n    a = merkleize(chunks[:num_leaves], num_leaves)          # balanced subtree\n    b = merkleize_progressive(chunks[num_leaves:], num_leaves * 4)\n    return hash(a + b)\n\ndef hash_tree_root_progressive_list(values, is_basic):\n    if is_basic:\n        chunks = pack(values)\n    else:\n        chunks = [hash_tree_root(v) for v in values]\n    return mix_in_length(merkleize_progressive(chunks), len(values))\n```\n\n在共识规范风格的容器中声明类型：\n\n```python\nclass Example(Container):\n    validators: ProgressiveList[ValidatorIndex]   # no N needed\n    flags: ProgressiveBitlist\n    data: ProgressiveByteList\n```\n\n## 需要注意\n\n- **状态：Review。** 它尚未纳入任何已排期的分叉。\n- 由于没有声明上限，实现应当强制执行与具体场景相关的边界。SSZ 的 `uint32` 偏移量意味着在其他类型内部大约有 4 GB 的上限，而网络层面的限制要低得多。\n- 大列表深处元素的证明会稍长一些，不过仍然只是对数级增长。\n- SSZ 相关的工作还包括 [EIP-7495](/eip-7495/)（progressive container）和 SSZ 交易格式 [EIP-6404](/eip-6404/)。\n"}},"requiredBy":[6404,6465,6466,7495,7688,7745,7799,7807,7919,8016,8321]}
