{"eip":7495,"title":"SSZ ProgressiveContainer","description":"SSZ type for forward-compatible containers","authors":["Etan Kissling (@etan-status)","Cayman (@wemeetagain)"],"status":"Review","type":"Standards Track","category":"Core","created":"2023-08-18","requires":[7916],"discussionsTo":"https://ethereum-magicians.org/t/eip-7495-ssz-progressivecontainer/15476","repo":"EIPs","label":"EIP-7495","officialUrl":"https://eips.ethereum.org/EIPS/eip-7495","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7495.md","url":"https://eips.huatuo.xyz/eip-7495/","tldr":{"en":"A new SSZ container type whose fields keep the same Merkle position across forks, so light clients and on-chain proof verifiers do not break when consensus structures gain or lose fields.","ja":"フォークをまたいでもフィールドが同じ Merkle 上の位置を保つ新しい SSZ コンテナ型。コンセンサスの構造体にフィールドが増減しても、ライトクライアントやオンチェーンの証明検証者が壊れないようにする。","ko":"포크를 거쳐도 필드가 같은 Merkle 위치를 유지하는 새로운 SSZ 컨테이너 타입. 컨센서스 구조체에 필드가 추가되거나 제거되어도 라이트 클라이언트와 온체인 증명 검증기가 깨지지 않게 한다.","zh":"一种新的 SSZ 容器类型，其字段在跨分叉时保持相同的 Merkle 位置，这样当共识结构增减字段时，轻客户端和链上证明验证器不会失效。"},"tags":["ssz","consensus","merkle","light-client"],"explainers":{"en":{"lang":"en","tldr":"A new SSZ container type whose fields keep the same Merkle position across forks, so light clients and on-chain proof verifiers do not break when consensus structures gain or lose fields.","tags":["ssz","consensus","merkle","light-client"],"related":[7916,4788],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7495/","markdown":"## What problem does it solve?\n\nEthereum's consensus layer encodes data structures such as `BeaconState` and blocks in SSZ (Simple Serialize), and commits to them with a Merkle root. Anyone can then prove a single field, for example a validator balance, with a Merkle proof that walks to a specific *generalized index* (gindex) in the tree.\n\nThe problem is that the tree's shape depends on how many fields a container has. When a fork adds fields and the count crosses a power of two, or a field is removed or changes type, every gindex can shift. Verifiers that hard-code gindices, such as smart contracts reading beacon roots via [EIP-4788](/eip-4788/), bridges or hardware wallets, then break and need upgrades, even if the field they care about did not change.\n\n`ProgressiveContainer` gives each field a permanent slot so proofs keep working across versions.\n\n## How it works\n\n- A container is declared with an `active_fields` bit list. Each `1` marks a slot occupied by the next declared field; each `0` is a gap (a field that does not exist in this version, e.g. one that was removed).\n- Merkleization uses the progressive Merkle tree from [EIP-7916](/eip-7916/), which grows gradually with the number of slots instead of jumping to the next power of two. Existing slots never move as new ones are appended.\n- Absent slots are filled with a zero hash. The root is then mixed with `active_fields`: `hash(root, pack_bits(active_fields))`, so a removed field cannot be confused with a field whose value is zero.\n- **Serialization and JSON are unchanged** from a regular `Container`: absent fields take no space on the wire.\n- Rules: at least one field, at most 256 `active_fields` entries, the list must not end in `0`, and the number of `1`s must equal the number of fields.\n\n## Sample code\n\nTwo shapes sharing a stable position for `color` (from the spec, Python/remerkleable notation):\n\n```python\nclass Square(ProgressiveContainer(active_fields=[1, 0, 1])):\n    side: uint16   # slot 0\n    color: uint8   # slot 2\n\nclass Circle(ProgressiveContainer(active_fields=[0, 1, 1])):\n    radius: uint16 # slot 1\n    color: uint8   # slot 2  -\u003e same gindex as Square.color\n\n# Merkleization (pseudocode)\ndef hash_tree_root(value):\n    roots = []\n    it = iter(fields_of(value))\n    for bit in value.active_fields:\n        roots.append(hash_tree_root(next(it)) if bit else Bytes32())\n    return hash(merkleize_progressive(roots), pack_bits(value.active_fields))\n```\n\nA verifier that proves `color` uses the same gindex for both types, and keeps working if a later version appends more fields.\n\n## Things to know\n\n- Status is **Review**. It is a consensus-layer data-structure change; which containers adopt it, and in which fork, is decided separately.\n- It depends on [EIP-7916](/eip-7916/) (progressive Merkle trees / `ProgressiveList`).\n- The 256-field cap counts deprecated slots too. The spec suggests nesting a further `ProgressiveContainer` in a field if that limit is ever reached.\n- `Optional` fields are explicitly out of scope and left to a future proposal.\n- Reference implementation and tests live in `ethereum/remerkleable` and the consensus-specs SSZ generic tests.\n"},"ja":{"lang":"ja","tldr":"フォークをまたいでもフィールドが同じ Merkle 上の位置を保つ新しい SSZ コンテナ型。コンセンサスの構造体にフィールドが増減しても、ライトクライアントやオンチェーンの証明検証者が壊れないようにする。","tags":["ssz","consensus","merkle","light-client"],"related":[7916,4788],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7495/","markdown":"## 何を解決するのか\n\nEthereum のコンセンサスレイヤーは、`BeaconState` やブロックなどのデータ構造を SSZ（Simple Serialize）でエンコードし、Merkle ルートでコミットします。これにより、誰でもたとえばバリデーター残高のような 1 つのフィールドを、ツリー内の特定の*一般化インデックス*（gindex）まで辿る Merkle 証明で証明できます。\n\n問題は、ツリーの形がコンテナのフィールド数に依存することです。フォークでフィールドが追加されて数が 2 の冪を超えたり、フィールドが削除されたり型が変わったりすると、すべての gindex がずれる可能性があります。すると、gindex をハードコードしている検証者、たとえば [EIP-4788](/eip-4788/) 経由でビーコンルートを読むスマートコントラクト、ブリッジ、ハードウェアウォレットは、関心のあるフィールドが変わっていなくても壊れ、アップグレードが必要になります。\n\n`ProgressiveContainer` は各フィールドに恒久的なスロットを与え、証明がバージョンをまたいで動作し続けるようにします。\n\n## 仕組み\n\n- コンテナは `active_fields` のビットリストで宣言します。`1` は次に宣言されたフィールドが占めるスロットを、`0` は空き（このバージョンには存在しないフィールド、たとえば削除されたもの）を表します。\n- Merkle 化には [EIP-7916](/eip-7916/) の progressive Merkle tree を使います。これは次の 2 の冪に跳ぶのではなく、スロット数に応じて少しずつ成長します。新しいスロットが追加されても、既存のスロットは移動しません。\n- 存在しないスロットはゼロハッシュで埋められます。そのうえでルートは `active_fields` と混ぜられます: `hash(root, pack_bits(active_fields))`。これにより、削除されたフィールドと、値がゼロのフィールドが混同されることはありません。\n- **シリアライズと JSON は通常の `Container` と変わりません。** 存在しないフィールドは通信上で領域を取りません。\n- ルール: フィールドは 1 つ以上、`active_fields` のエントリは最大 256 個、リストの末尾を `0` にしてはならず、`1` の数はフィールド数と等しくなければなりません。\n\n## サンプルコード\n\n`color` の位置が安定している 2 つの形状（仕様より、Python/remerkleable 表記）:\n\n```python\nclass Square(ProgressiveContainer(active_fields=[1, 0, 1])):\n    side: uint16   # slot 0\n    color: uint8   # slot 2\n\nclass Circle(ProgressiveContainer(active_fields=[0, 1, 1])):\n    radius: uint16 # slot 1\n    color: uint8   # slot 2  -\u003e same gindex as Square.color\n\n# Merkleization (pseudocode)\ndef hash_tree_root(value):\n    roots = []\n    it = iter(fields_of(value))\n    for bit in value.active_fields:\n        roots.append(hash_tree_root(next(it)) if bit else Bytes32())\n    return hash(merkleize_progressive(roots), pack_bits(value.active_fields))\n```\n\n`color` を証明する検証者は両方の型で同じ gindex を使い、後のバージョンでフィールドが追加されても動作し続けます。\n\n## 知っておくべきこと\n\n- ステータスは **Review** です。これはコンセンサスレイヤーのデータ構造の変更であり、どのコンテナがどのフォークで採用するかは別途決められます。\n- [EIP-7916](/eip-7916/)（progressive Merkle tree / `ProgressiveList`）に依存しています。\n- 256 フィールドの上限には、非推奨になったスロットも含まれます。この上限に達した場合は、フィールドの中にさらに `ProgressiveContainer` を入れ子にすることを仕様は提案しています。\n- `Optional` フィールドは明示的に対象外で、将来の提案に委ねられています。\n- リファレンス実装とテストは `ethereum/remerkleable` と consensus-specs の SSZ generic テストにあります。\n"},"ko":{"lang":"ko","tldr":"포크를 거쳐도 필드가 같은 Merkle 위치를 유지하는 새로운 SSZ 컨테이너 타입. 컨센서스 구조체에 필드가 추가되거나 제거되어도 라이트 클라이언트와 온체인 증명 검증기가 깨지지 않게 한다.","tags":["ssz","consensus","merkle","light-client"],"related":[7916,4788],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7495/","markdown":"## 어떤 문제를 해결하나요?\n\n이더리움 컨센서스 레이어는 `BeaconState`나 블록 같은 데이터 구조를 SSZ(Simple Serialize)로 인코딩하고 Merkle 루트로 커밋합니다. 그러면 누구든 예를 들어 검증자 잔액 같은 필드 하나를, 트리의 특정 *일반화 인덱스*(gindex)까지 이어지는 Merkle 증명으로 증명할 수 있습니다.\n\n문제는 트리의 모양이 컨테이너의 필드 수에 따라 달라진다는 점입니다. 포크에서 필드가 추가되어 개수가 2의 거듭제곱을 넘거나, 필드가 제거되거나 타입이 바뀌면 모든 gindex가 밀릴 수 있습니다. 그러면 gindex를 하드코딩한 검증기, 예를 들어 [EIP-4788](/eip-4788/)을 통해 비콘 루트를 읽는 스마트 컨트랙트, 브리지, 하드웨어 지갑은 관심 있는 필드가 바뀌지 않았더라도 깨져서 업그레이드가 필요해집니다.\n\n`ProgressiveContainer`는 각 필드에 영구적인 슬롯을 부여해 증명이 버전이 바뀌어도 계속 동작하게 합니다.\n\n## 어떻게 동작하나요?\n\n- 컨테이너는 `active_fields` 비트 리스트로 선언합니다. `1`은 다음에 선언된 필드가 차지하는 슬롯을, `0`은 빈 자리(이 버전에는 없는 필드, 예컨대 제거된 필드)를 나타냅니다.\n- Merkle화는 [EIP-7916](/eip-7916/)의 점진적 Merkle 트리를 사용하며, 다음 2의 거듭제곱으로 뛰는 대신 슬롯 수에 맞춰 조금씩 자랍니다. 새 슬롯이 추가되어도 기존 슬롯은 움직이지 않습니다.\n- 존재하지 않는 슬롯은 영 해시로 채웁니다. 이후 루트는 `active_fields`와 섞입니다: `hash(root, pack_bits(active_fields))`. 그래서 제거된 필드를 값이 0인 필드와 혼동할 수 없습니다.\n- **직렬화와 JSON은 일반 `Container`와 같습니다.** 존재하지 않는 필드는 전송 시 공간을 차지하지 않습니다.\n- 규칙: 필드는 최소 하나, `active_fields` 항목은 최대 256개, 리스트는 `0`으로 끝나면 안 되며, `1`의 개수는 필드 수와 같아야 합니다.\n\n## 샘플 코드\n\n`color`의 안정된 위치를 공유하는 두 모양(명세에서, Python/remerkleable 표기):\n\n```python\nclass Square(ProgressiveContainer(active_fields=[1, 0, 1])):\n    side: uint16   # slot 0\n    color: uint8   # slot 2\n\nclass Circle(ProgressiveContainer(active_fields=[0, 1, 1])):\n    radius: uint16 # slot 1\n    color: uint8   # slot 2  -\u003e same gindex as Square.color\n\n# Merkleization (pseudocode)\ndef hash_tree_root(value):\n    roots = []\n    it = iter(fields_of(value))\n    for bit in value.active_fields:\n        roots.append(hash_tree_root(next(it)) if bit else Bytes32())\n    return hash(merkleize_progressive(roots), pack_bits(value.active_fields))\n```\n\n`color`를 증명하는 검증기는 두 타입에 같은 gindex를 사용하며, 이후 버전에서 필드가 더 추가되어도 계속 동작합니다.\n\n## 알아둘 점\n\n- 상태는 **Review**입니다. 컨센서스 레이어의 데이터 구조 변경이며, 어떤 컨테이너가 어느 포크에서 이를 채택할지는 별도로 결정됩니다.\n- [EIP-7916](/eip-7916/)(점진적 Merkle 트리 / `ProgressiveList`)에 의존합니다.\n- 256개 필드 상한에는 더 이상 쓰지 않는 슬롯도 포함됩니다. 명세는 이 상한에 도달하면 필드 안에 또 다른 `ProgressiveContainer`를 중첩하도록 제안합니다.\n- `Optional` 필드는 명시적으로 범위 밖이며 향후 제안으로 남겨 두었습니다.\n- 레퍼런스 구현과 테스트는 `ethereum/remerkleable`과 consensus-specs의 SSZ generic 테스트에 있습니다.\n"},"zh":{"lang":"zh","tldr":"一种新的 SSZ 容器类型，其字段在跨分叉时保持相同的 Merkle 位置，这样当共识结构增减字段时，轻客户端和链上证明验证器不会失效。","tags":["ssz","consensus","merkle","light-client"],"related":[7916,4788],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7495/","markdown":"## 它解决什么问题？\n\n以太坊共识层用 SSZ（Simple Serialize）编码 `BeaconState` 和区块等数据结构，并用 Merkle 根对其作出承诺。这样任何人都可以通过一条走到树中特定*广义索引*（gindex）的 Merkle 证明，来证明某一个字段，例如某个验证者的余额。\n\n问题在于，树的形状取决于容器有多少个字段。当某次分叉增加字段并使字段数越过 2 的幂，或者某个字段被删除或更改类型时，所有 gindex 都可能发生偏移。硬编码 gindex 的验证器，例如通过 [EIP-4788](/eip-4788/) 读取信标根的智能合约、跨链桥或硬件钱包，随之失效并需要升级，即使它们关心的字段并没有改变。\n\n`ProgressiveContainer` 为每个字段分配永久的槽位，使证明在各版本之间保持有效。\n\n## 它如何运作\n\n- 容器用一个 `active_fields` 位列表来声明。每个 `1` 表示下一个声明的字段占用的槽位；每个 `0` 是一个空位（在此版本中不存在的字段，例如已被删除的字段）。\n- Merkle 化使用 [EIP-7916](/eip-7916/) 中的渐进式 Merkle 树，它随槽位数量逐步增长，而不是跳到下一个 2 的幂。追加新槽位时，已有槽位不会移动。\n- 不存在的槽位用零哈希填充。然后根与 `active_fields` 混合：`hash(root, pack_bits(active_fields))`，因此被删除的字段不会与值为零的字段混淆。\n- **序列化和 JSON 与普通 `Container` 保持一致**：不存在的字段在传输中不占空间。\n- 规则：至少有一个字段，`active_fields` 最多 256 项，列表不能以 `0` 结尾，且 `1` 的数量必须等于字段数量。\n\n## 示例代码\n\n两种形状共享 `color` 的稳定位置（来自规范，Python/remerkleable 记法）：\n\n```python\nclass Square(ProgressiveContainer(active_fields=[1, 0, 1])):\n    side: uint16   # slot 0\n    color: uint8   # slot 2\n\nclass Circle(ProgressiveContainer(active_fields=[0, 1, 1])):\n    radius: uint16 # slot 1\n    color: uint8   # slot 2  -\u003e same gindex as Square.color\n\n# Merkleization (pseudocode)\ndef hash_tree_root(value):\n    roots = []\n    it = iter(fields_of(value))\n    for bit in value.active_fields:\n        roots.append(hash_tree_root(next(it)) if bit else Bytes32())\n    return hash(merkleize_progressive(roots), pack_bits(value.active_fields))\n```\n\n证明 `color` 的验证器对两种类型使用相同的 gindex，并且在后续版本追加更多字段时仍然有效。\n\n## 需要注意\n\n- 状态为 **Review**。这是共识层数据结构的变更；哪些容器在哪次分叉中采用它，另行决定。\n- 它依赖 [EIP-7916](/eip-7916/)（渐进式 Merkle 树 / `ProgressiveList`）。\n- 256 个字段的上限也计入已弃用的槽位。规范建议，如果将来达到这个上限，可以在某个字段中再嵌套一个 `ProgressiveContainer`。\n- `Optional` 字段明确不在范围内，留给未来的提案。\n- 参考实现和测试位于 `ethereum/remerkleable` 以及 consensus-specs 的 SSZ generic 测试中。\n"}},"requiredBy":[6404,6465,6466,7688,7807,7919,8016]}
