{"eip":6914,"title":"Reuse Withdrawn Validator Indices","description":"Reuse fully withdrawn and safe to reuse validator indices for new beacon chain deposits.","authors":["Lion (@dapplion)","Danny Ryan (@djrtwo)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2023-04-19","discussionsTo":"https://ethereum-magicians.org/t/eip-6914-reuse-withdrawn-validator-indices/15253","repo":"EIPs","label":"EIP-6914","officialUrl":"https://eips.ethereum.org/EIPS/eip-6914","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-6914.md","url":"https://eips.huatuo.xyz/eip-6914/","tldr":{"en":"A stagnant consensus-layer proposal to let new validators reuse the index of a long-withdrawn validator, so the beacon state's validator and balance lists stop growing forever.","ja":"停滞中のコンセンサスレイヤー提案。新しいバリデータが、とうに引き出し済みのバリデータのインデックスを再利用できるようにし、ビーコンステートのバリデータと残高のリストが際限なく増え続けないようにする。","ko":"정체(Stagnant) 상태인 합의 계층 제안. 새 검증자가 오래전에 인출을 마친 검증자의 인덱스를 재사용할 수 있게 해, 비콘 상태의 검증자 및 잔액 리스트가 끝없이 커지지 않도록 한다.","zh":"一项已停滞的共识层提案：允许新验证者复用早已提取完毕的验证者的索引，使信标链状态中的验证者列表和余额列表不再无限增长。"},"tags":["consensus","beacon-chain","validators","state-growth"],"explainers":{"en":{"lang":"en","tldr":"A stagnant consensus-layer proposal to let new validators reuse the index of a long-withdrawn validator, so the beacon state's validator and balance lists stop growing forever.","tags":["consensus","beacon-chain","validators","state-growth"],"related":[4895,7002,6110,7251],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-6914/","markdown":"## What problem does it solve?\n\nThe beacon chain keeps two parallel lists in its state: `validators` and `balances`. A deposit for a new public key always **appends** a new entry; a validator that exits and fully withdraws keeps its slot forever. As stakers come and go over years, both lists grow without bound, even though many entries belong to validators with nothing left.\n\nBigger lists mean more client memory, slower state-root computation and longer validator-set scans. EIP-6914 proposes a simple clean-up: once it is safe, give a dead validator's index to a new one.\n\n## How it works\n\n- When a new deposit arrives, the state transition looks for a validator index that is **fully withdrawn** and has been **withdrawable for at least `SAFE_EPOCHS_TO_REUSE_INDEX` epochs**.\n- If one exists, the new validator's record and balance overwrite that index instead of being appended.\n- The detailed constants and functions are in the consensus-specs feature folder for EIP-6914, not in the EIP text.\n- The execution layer is not affected.\n\n**Why the waiting period?** Slashing evidence (`AttesterSlashing`) identifies signers by validator **index**, not by public key. If an index is reused too soon, its old public key is overwritten in the state. An attacker controlling about a third of stake could exit some validators, let their indices be reused, then build an alternative chain where those validators never exited and mix their keys into double-signed aggregate attestations. On the honest chain those indices now map to different keys, so the slashing evidence cannot be verified, which breaks accountable safety.\n\nWaiting `SAFE_EPOCHS_TO_REUSE_INDEX` (set to three times the maximum weak subjectivity period) means any such attestation falls outside the window in which accountable safety must hold.\n\n## Sample code\n\nSimplified pseudocode of index selection on deposit (illustrative; see consensus-specs for the exact functions):\n\n```python\ndef is_reusable_validator(validator, balance, epoch) -\u003e bool:\n    return (\n        epoch \u003e validator.withdrawable_epoch + SAFE_EPOCHS_TO_REUSE_INDEX\n        and balance == 0\n    )\n\ndef get_index_for_new_validator(state) -\u003e int:\n    epoch = get_current_epoch(state)\n    for index, validator in enumerate(state.validators):\n        if is_reusable_validator(validator, state.balances[index], epoch):\n            return index\n    return len(state.validators)  # nothing reusable: append\n\ndef add_validator_to_registry(state, pubkey, withdrawal_credentials, amount):\n    index = get_index_for_new_validator(state)\n    validator = get_validator_from_deposit(pubkey, withdrawal_credentials, amount)\n    if index == len(state.validators):\n        state.validators.append(validator)\n        state.balances.append(amount)\n    else:\n        state.validators[index] = validator\n        state.balances[index] = amount\n```\n\n## Things to know\n\n- Status is **Stagnant**: it has not been scheduled for any hard fork. It would be a backwards-incompatible consensus change requiring one.\n- Tools that treat a validator index as a permanent identity (explorers, staking dashboards, reward trackers) would need to key on public key plus time range instead.\n- An alternative fix, putting public keys instead of indices into `AttesterSlashing`, would avoid the attack but makes the largest consensus message several times bigger.\n- Related validator lifecycle changes: [EIP-4895](/eip-4895/) (withdrawals), [EIP-7002](/eip-7002/) (execution-layer exits), [EIP-6110](/eip-6110/) (on-chain deposits) and [EIP-7251](/eip-7251/) (higher max effective balance, which reduces validator count).\n"},"ja":{"lang":"ja","tldr":"停滞中のコンセンサスレイヤー提案。新しいバリデータが、とうに引き出し済みのバリデータのインデックスを再利用できるようにし、ビーコンステートのバリデータと残高のリストが際限なく増え続けないようにする。","tags":["consensus","beacon-chain","validators","state-growth"],"related":[4895,7002,6110,7251],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-6914/","markdown":"## 何を解決するのか\n\nビーコンチェーンはステート内に 2 つの並行するリスト、`validators` と `balances` を保持しています。新しい公開鍵のデポジットは常に新しいエントリを**追加**し、退出して全額引き出したバリデータもそのスロットを永遠に保持します。ステーカーが何年にもわたって出入りするうちに、残高がまったくないバリデータのエントリが多数あっても、両方のリストは際限なく増え続けます。\n\nリストが大きくなると、クライアントのメモリ使用量が増え、ステートルートの計算が遅くなり、バリデータセットのスキャンにも時間がかかります。EIP-6914 は単純な整理を提案します。安全になった時点で、役目を終えたバリデータのインデックスを新しいバリデータに与えるというものです。\n\n## 仕組み\n\n- 新しいデポジットが届くと、ステート遷移は、**全額引き出し済み**で、かつ**少なくとも `SAFE_EPOCHS_TO_REUSE_INDEX` エポックのあいだ引き出し可能（withdrawable）だった**バリデータインデックスを探します。\n- 見つかった場合、新しいバリデータのレコードと残高は、追加されるのではなくそのインデックスに上書きされます。\n- 詳細な定数や関数は、EIP 本文ではなく、EIP-6914 用の consensus-specs の feature フォルダにあります。\n- 実行レイヤーは影響を受けません。\n\n**なぜ待機期間があるのか。** スラッシングの証拠（`AttesterSlashing`）は、署名者を公開鍵ではなくバリデータの**インデックス**で特定します。インデックスを早く再利用しすぎると、ステート内の古い公開鍵が上書きされてしまいます。ステークの約 3 分の 1 を支配する攻撃者は、一部のバリデータを退出させ、そのインデックスが再利用されるのを待ち、それらのバリデータが退出しなかった別のチェーンを構築して、その鍵を二重署名された集約アテステーションに混ぜ込めます。正直なチェーンでは、それらのインデックスはもう別の鍵に対応しているため、スラッシングの証拠を検証できず、accountable safety が壊れます。\n\n`SAFE_EPOCHS_TO_REUSE_INDEX`（weak subjectivity period の最大値の 3 倍に設定）だけ待てば、そのようなアテステーションはすべて、accountable safety が成立しなければならない期間の外に出ます。\n\n## サンプルコード\n\nデポジット時のインデックス選択の簡略化した擬似コード（説明用。正確な関数は consensus-specs を参照）:\n\n```python\ndef is_reusable_validator(validator, balance, epoch) -\u003e bool:\n    return (\n        epoch \u003e validator.withdrawable_epoch + SAFE_EPOCHS_TO_REUSE_INDEX\n        and balance == 0\n    )\n\ndef get_index_for_new_validator(state) -\u003e int:\n    epoch = get_current_epoch(state)\n    for index, validator in enumerate(state.validators):\n        if is_reusable_validator(validator, state.balances[index], epoch):\n            return index\n    return len(state.validators)  # nothing reusable: append\n\ndef add_validator_to_registry(state, pubkey, withdrawal_credentials, amount):\n    index = get_index_for_new_validator(state)\n    validator = get_validator_from_deposit(pubkey, withdrawal_credentials, amount)\n    if index == len(state.validators):\n        state.validators.append(validator)\n        state.balances.append(amount)\n    else:\n        state.validators[index] = validator\n        state.balances[index] = amount\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** です。どのハードフォークにもスケジュールされていません。後方互換性のないコンセンサス変更であり、実現にはハードフォークが必要です。\n- バリデータインデックスを永続的な ID として扱うツール（エクスプローラー、ステーキングダッシュボード、報酬トラッカー）は、公開鍵と期間の組み合わせをキーにする必要が出てきます。\n- 代替案として、`AttesterSlashing` にインデックスではなく公開鍵を入れる方法があります。この攻撃は避けられますが、最大のコンセンサスメッセージが数倍に大きくなります。\n- バリデータのライフサイクルに関する関連の変更: [EIP-4895](/eip-4895/)（引き出し）、[EIP-7002](/eip-7002/)（実行レイヤーからの退出）、[EIP-6110](/eip-6110/)（オンチェーンのデポジット）、[EIP-7251](/eip-7251/)（有効残高の上限引き上げ。バリデータ数を減らす）。\n"},"ko":{"lang":"ko","tldr":"정체(Stagnant) 상태인 합의 계층 제안. 새 검증자가 오래전에 인출을 마친 검증자의 인덱스를 재사용할 수 있게 해, 비콘 상태의 검증자 및 잔액 리스트가 끝없이 커지지 않도록 한다.","tags":["consensus","beacon-chain","validators","state-growth"],"related":[4895,7002,6110,7251],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-6914/","markdown":"## 어떤 문제를 해결하나요?\n\n비콘 체인은 상태에 `validators`와 `balances`라는 두 개의 나란한 리스트를 유지합니다. 새 공개 키의 예치(deposit)는 항상 새 항목을 **추가**하고, 퇴출한 뒤 전액 인출한 검증자도 그 자리를 영원히 차지합니다. 스테이커들이 수년에 걸쳐 들어오고 나가면서, 잔액이 하나도 남지 않은 검증자의 항목이 많아도 두 리스트는 끝없이 커집니다.\n\n리스트가 커지면 클라이언트 메모리가 더 필요하고, 상태 루트 계산이 느려지며, 검증자 집합을 훑는 시간도 길어집니다. EIP-6914는 간단한 정리 방안을 제안합니다. 안전해진 시점에 수명이 끝난 검증자의 인덱스를 새 검증자에게 주자는 것입니다.\n\n## 어떻게 동작하나요?\n\n- 새 예치가 도착하면 상태 전이는 **전액 인출되었고** **최소 `SAFE_EPOCHS_TO_REUSE_INDEX` 에포크 동안 인출 가능(withdrawable) 상태였던** 검증자 인덱스를 찾습니다.\n- 그런 인덱스가 있으면 새 검증자의 레코드와 잔액이 추가되는 대신 그 인덱스를 덮어씁니다.\n- 자세한 상수와 함수는 EIP 본문이 아니라 EIP-6914용 consensus-specs feature 폴더에 있습니다.\n- 실행 계층은 영향을 받지 않습니다.\n\n**왜 대기 기간이 있나요?** 슬래싱 증거(`AttesterSlashing`)는 서명자를 공개 키가 아니라 검증자 **인덱스**로 식별합니다. 인덱스를 너무 일찍 재사용하면 상태에 있던 옛 공개 키가 덮어써집니다. 스테이크의 약 3분의 1을 가진 공격자는 일부 검증자를 퇴출시키고 그 인덱스가 재사용되기를 기다린 뒤, 해당 검증자들이 퇴출한 적 없는 대체 체인을 만들어 그 키를 이중 서명된 집계 증명(attestation)에 섞을 수 있습니다. 정직한 체인에서는 그 인덱스가 이제 다른 키에 대응하므로 슬래싱 증거를 검증할 수 없고, 이는 accountable safety를 깨뜨립니다.\n\n`SAFE_EPOCHS_TO_REUSE_INDEX`(최대 weak subjectivity period의 세 배로 설정)만큼 기다리면 그런 증명은 모두 accountable safety가 성립해야 하는 기간 밖에 놓입니다.\n\n## 샘플 코드\n\n예치 시 인덱스 선택을 단순화한 의사 코드(설명용이며 정확한 함수는 consensus-specs 참고):\n\n```python\ndef is_reusable_validator(validator, balance, epoch) -\u003e bool:\n    return (\n        epoch \u003e validator.withdrawable_epoch + SAFE_EPOCHS_TO_REUSE_INDEX\n        and balance == 0\n    )\n\ndef get_index_for_new_validator(state) -\u003e int:\n    epoch = get_current_epoch(state)\n    for index, validator in enumerate(state.validators):\n        if is_reusable_validator(validator, state.balances[index], epoch):\n            return index\n    return len(state.validators)  # nothing reusable: append\n\ndef add_validator_to_registry(state, pubkey, withdrawal_credentials, amount):\n    index = get_index_for_new_validator(state)\n    validator = get_validator_from_deposit(pubkey, withdrawal_credentials, amount)\n    if index == len(state.validators):\n        state.validators.append(validator)\n        state.balances.append(amount)\n    else:\n        state.validators[index] = validator\n        state.balances[index] = amount\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**입니다. 어떤 하드포크에도 일정이 잡혀 있지 않습니다. 하위 호환이 되지 않는 합의 변경이라 하드포크가 필요합니다.\n- 검증자 인덱스를 영구적인 ID로 취급하는 도구(익스플로러, 스테이킹 대시보드, 보상 추적기)는 공개 키와 기간 범위를 키로 사용하도록 바꿔야 합니다.\n- 대안으로 `AttesterSlashing`에 인덱스 대신 공개 키를 넣는 방법이 있습니다. 이 공격은 피할 수 있지만 가장 큰 합의 메시지가 몇 배로 커집니다.\n- 관련된 검증자 수명 주기 변경: [EIP-4895](/eip-4895/)(인출), [EIP-7002](/eip-7002/)(실행 계층에서의 퇴출), [EIP-6110](/eip-6110/)(온체인 예치), [EIP-7251](/eip-7251/)(최대 유효 잔액 상향, 검증자 수 감소).\n"},"zh":{"lang":"zh","tldr":"一项已停滞的共识层提案：允许新验证者复用早已提取完毕的验证者的索引，使信标链状态中的验证者列表和余额列表不再无限增长。","tags":["consensus","beacon-chain","validators","state-growth"],"related":[4895,7002,6110,7251],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-6914/","markdown":"## 它解决什么问题？\n\n信标链在状态中保存两个并行的列表：`validators` 和 `balances`。新公钥的存款总是会**追加**一个新条目；已经退出并完全提款的验证者仍会永远占着它的位置。随着质押者多年来不断进进出出，即使很多条目对应的验证者已经一无所有，这两个列表仍会无限增长。\n\n列表越大，客户端占用的内存越多，状态根的计算越慢，扫描验证者集合也越耗时。EIP-6914 提出了一个简单的清理办法：在安全的前提下，把已经\"死亡\"的验证者的索引交给新的验证者。\n\n## 它如何运作\n\n- 新的存款到达时，状态转换会寻找一个已**完全提款**、并且已经**可提款至少 `SAFE_EPOCHS_TO_REUSE_INDEX` 个 epoch** 的验证者索引。\n- 如果存在这样的索引，新验证者的记录和余额会覆盖该索引，而不是追加。\n- 详细的常量和函数位于 consensus-specs 中 EIP-6914 的 feature 文件夹，而不在 EIP 正文里。\n- 执行层不受影响。\n\n**为什么要有等待期？** 惩罚（slashing）证据（`AttesterSlashing`）是通过验证者**索引**而不是公钥来标识签名者的。如果索引复用得太早，状态中的旧公钥就会被覆盖。控制约三分之一质押量的攻击者可以让一些验证者退出，等它们的索引被复用，再构造一条这些验证者从未退出的替代链，并把它们的密钥混入双重签名的聚合证明中。在诚实链上，这些索引现在对应的是不同的密钥，因此惩罚证据无法被验证，这就破坏了 accountable safety。\n\n等待 `SAFE_EPOCHS_TO_REUSE_INDEX`（设为最大弱主观性周期的三倍）意味着任何这样的证明都落在了必须满足 accountable safety 的时间窗口之外。\n\n## 示例代码\n\n存款时选择索引的简化伪代码（仅作演示；确切的函数请参见 consensus-specs）：\n\n```python\ndef is_reusable_validator(validator, balance, epoch) -\u003e bool:\n    return (\n        epoch \u003e validator.withdrawable_epoch + SAFE_EPOCHS_TO_REUSE_INDEX\n        and balance == 0\n    )\n\ndef get_index_for_new_validator(state) -\u003e int:\n    epoch = get_current_epoch(state)\n    for index, validator in enumerate(state.validators):\n        if is_reusable_validator(validator, state.balances[index], epoch):\n            return index\n    return len(state.validators)  # nothing reusable: append\n\ndef add_validator_to_registry(state, pubkey, withdrawal_credentials, amount):\n    index = get_index_for_new_validator(state)\n    validator = get_validator_from_deposit(pubkey, withdrawal_credentials, amount)\n    if index == len(state.validators):\n        state.validators.append(validator)\n        state.balances.append(amount)\n    else:\n        state.validators[index] = validator\n        state.balances[index] = amount\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**：它没有被安排进任何硬分叉。这是一项向后不兼容的共识变更，需要通过硬分叉才能实施。\n- 把验证者索引当作永久身份的工具（浏览器、质押仪表盘、收益追踪器）需要改为以公钥加时间范围作为键。\n- 另一种修复方式是在 `AttesterSlashing` 中放公钥而不是索引，这样可以避免该攻击，但会让最大的共识消息变大数倍。\n- 相关的验证者生命周期变更：[EIP-4895](/eip-4895/)（提款）、[EIP-7002](/eip-7002/)（执行层退出）、[EIP-6110](/eip-6110/)（链上存款）和 [EIP-7251](/eip-7251/)（提高最大有效余额，从而减少验证者数量）。\n"}}}
