{"eip":7643,"title":"History accumulator for pre-PoS data","description":"Commit to a single root for all block data before the merge.","authors":["lightclient (@lightclient)","kdeme (@kdeme)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2024-02-29","discussionsTo":"https://ethereum-magicians.org/t/eip-7643-history-accumulator-for-pre-pos-data/19014","repo":"EIPs","label":"EIP-7643","officialUrl":"https://eips.ethereum.org/EIPS/eip-7643","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7643.md","url":"https://eips.huatuo.xyz/eip-7643/","tldr":{"en":"Proposes one fixed SSZ root that commits to every proof-of-work block hash and total difficulty, so pre-Merge history can be verified, and proven block by block, without re-executing the old chain.","ja":"すべての Proof-of-Work ブロックのハッシュと累積難易度にコミットする、固定された SSZ ルートを 1 つ提案する。これにより、古いチェーンを再実行せずに、The Merge 以前の履歴を検証し、ブロック単位で証明できる。","ko":"모든 작업 증명(Proof-of-Work) 블록 해시와 총 난이도를 커밋하는 고정된 SSZ 루트 하나를 제안한다. 이를 통해 옛 체인을 다시 실행하지 않고도 머지(Merge) 이전의 히스토리를 검증하고 블록 단위로 증명할 수 있다.","zh":"提出一个固定的 SSZ 根，承诺所有工作量证明区块的哈希和总难度，使合并（Merge）之前的历史可以被验证，并能逐个区块地证明，而无需重新执行旧链。"},"tags":["history","ssz","merge","core","data"],"explainers":{"en":{"lang":"en","tldr":"Proposes one fixed SSZ root that commits to every proof-of-work block hash and total difficulty, so pre-Merge history can be verified, and proven block by block, without re-executing the old chain.","tags":["history","ssz","merge","core","data"],"related":[4444,7639,7642,2935],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7643/","markdown":"## What problem does it solve?\n\nEthereum's proof-of-work history (everything before the Merge) is frozen: it will never change. Yet to trust a downloaded copy of it, a client today must either re-execute every block or walk the header chain backwards from a trusted point, hash by hash. Proving that one specific old block is canonical also requires that long header chain.\n\nAs clients move toward not storing old history themselves ([EIP-4444](/eip-4444/)) and fetching it from other sources, a compact, fixed commitment to the pre-Merge chain makes that data easy to check.\n\n## How it works\n\nThe EIP defines an SSZ structure, the **historical hashes accumulator**:\n\n- Blocks are grouped into epochs of `8192` blocks.\n- For each block, a `HeaderRecord` stores its `block_hash` and the chain's `total_difficulty` at that block.\n- Each full epoch's list of records is reduced to a single `bytes32` hash tree root and appended to `historical_epochs` (up to 2048 entries).\n\nThe hash tree root of this accumulator over all blocks **before block 15537394** (the first proof-of-stake block) is fixed by the spec as:\n\n```\n0xec8e040fd6c557b41ca8ddd38f7e9d58a9281918dc92bdb72342a38fb085e701\n```\n\nThat root can be hard-coded into clients. Two uses follow:\n\n1. **Bulk verification.** Download the pre-Merge headers, hash them, build the accumulator and compare its root with the constant. No execution needed.\n2. **Short proofs.** Any single pre-Merge block can be proven with an `O(log n)` Merkle proof against the root, instead of a chain of headers.\n\nTotal difficulty is included so clients can still answer JSON-RPC calls that report it and can verify the terminal total difficulty of the last PoW block.\n\n## Sample code\n\nThe SSZ definitions from the spec, plus a sketch of the verification loop:\n\n```python\nEPOCH_SIZE = 8192            # blocks per epoch\nMAX_HISTORICAL_EPOCHS = 2048\n\nHeaderRecord = Container[block_hash: bytes32, total_difficulty: uint256]\nEpochRecord = List[HeaderRecord, max_length=EPOCH_SIZE]\nHistoricalHashesAccumulator = Container[\n    historical_epochs: List[bytes32, max_length=MAX_HISTORICAL_EPOCHS],\n    current_epoch: EpochRecord,\n]\n\nPRE_POS_ROOT = \"0xec8e040fd6c557b41ca8ddd38f7e9d58a9281918dc92bdb72342a38fb085e701\"\n\ndef verify_pre_merge(headers):\n    acc, td = HistoricalHashesAccumulator(), 0\n    for h in headers:                      # blocks 0 .. 15537393, in order\n        td += h.difficulty\n        if len(acc.current_epoch) == EPOCH_SIZE:\n            acc.historical_epochs.append(hash_tree_root(acc.current_epoch))\n            acc.current_epoch = EpochRecord()\n        acc.current_epoch.append(HeaderRecord(keccak(rlp(h)), td))\n    return hash_tree_root(acc) == PRE_POS_ROOT\n```\n\n## Things to know\n\n- Status is **Stagnant**. It was not scheduled for a network upgrade. The accumulator itself is not a consensus change: it commits to data that already exists.\n- The spec's test cases list the expected root of each early epoch, which helps implementers check their accumulator.\n- It fits the history-expiry work: [EIP-4444](/eip-4444/) (clients stop serving old history), [EIP-7639](/eip-7639/) and [EIP-7642](/eip-7642/) (networking changes for that). Recent block hashes are served in state by [EIP-2935](/eip-2935/).\n- It covers proof-of-work blocks only. Post-Merge blocks are already committed to by the beacon chain's own historical roots.\n"},"ja":{"lang":"ja","tldr":"すべての Proof-of-Work ブロックのハッシュと累積難易度にコミットする、固定された SSZ ルートを 1 つ提案する。これにより、古いチェーンを再実行せずに、The Merge 以前の履歴を検証し、ブロック単位で証明できる。","tags":["history","ssz","merge","core","data"],"related":[4444,7639,7642,2935],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7643/","markdown":"## 何を解決するのか\n\nEthereum の Proof-of-Work の履歴（The Merge 以前のすべて）は固定されており、今後変わることはありません。それでも、ダウンロードしたコピーを信頼するには、クライアントは現状、すべてのブロックを再実行するか、信頼できる地点からヘッダーチェーンをハッシュごとに遡る必要があります。ある特定の古いブロックが正規のものであることを証明する場合も、その長いヘッダーチェーンが必要です。\n\nクライアントが古い履歴を自分では保存せず（[EIP-4444](/eip-4444/)）、他のソースから取得する方向に進むにつれて、The Merge 以前のチェーンに対するコンパクトで固定的なコミットメントがあれば、そのデータを簡単に検査できます。\n\n## 仕組み\n\nこの EIP は、**historical hashes accumulator** という SSZ 構造を定義します。\n\n- ブロックは `8192` ブロックずつのエポックにまとめられます。\n- 各ブロックについて、`HeaderRecord` が `block_hash` と、そのブロックの時点でのチェーンの `total_difficulty` を保存します。\n- 各エポックが満たされたら、そのレコードのリストは 1 つの `bytes32` のハッシュツリールートに縮約され、`historical_epochs`（最大 2048 エントリ）に追加されます。\n\n**ブロック 15537394**（最初の Proof-of-Stake ブロック）**より前のすべてのブロック**に対するこの accumulator のハッシュツリールートは、仕様によって次のように固定されています。\n\n```\n0xec8e040fd6c557b41ca8ddd38f7e9d58a9281918dc92bdb72342a38fb085e701\n```\n\nこのルートはクライアントにハードコードできます。そこから 2 つの使い方が生まれます。\n\n1. **一括検証。** The Merge 以前のヘッダーをダウンロードし、ハッシュして accumulator を構築し、そのルートを定数と比較します。実行は不要です。\n2. **短い証明。** The Merge 以前の個々のブロックは、ヘッダーのチェーンではなく、ルートに対する `O(log n)` の Merkle 証明で証明できます。\n\n累積難易度が含まれているのは、クライアントがそれを報告する JSON-RPC 呼び出しに引き続き応答でき、最後の PoW ブロックの terminal total difficulty を検証できるようにするためです。\n\n## サンプルコード\n\n仕様にある SSZ の定義と、検証ループのスケッチ:\n\n```python\nEPOCH_SIZE = 8192            # blocks per epoch\nMAX_HISTORICAL_EPOCHS = 2048\n\nHeaderRecord = Container[block_hash: bytes32, total_difficulty: uint256]\nEpochRecord = List[HeaderRecord, max_length=EPOCH_SIZE]\nHistoricalHashesAccumulator = Container[\n    historical_epochs: List[bytes32, max_length=MAX_HISTORICAL_EPOCHS],\n    current_epoch: EpochRecord,\n]\n\nPRE_POS_ROOT = \"0xec8e040fd6c557b41ca8ddd38f7e9d58a9281918dc92bdb72342a38fb085e701\"\n\ndef verify_pre_merge(headers):\n    acc, td = HistoricalHashesAccumulator(), 0\n    for h in headers:                      # blocks 0 .. 15537393, in order\n        td += h.difficulty\n        if len(acc.current_epoch) == EPOCH_SIZE:\n            acc.historical_epochs.append(hash_tree_root(acc.current_epoch))\n            acc.current_epoch = EpochRecord()\n        acc.current_epoch.append(HeaderRecord(keccak(rlp(h)), td))\n    return hash_tree_root(acc) == PRE_POS_ROOT\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** です。ネットワークアップグレードには予定されませんでした。accumulator 自体はコンセンサスの変更ではなく、すでに存在するデータにコミットするものです。\n- 仕様のテストケースには、初期の各エポックの期待されるルートが記載されており、実装者が自分の accumulator を確認するのに役立ちます。\n- 履歴の失効に関する取り組みに合致します。[EIP-4444](/eip-4444/)（クライアントが古い履歴の提供をやめる）、[EIP-7639](/eip-7639/) と [EIP-7642](/eip-7642/)（そのためのネットワーク変更）です。最近のブロックハッシュは [EIP-2935](/eip-2935/) によってステート内で提供されます。\n- 対象は Proof-of-Work のブロックのみです。The Merge 以降のブロックは、すでにビーコンチェーン自身の historical roots によってコミットされています。\n"},"ko":{"lang":"ko","tldr":"모든 작업 증명(Proof-of-Work) 블록 해시와 총 난이도를 커밋하는 고정된 SSZ 루트 하나를 제안한다. 이를 통해 옛 체인을 다시 실행하지 않고도 머지(Merge) 이전의 히스토리를 검증하고 블록 단위로 증명할 수 있다.","tags":["history","ssz","merge","core","data"],"related":[4444,7639,7642,2935],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7643/","markdown":"## 어떤 문제를 해결하나요?\n\n이더리움의 작업 증명 히스토리(머지 이전의 모든 것)는 고정되어 있으며 앞으로도 절대 바뀌지 않습니다. 그런데도 내려받은 사본을 신뢰하려면, 클라이언트는 현재 모든 블록을 다시 실행하거나 신뢰할 수 있는 지점에서 헤더 체인을 해시 하나씩 거슬러 올라가야 합니다. 특정한 옛 블록이 정식(canonical) 블록임을 증명할 때도 그 긴 헤더 체인이 필요합니다.\n\n클라이언트가 옛 히스토리를 스스로 저장하지 않고([EIP-4444](/eip-4444/)) 다른 곳에서 가져오는 방향으로 나아감에 따라, 머지 이전 체인에 대한 간결하고 고정된 커밋먼트가 있으면 그 데이터를 쉽게 검증할 수 있습니다.\n\n## 어떻게 동작하나요?\n\n이 EIP는 **historical hashes accumulator**라는 SSZ 구조를 정의합니다.\n\n- 블록은 `8192`개 단위의 에폭으로 묶입니다.\n- 각 블록에 대해 `HeaderRecord`가 `block_hash`와 그 블록 시점의 체인 `total_difficulty`를 저장합니다.\n- 가득 찬 각 에폭의 레코드 목록은 하나의 `bytes32` 해시 트리 루트로 줄어들어 `historical_epochs`(최대 2048개 항목)에 추가됩니다.\n\n**블록 15537394**(첫 지분 증명 블록) **이전의 모든 블록**에 대한 이 accumulator의 해시 트리 루트는 명세에서 다음과 같이 고정됩니다.\n\n```\n0xec8e040fd6c557b41ca8ddd38f7e9d58a9281918dc92bdb72342a38fb085e701\n```\n\n이 루트는 클라이언트에 하드코딩할 수 있습니다. 여기서 두 가지 용도가 나옵니다.\n\n1. **일괄 검증.** 머지 이전 헤더를 내려받아 해시하고 accumulator를 만든 뒤 그 루트를 상수와 비교합니다. 실행은 필요 없습니다.\n2. **짧은 증명.** 머지 이전의 개별 블록 하나는 헤더 체인 대신 루트에 대한 `O(log n)` 머클 증명으로 증명할 수 있습니다.\n\n총 난이도를 포함하는 이유는 클라이언트가 이를 보고하는 JSON-RPC 호출에 계속 응답하고 마지막 PoW 블록의 terminal total difficulty를 검증할 수 있게 하기 위해서입니다.\n\n## 샘플 코드\n\n명세의 SSZ 정의와 검증 루프의 스케치:\n\n```python\nEPOCH_SIZE = 8192            # blocks per epoch\nMAX_HISTORICAL_EPOCHS = 2048\n\nHeaderRecord = Container[block_hash: bytes32, total_difficulty: uint256]\nEpochRecord = List[HeaderRecord, max_length=EPOCH_SIZE]\nHistoricalHashesAccumulator = Container[\n    historical_epochs: List[bytes32, max_length=MAX_HISTORICAL_EPOCHS],\n    current_epoch: EpochRecord,\n]\n\nPRE_POS_ROOT = \"0xec8e040fd6c557b41ca8ddd38f7e9d58a9281918dc92bdb72342a38fb085e701\"\n\ndef verify_pre_merge(headers):\n    acc, td = HistoricalHashesAccumulator(), 0\n    for h in headers:                      # blocks 0 .. 15537393, in order\n        td += h.difficulty\n        if len(acc.current_epoch) == EPOCH_SIZE:\n            acc.historical_epochs.append(hash_tree_root(acc.current_epoch))\n            acc.current_epoch = EpochRecord()\n        acc.current_epoch.append(HeaderRecord(keccak(rlp(h)), td))\n    return hash_tree_root(acc) == PRE_POS_ROOT\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**입니다. 네트워크 업그레이드에 포함되도록 예정되지 않았습니다. accumulator 자체는 합의 변경이 아니며, 이미 존재하는 데이터를 커밋합니다.\n- 명세의 테스트 케이스에는 초기 각 에폭의 예상 루트가 나열되어 있어 구현자가 자신의 accumulator를 확인하는 데 도움이 됩니다.\n- 히스토리 만료 작업과 맞물립니다. [EIP-4444](/eip-4444/)(클라이언트가 옛 히스토리 제공을 중단), [EIP-7639](/eip-7639/)와 [EIP-7642](/eip-7642/)(이를 위한 네트워킹 변경)가 그것입니다. 최근 블록 해시는 [EIP-2935](/eip-2935/)가 상태에서 제공합니다.\n- 작업 증명 블록만 다룹니다. 머지 이후의 블록은 이미 비콘 체인 자체의 historical roots로 커밋되어 있습니다.\n"},"zh":{"lang":"zh","tldr":"提出一个固定的 SSZ 根，承诺所有工作量证明区块的哈希和总难度，使合并（Merge）之前的历史可以被验证，并能逐个区块地证明，而无需重新执行旧链。","tags":["history","ssz","merge","core","data"],"related":[4444,7639,7642,2935],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7643/","markdown":"## 它解决什么问题？\n\n以太坊的工作量证明历史（合并之前的一切）已经冻结：它永远不会再变。然而，要信任下载下来的副本，客户端如今要么重新执行每一个区块，要么从某个可信点出发，逐个哈希地向后遍历区块头链。要证明某个特定的旧区块属于规范链，同样需要那条很长的区块头链。\n\n随着客户端不再自己存储旧历史（[EIP-4444](/eip-4444/)），转而从其他来源获取，一个对合并之前的链的紧凑、固定的承诺，会让这些数据易于检查。\n\n## 它如何运作\n\n该 EIP 定义了一个 SSZ 结构，即 **historical hashes accumulator**（历史哈希累加器）：\n\n- 区块被分组为每 `8192` 个区块一个 epoch。\n- 对每个区块，`HeaderRecord` 存储它的 `block_hash` 以及该区块处链的 `total_difficulty`。\n- 每个完整 epoch 的记录列表被归约为单个 `bytes32` 哈希树根，并追加到 `historical_epochs`（最多 2048 项）中。\n\n对 **15537394 号区块**（第一个权益证明区块）**之前的所有区块**，这个累加器的哈希树根由规范固定为：\n\n```\n0xec8e040fd6c557b41ca8ddd38f7e9d58a9281918dc92bdb72342a38fb085e701\n```\n\n这个根可以硬编码到客户端中。由此产生两种用途：\n\n1. **批量验证。** 下载合并之前的区块头，对它们做哈希，构建累加器，并把它的根与该常量比较。无需执行。\n2. **简短的证明。** 合并之前的任何单个区块都可以通过针对该根的 `O(log n)` Merkle 证明来证明，而不需要一条区块头链。\n\n之所以包含总难度，是为了让客户端仍然能够响应报告它的 JSON-RPC 调用，并能验证最后一个 PoW 区块的终端总难度（terminal total difficulty）。\n\n## 示例代码\n\n规范中的 SSZ 定义，以及验证循环的示意：\n\n```python\nEPOCH_SIZE = 8192            # blocks per epoch\nMAX_HISTORICAL_EPOCHS = 2048\n\nHeaderRecord = Container[block_hash: bytes32, total_difficulty: uint256]\nEpochRecord = List[HeaderRecord, max_length=EPOCH_SIZE]\nHistoricalHashesAccumulator = Container[\n    historical_epochs: List[bytes32, max_length=MAX_HISTORICAL_EPOCHS],\n    current_epoch: EpochRecord,\n]\n\nPRE_POS_ROOT = \"0xec8e040fd6c557b41ca8ddd38f7e9d58a9281918dc92bdb72342a38fb085e701\"\n\ndef verify_pre_merge(headers):\n    acc, td = HistoricalHashesAccumulator(), 0\n    for h in headers:                      # blocks 0 .. 15537393, in order\n        td += h.difficulty\n        if len(acc.current_epoch) == EPOCH_SIZE:\n            acc.historical_epochs.append(hash_tree_root(acc.current_epoch))\n            acc.current_epoch = EpochRecord()\n        acc.current_epoch.append(HeaderRecord(keccak(rlp(h)), td))\n    return hash_tree_root(acc) == PRE_POS_ROOT\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**。它没有被安排进网络升级。累加器本身并不是共识变更：它承诺的是已经存在的数据。\n- 规范的测试用例列出了每个早期 epoch 的预期根，有助于实现者检查自己的累加器。\n- 它契合历史过期方面的工作：[EIP-4444](/eip-4444/)（客户端停止提供旧历史）、[EIP-7639](/eip-7639/) 和 [EIP-7642](/eip-7642/)（为此所做的网络变更）。近期的区块哈希由 [EIP-2935](/eip-2935/) 在状态中提供。\n- 它只涵盖工作量证明区块。合并之后的区块已经由信标链自己的 historical roots 所承诺。\n"}}}
