{"eip":8247,"title":"Ancestor-Indexed BALs","description":"Compact references to recent block access lists for repeated addresses and storage slots","authors":["Toni Wahrstätter (@nerolation)"],"status":"Draft","type":"Standards Track","category":"Core","created":"2026-05-03","requires":[7928],"discussionsTo":"https://ethereum-magicians.org/t/eip-8247-ancestor-indexed-bals/29926","repo":"EIPs","label":"EIP-8247","officialUrl":"https://eips.ethereum.org/EIPS/eip-8247","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8247.md","url":"https://eips.huatuo.xyz/eip-8247/","tldr":{"en":"Shrinks EIP-7928 block-level access lists by letting addresses and storage keys point back into one of the last eight blocks' lists instead of repeating the full 20- or 32-byte value.","ja":"EIP-7928 のブロックレベルアクセスリストを、20 バイトや 32 バイトの完全な値を繰り返す代わりに、直近 8 ブロックのいずれかのリストを指し示せるようにして縮小する。","ko":"EIP-7928 블록 수준 액세스 리스트를, 전체 20바이트 또는 32바이트 값을 반복하는 대신 최근 여덟 블록 중 하나의 리스트를 가리킬 수 있게 해서 줄인다.","zh":"缩小 EIP-7928 的区块级访问列表：让地址和存储键可以指回最近八个区块的列表之一，而不是重复完整的 20 字节或 32 字节的值。"},"tags":["bal","compression","core","state","access-list"],"explainers":{"en":{"lang":"en","tldr":"Shrinks EIP-7928 block-level access lists by letting addresses and storage keys point back into one of the last eight blocks' lists instead of repeating the full 20- or 32-byte value.","tags":["bal","compression","core","state","access-list"],"related":[7928,8159],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-8247/","markdown":"## What problem does it solve?\n\n[EIP-7928](/eip-7928/) adds a Block Access List (BAL) to every block: a list of every account and storage slot the block touched, along with the post-transaction changes. BALs enable parallel execution and validation, but they cost bandwidth, and much of their size is raw identifiers: 20-byte addresses and 32-byte storage keys.\n\nPopular contracts and slots (major tokens, DEX pools, oracles) are touched block after block, so the same identifiers appear again and again. Pointing to where a value already appeared in a recent block is much shorter than writing it out. The author estimates a 30–50 % size reduction, depending on how much reuse there is between blocks.\n\n## How it works\n\nTwo reference types are added, both RLP lists:\n\n```text\nAccountRef = [ancestor_offset: uint8, account_index: uint32]\nSlotRef    = [ancestor_offset: uint8, account_index: uint32, slot_index: uint32]\n```\n\n- `ancestor_offset` is 0–7: 0 is the parent block, 7 the eighth ancestor.\n- `account_index` is the position of the account in that ancestor's BAL (already sorted by address under EIP-7928).\n- `slot_index` is the position in that account's **slot dictionary**: the sorted, de-duplicated union of its changed and read storage keys.\n\nWherever EIP-7928 had an `Address` or `StorageKey`, a reference may now appear. They are told apart by RLP type: a literal is a byte string, a reference is a list.\n\nReferences always resolve against the fully *expanded* ancestor BAL (all references already replaced by literals), never against the encoded one, so there are no chains of references.\n\nThe encoding is **canonical**: if any valid reference exists for a value, the literal is forbidden, and the smallest reference by `(ancestor_offset, account_index, slot_index)` must be used. This makes the encoded BAL a deterministic function of the block and its ancestors, so a builder cannot pad it out.\n\n## Sample code\n\nPseudocode for resolving and choosing references:\n\n```python\ndef resolve(ref, block_number, expanded_ancestors):\n    off = ref[0]\n    assert 0 \u003c= off \u003c= 7\n    anc = expanded_ancestors[block_number - off - 1]   # must be post-activation\n    acct = anc.accounts[ref[1]]                         # IndexError -\u003e invalid block\n    if len(ref) == 2:\n        return acct.address\n    return acct.slot_dictionary[ref[2]]                 # sorted union of reads+writes\n\ndef encode_address(addr, block_number, expanded_ancestors):\n    for off in range(8):                                # smallest offset first\n        anc = expanded_ancestors.get(block_number - off - 1)\n        if anc and addr in anc.account_index:\n            return [off, anc.account_index[addr]]\n    return addr                                         # literal only if no ref exists\n```\n\nSize saving per item:\n\n```text\nAddress    20 bytes -\u003e AccountRef ~5 bytes\nStorageKey 32 bytes -\u003e SlotRef    ~9 bytes\n```\n\n## Things to know\n\n- **Status: Draft.** Test cases are still TBD.\n- It is a hard fork change. References to blocks before activation are invalid, and pre-activation BALs keep their literal form.\n- Clients must keep (or be able to rebuild) the expanded BALs and slot dictionaries for the last eight canonical blocks. Lookups are bounded array accesses, so DoS risk stays limited.\n- The EIP-7928 `bal_items` size limit is applied to the expanded BAL, so compression does not let a block carry more items.\n- A reorg can invalidate blocks whose references no longer resolve on the new chain, as with any data tied to its ancestors.\n- BAL exchange over the network is covered separately by [EIP-8159](/eip-8159/).\n"},"ja":{"lang":"ja","tldr":"EIP-7928 のブロックレベルアクセスリストを、20 バイトや 32 バイトの完全な値を繰り返す代わりに、直近 8 ブロックのいずれかのリストを指し示せるようにして縮小する。","tags":["bal","compression","core","state","access-list"],"related":[7928,8159],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-8247/","markdown":"## 何を解決するのか\n\n[EIP-7928](/eip-7928/) はすべてのブロックに Block Access List（BAL）を追加します。ブロックが触れたすべてのアカウントとストレージスロット、およびトランザクション後の変更のリストです。BAL は並列実行と並列検証を可能にしますが、帯域幅のコストがかかり、そのサイズの多くは生の識別子、つまり 20 バイトのアドレスと 32 バイトのストレージキーです。\n\n人気のコントラクトやスロット（主要なトークン、DEX プール、オラクル）はブロックごとに繰り返し触れられるため、同じ識別子が何度も現れます。直近のブロックで値がすでに現れた場所を指すほうが、書き出すよりずっと短くなります。作者は、ブロック間での再利用の度合いに応じて、サイズが 30〜50 % 減ると見積もっています。\n\n## 仕組み\n\n2 種類の参照型が追加されます。どちらも RLP リストです。\n\n```text\nAccountRef = [ancestor_offset: uint8, account_index: uint32]\nSlotRef    = [ancestor_offset: uint8, account_index: uint32, slot_index: uint32]\n```\n\n- `ancestor_offset` は 0〜7 で、0 は親ブロック、7 は 8 世代前の祖先です。\n- `account_index` は、その祖先の BAL（EIP-7928 によりすでにアドレス順にソートされています）におけるアカウントの位置です。\n- `slot_index` は、そのアカウントの**スロット辞書**における位置です。変更されたストレージキーと読み取られたストレージキーの、ソート済みで重複を除いた和集合です。\n\nEIP-7928 で `Address` や `StorageKey` があった場所には、参照を置けるようになります。両者は RLP の型で区別されます。リテラルはバイト列、参照はリストです。\n\n参照は常に、完全に*展開された*祖先の BAL（すべての参照がすでにリテラルに置き換えられたもの）に対して解決され、エンコードされたものに対しては解決されないため、参照の連鎖は生じません。\n\nエンコーディングは**正準**です。ある値に対して有効な参照が存在する場合、リテラルは禁止され、`(ancestor_offset, account_index, slot_index)` で最小の参照を使わなければなりません。これにより、エンコードされた BAL はブロックとその祖先の決定論的な関数となり、ビルダーが水増しすることはできません。\n\n## サンプルコード\n\n参照を解決し、選択するための擬似コード:\n\n```python\ndef resolve(ref, block_number, expanded_ancestors):\n    off = ref[0]\n    assert 0 \u003c= off \u003c= 7\n    anc = expanded_ancestors[block_number - off - 1]   # must be post-activation\n    acct = anc.accounts[ref[1]]                         # IndexError -\u003e invalid block\n    if len(ref) == 2:\n        return acct.address\n    return acct.slot_dictionary[ref[2]]                 # sorted union of reads+writes\n\ndef encode_address(addr, block_number, expanded_ancestors):\n    for off in range(8):                                # smallest offset first\n        anc = expanded_ancestors.get(block_number - off - 1)\n        if anc and addr in anc.account_index:\n            return [off, anc.account_index[addr]]\n    return addr                                         # literal only if no ref exists\n```\n\n項目ごとのサイズ削減:\n\n```text\nAddress    20 bytes -\u003e AccountRef ~5 bytes\nStorageKey 32 bytes -\u003e SlotRef    ~9 bytes\n```\n\n## 知っておくべきこと\n\n- **ステータス: Draft。** テストケースはまだ未定です。\n- ハードフォークによる変更です。有効化前のブロックへの参照は無効で、有効化前の BAL はリテラル形式のままです。\n- クライアントは、直近 8 つの正準ブロックについて、展開済みの BAL とスロット辞書を保持する（または再構築できる）必要があります。参照の解決は上限のある配列アクセスなので、DoS のリスクは限定的です。\n- EIP-7928 の `bal_items` のサイズ制限は展開後の BAL に適用されるため、圧縮によってブロックがより多くの項目を運べるようになることはありません。\n- 祖先に結びついたあらゆるデータと同様に、リオルグによって、新しいチェーン上では参照が解決できなくなるブロックが無効になる場合があります。\n- BAL のネットワーク上での交換は、[EIP-8159](/eip-8159/) で別途扱われています。\n"},"ko":{"lang":"ko","tldr":"EIP-7928 블록 수준 액세스 리스트를, 전체 20바이트 또는 32바이트 값을 반복하는 대신 최근 여덟 블록 중 하나의 리스트를 가리킬 수 있게 해서 줄인다.","tags":["bal","compression","core","state","access-list"],"related":[7928,8159],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-8247/","markdown":"## 어떤 문제를 해결하나요?\n\n[EIP-7928](/eip-7928/)은 모든 블록에 블록 액세스 리스트(Block Access List, BAL)를 추가합니다. 블록이 건드린 모든 계정과 스토리지 슬롯, 그리고 트랜잭션 이후의 변경 사항을 나열한 목록입니다. BAL은 병렬 실행과 검증을 가능하게 하지만 대역폭 비용이 들고, 크기의 상당 부분은 원시 식별자, 즉 20바이트 주소와 32바이트 스토리지 키입니다.\n\n인기 있는 컨트랙트와 슬롯(주요 토큰, DEX 풀, 오라클)은 블록마다 계속 건드려지므로 같은 식별자가 반복해서 나타납니다. 최근 블록에서 값이 이미 나타난 위치를 가리키는 것이 그대로 쓰는 것보다 훨씬 짧습니다. 저자는 블록 간 재사용 정도에 따라 크기가 30–50 % 줄어들 것으로 추정합니다.\n\n## 어떻게 동작하나요?\n\n두 가지 참조 타입이 추가되며, 둘 다 RLP 리스트입니다.\n\n```text\nAccountRef = [ancestor_offset: uint8, account_index: uint32]\nSlotRef    = [ancestor_offset: uint8, account_index: uint32, slot_index: uint32]\n```\n\n- `ancestor_offset`은 0–7입니다. 0은 부모 블록, 7은 여덟 번째 조상입니다.\n- `account_index`는 그 조상의 BAL(EIP-7928에 따라 이미 주소순으로 정렬됨)에서 계정의 위치입니다.\n- `slot_index`는 해당 계정의 **슬롯 사전(slot dictionary)**에서의 위치입니다. 변경된 스토리지 키와 읽힌 스토리지 키의 합집합을 정렬하고 중복을 제거한 것입니다.\n\nEIP-7928에서 `Address`나 `StorageKey`가 있던 자리에는 이제 참조가 올 수 있습니다. 둘은 RLP 타입으로 구분됩니다. 리터럴은 바이트 문자열이고 참조는 리스트입니다.\n\n참조는 항상 완전히 *확장된* 조상 BAL(모든 참조가 이미 리터럴로 치환된 것)에 대해 해석되며, 인코딩된 것에 대해서는 해석되지 않으므로 참조 체인이 생기지 않습니다.\n\n인코딩은 **정규적(canonical)**입니다. 어떤 값에 유효한 참조가 하나라도 있으면 리터럴은 금지되고, `(ancestor_offset, account_index, slot_index)` 기준으로 가장 작은 참조를 써야 합니다. 이로써 인코딩된 BAL은 블록과 그 조상의 결정적 함수가 되어, 빌더가 부풀릴 수 없습니다.\n\n## 샘플 코드\n\n참조를 해석하고 선택하는 의사 코드:\n\n```python\ndef resolve(ref, block_number, expanded_ancestors):\n    off = ref[0]\n    assert 0 \u003c= off \u003c= 7\n    anc = expanded_ancestors[block_number - off - 1]   # must be post-activation\n    acct = anc.accounts[ref[1]]                         # IndexError -\u003e invalid block\n    if len(ref) == 2:\n        return acct.address\n    return acct.slot_dictionary[ref[2]]                 # sorted union of reads+writes\n\ndef encode_address(addr, block_number, expanded_ancestors):\n    for off in range(8):                                # smallest offset first\n        anc = expanded_ancestors.get(block_number - off - 1)\n        if anc and addr in anc.account_index:\n            return [off, anc.account_index[addr]]\n    return addr                                         # literal only if no ref exists\n```\n\n항목당 크기 절감:\n\n```text\nAddress    20 bytes -\u003e AccountRef ~5 bytes\nStorageKey 32 bytes -\u003e SlotRef    ~9 bytes\n```\n\n## 알아둘 점\n\n- **상태: Draft.** 테스트 케이스는 아직 TBD입니다.\n- 하드 포크 변경입니다. 활성화 이전 블록에 대한 참조는 무효이며, 활성화 이전의 BAL은 리터럴 형식을 유지합니다.\n- 클라이언트는 최근 여덟 개의 정규 블록에 대한 확장된 BAL과 슬롯 사전을 유지하거나 다시 만들 수 있어야 합니다. 조회는 범위가 한정된 배열 접근이므로 DoS 위험은 제한적입니다.\n- EIP-7928의 `bal_items` 크기 제한은 확장된 BAL에 적용되므로, 압축한다고 해서 블록이 더 많은 항목을 담을 수 있게 되는 것은 아닙니다.\n- 조상에 묶인 모든 데이터와 마찬가지로, 리오그는 새 체인에서 참조가 더 이상 해석되지 않는 블록을 무효화할 수 있습니다.\n- 네트워크를 통한 BAL 교환은 [EIP-8159](/eip-8159/)에서 별도로 다룹니다.\n"},"zh":{"lang":"zh","tldr":"缩小 EIP-7928 的区块级访问列表：让地址和存储键可以指回最近八个区块的列表之一，而不是重复完整的 20 字节或 32 字节的值。","tags":["bal","compression","core","state","access-list"],"related":[7928,8159],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-8247/","markdown":"## 它解决什么问题？\n\n[EIP-7928](/eip-7928/) 为每个区块添加一个区块访问列表（Block Access List，BAL）：列出该区块触及的每个账户和存储槽，以及交易后的变更。BAL 支持并行执行和验证，但会消耗带宽，而且其体积的大部分是原始标识符：20 字节的地址和 32 字节的存储键。\n\n热门合约和存储槽（主要代币、DEX 池、预言机）在一个又一个区块中被触及，因此相同的标识符反复出现。指向某个值在最近区块中已出现的位置，比把它完整写出来要短得多。作者估计可缩小 30–50 % 的体积，具体取决于区块之间的复用程度。\n\n## 它如何运作\n\n新增两种引用类型，都是 RLP 列表：\n\n```text\nAccountRef = [ancestor_offset: uint8, account_index: uint32]\nSlotRef    = [ancestor_offset: uint8, account_index: uint32, slot_index: uint32]\n```\n\n- `ancestor_offset` 取值 0–7：0 是父区块，7 是第八代祖先。\n- `account_index` 是该账户在那个祖先 BAL 中的位置（按 EIP-7928，已按地址排序）。\n- `slot_index` 是在该账户的**槽字典**中的位置：它被修改过和被读取过的存储键的并集，经排序并去重。\n\n在 EIP-7928 中出现 `Address` 或 `StorageKey` 的地方，现在都可以出现引用。两者通过 RLP 类型区分：字面值是字节串，引用是列表。\n\n引用总是针对完全*展开*的祖先 BAL（所有引用都已被替换为字面值）来解析，而不是针对编码后的 BAL，因此不会出现引用链。\n\n编码是**规范的**：如果某个值存在任何有效引用，就禁止使用字面值，并且必须使用按 `(ancestor_offset, account_index, slot_index)` 排序最小的那个引用。这使得编码后的 BAL 成为区块及其祖先的确定性函数，构建者无法对其进行填充。\n\n## 示例代码\n\n解析和选择引用的伪代码：\n\n```python\ndef resolve(ref, block_number, expanded_ancestors):\n    off = ref[0]\n    assert 0 \u003c= off \u003c= 7\n    anc = expanded_ancestors[block_number - off - 1]   # must be post-activation\n    acct = anc.accounts[ref[1]]                         # IndexError -\u003e invalid block\n    if len(ref) == 2:\n        return acct.address\n    return acct.slot_dictionary[ref[2]]                 # sorted union of reads+writes\n\ndef encode_address(addr, block_number, expanded_ancestors):\n    for off in range(8):                                # smallest offset first\n        anc = expanded_ancestors.get(block_number - off - 1)\n        if anc and addr in anc.account_index:\n            return [off, anc.account_index[addr]]\n    return addr                                         # literal only if no ref exists\n```\n\n每项节省的大小：\n\n```text\nAddress    20 bytes -\u003e AccountRef ~5 bytes\nStorageKey 32 bytes -\u003e SlotRef    ~9 bytes\n```\n\n## 需要注意\n\n- **状态：Draft。** 测试用例仍待定。\n- 这是一项硬分叉变更。对激活前区块的引用是无效的，激活前的 BAL 保持字面值形式。\n- 客户端必须保留（或能够重建）最近八个规范区块的展开 BAL 和槽字典。查找是有界的数组访问，因此 DoS 风险有限。\n- EIP-7928 的 `bal_items` 大小限制作用于展开后的 BAL，所以压缩不会让区块容纳更多条目。\n- 与任何绑定到其祖先的数据一样，重组可能使那些引用在新链上无法解析的区块失效。\n- 网络上的 BAL 交换由 [EIP-8159](/eip-8159/) 单独涵盖。\n"}}}
