{"eip":8321,"title":"Hash-Chain RANDAO","description":"Replace the BLS-signature RANDAO reveal with a post-quantum hash-chain commit-reveal scheme","authors":["Kevaundray Wedderburn (@kevaundray)","Benedikt Wagner (@benedikt-wagner)","Tom Wambsgans (@TomWambsgans)","Justin Drake (@JustinDrake)","Thomas Coratger (@tcoratger)"],"status":"Draft","type":"Standards Track","category":"Core","created":"2026-07-05","requires":[7916],"discussionsTo":"https://ethereum-magicians.org/t/eip-8321-hash-chain-randao/28942","repo":"EIPs","label":"EIP-8321","officialUrl":"https://eips.ethereum.org/EIPS/eip-8321","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8321.md","url":"https://eips.huatuo.xyz/eip-8321/","tldr":{"en":"Replaces the BLS-signature RANDAO reveal with a hash-chain commit-reveal, so the beacon chain's randomness no longer depends on a signature scheme that quantum computers could break.","ja":"BLS 署名による RANDAO reveal を、ハッシュチェーンによる commit-reveal に置き換え、ビーコンチェーンの乱数が量子コンピュータに破られうる署名方式に依存しないようにする。","ko":"BLS 서명 기반 RANDAO reveal을 해시 체인 commit-reveal로 바꿔, 비콘 체인의 난수가 양자 컴퓨터에 깨질 수 있는 서명 방식에 더는 의존하지 않게 한다.","zh":"用哈希链的承诺-揭示取代基于 BLS 签名的 RANDAO reveal，使信标链的随机性不再依赖于量子计算机可能破解的签名方案。"},"tags":["consensus","randomness","randao","post-quantum","validators"],"explainers":{"en":{"lang":"en","tldr":"Replaces the BLS-signature RANDAO reveal with a hash-chain commit-reveal, so the beacon chain's randomness no longer depends on a signature scheme that quantum computers could break.","tags":["consensus","randomness","randao","post-quantum","validators"],"related":[4399,7916,8292,8390],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-8321/","markdown":"## What problem does it solve?\n\nEach beacon block mixes the proposer's **RANDAO reveal** into a shared random value that later picks proposers and committees (and that the EVM exposes as `PREVRANDAO`, see [EIP-4399](/eip-4399/)). Today the reveal is a BLS signature over the epoch number. Because a BLS signature is **unique** for a given key and message, a proposer cannot grind for a better value; it can only reveal or withhold.\n\nBLS is not quantum-safe. With a quantum computer, an attacker could recover a validator's key and compute all its future reveals, predicting the proposer schedule far ahead and biasing randomness more effectively. Simply swapping to a post-quantum signature does not help: the planned hash-based scheme includes a salt, so signatures are not unique and could be ground.\n\nEIP-8321 removes the signature from RANDAO altogether and uses a hash chain, which relies only on collision and preimage resistance.\n\n## How it works\n\n1. **Build a chain off-chain.** A validator picks a random 32-byte secret `c_0` and computes `c_i = blake3(\"HASH_CHAIN_RANDAO\" || c_{i-1})` up to `c_n`. At least 2^16 links (~2 MB to store) is recommended, enough for centuries of proposals.\n2. **Register once.** The validator submits a BLS-signed `RandaoCommitmentRegistration` with `c_n`. Up to 128 per block are allowed; the commitment activates 3 epochs after inclusion so it cannot be timed against a known duty. A commitment can never be changed; a validator that loses its chain must exit and re-enter.\n3. **Reveal one link per block.** When proposing, the validator publishes the previous link as `hash_chain_reveal`. The chain checks `blake3(DST || reveal) == stored_commitment`, mixes it in with `mix = blake3(mix || reveal)`, and stores the reveal as the new commitment.\n\nA hash accumulator (rather than today's XOR) is used because commitments are copyable: with XOR, a validator could register a copy of someone else's commitment and cancel their contribution. Validators that never register keep using the legacy BLS reveal; that path is meant to be removed in a later post-quantum fork, which would set the initial commitment at deposit time.\n\n## Sample code\n\nGenerating a chain and the per-block check (Python with the `blake3` package):\n\n```python\nimport os\nfrom blake3 import blake3\n\nDST = b\"HASH_CHAIN_RANDAO\"\n\ndef make_chain(n: int = 2**16) -\u003e list[bytes]:\n    while True:\n        chain = [os.urandom(32)]\n        for _ in range(n):\n            chain.append(blake3(DST + chain[-1]).digest())\n        if all(c != bytes(32) for c in chain):   # zero word is forbidden\n            return chain\n\nchain = make_chain()\ncommitment = chain[-1]               # c_n: register this once\n\n# Proposal k reveals chain[n-k]; the protocol verifies and advances:\ndef process_reveal(stored: bytes, reveal: bytes, mix: bytes) -\u003e tuple[bytes, bytes]:\n    assert reveal != bytes(32)\n    assert blake3(DST + reveal).digest() == stored\n    return reveal, blake3(mix + reveal).digest()   # (new commitment, new mix)\n```\n\n## Things to know\n\n- **Status: Draft.** The fork is not yet scheduled.\n- **Bias is unchanged, not removed.** A proposer can still withhold its block, the same one-bit lever as today.\n- **Mistakes are permanent.** A wrong or lost commitment means the validator cannot propose on the hash-chain path until it exits and re-enters. Clients should walk the full chain before registering. Funds and slashing risk are unaffected.\n- Treat the chain secret like a signing key, but do not derive it from the signing key: walking a chain to the end eventually reveals its seed.\n- A stolen chain secret lets an attacker predict, but not choose, that validator's contributions.\n- This is only one piece of post-quantum consensus: block signatures and the registration signature still use BLS. See also [EIP-8292](/eip-8292/) for post-quantum attestation aggregation.\n"},"ja":{"lang":"ja","tldr":"BLS 署名による RANDAO reveal を、ハッシュチェーンによる commit-reveal に置き換え、ビーコンチェーンの乱数が量子コンピュータに破られうる署名方式に依存しないようにする。","tags":["consensus","randomness","randao","post-quantum","validators"],"related":[4399,7916,8292,8390],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-8321/","markdown":"## 何を解決するのか\n\n各ビーコンブロックは、提案者の **RANDAO reveal** を共有の乱数値に混ぜ込み、その値が後で提案者や委員会を選びます（EVM は `PREVRANDAO` として公開しています。[EIP-4399](/eip-4399/) を参照）。現在、reveal はエポック番号に対する BLS 署名です。BLS 署名は、ある鍵とメッセージに対して**一意**なので、提案者はより良い値を求めてグラインドすることはできず、公開するか差し控えるかしかできません。\n\nBLS は量子安全ではありません。量子コンピュータがあれば、攻撃者はバリデータの鍵を復元して、その将来のすべての reveal を計算でき、提案者のスケジュールをはるか先まで予測し、より効果的に乱数にバイアスをかけられます。単にポスト量子署名に切り替えても解決しません。計画されているハッシュベースの方式にはソルトが含まれるため、署名は一意ではなく、グラインドされうるからです。\n\nEIP-8321 は、RANDAO から署名を完全に取り除き、衝突耐性と原像耐性だけに依存するハッシュチェーンを使います。\n\n## 仕組み\n\n1. **オフチェーンでチェーンを作る。** バリデータは、ランダムな 32 バイトの秘密 `c_0` を選び、`c_n` まで `c_i = blake3(\"HASH_CHAIN_RANDAO\" || c_{i-1})` を計算します。少なくとも 2^16 個のリンク（保存に約 2 MB）が推奨され、何世紀分もの提案に十分です。\n2. **一度だけ登録。** バリデータは、`c_n` を含む BLS 署名付きの `RandaoCommitmentRegistration` を送信します。ブロックあたり最大 128 件まで許可されます。コミットメントは取り込みの 3 エポック後に有効になるため、既知の職務に合わせてタイミングを計ることはできません。コミットメントは決して変更できません。チェーンを失ったバリデータは、退出して再参加しなければなりません。\n3. **ブロックごとに 1 つのリンクを公開。** 提案するとき、バリデータは前のリンクを `hash_chain_reveal` として公開します。チェーンは `blake3(DST || reveal) == stored_commitment` を確認し、`mix = blake3(mix || reveal)` で混ぜ込み、reveal を新しいコミットメントとして保存します。\n\n（現在の XOR ではなく）ハッシュアキュムレーターを使うのは、コミットメントがコピー可能だからです。XOR だと、バリデータはほかの誰かのコミットメントのコピーを登録して、その人の寄与を打ち消せてしまいます。一度も登録しないバリデータは、従来の BLS reveal を使い続けます。その経路は、後のポスト量子フォークで削除される予定で、そのときは初期コミットメントを deposit 時に設定します。\n\n## サンプルコード\n\nチェーンの生成とブロックごとの検証（`blake3` パッケージを使った Python）:\n\n```python\nimport os\nfrom blake3 import blake3\n\nDST = b\"HASH_CHAIN_RANDAO\"\n\ndef make_chain(n: int = 2**16) -\u003e list[bytes]:\n    while True:\n        chain = [os.urandom(32)]\n        for _ in range(n):\n            chain.append(blake3(DST + chain[-1]).digest())\n        if all(c != bytes(32) for c in chain):   # zero word is forbidden\n            return chain\n\nchain = make_chain()\ncommitment = chain[-1]               # c_n: register this once\n\n# Proposal k reveals chain[n-k]; the protocol verifies and advances:\ndef process_reveal(stored: bytes, reveal: bytes, mix: bytes) -\u003e tuple[bytes, bytes]:\n    assert reveal != bytes(32)\n    assert blake3(DST + reveal).digest() == stored\n    return reveal, blake3(mix + reveal).digest()   # (new commitment, new mix)\n```\n\n## 知っておくべきこと\n\n- **ステータス: Draft。** フォークはまだ予定されていません。\n- **バイアスは除去されず、変わらないままです。** 提案者は今も自分のブロックを差し控えることができ、現在と同じ 1 ビットのてこです。\n- **間違いは永続します。** コミットメントが誤っていたり失われたりすると、バリデータは退出して再参加するまで、ハッシュチェーンの経路で提案できません。クライアントは登録前にチェーン全体をたどるべきです。資金とスラッシングのリスクには影響しません。\n- チェーンの秘密は署名鍵のように扱ってください。ただし署名鍵から導出してはいけません。チェーンを最後までたどると、最終的にそのシードが明らかになります。\n- チェーンの秘密が盗まれると、攻撃者はそのバリデータの寄与を予測できますが、選ぶことはできません。\n- これはポスト量子コンセンサスの一部にすぎません。ブロック署名と登録の署名は依然として BLS を使います。ポスト量子の attestation 集約については [EIP-8292](/eip-8292/) も参照してください。\n"},"ko":{"lang":"ko","tldr":"BLS 서명 기반 RANDAO reveal을 해시 체인 commit-reveal로 바꿔, 비콘 체인의 난수가 양자 컴퓨터에 깨질 수 있는 서명 방식에 더는 의존하지 않게 한다.","tags":["consensus","randomness","randao","post-quantum","validators"],"related":[4399,7916,8292,8390],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-8321/","markdown":"## 어떤 문제를 해결하나요?\n\n각 비콘 블록은 제안자의 **RANDAO reveal**을 공유 난수 값에 섞고, 이 값이 나중에 제안자와 위원회를 고릅니다(EVM은 이를 `PREVRANDAO`로 노출합니다. [EIP-4399](/eip-4399/) 참고). 지금 reveal은 epoch 번호에 대한 BLS 서명입니다. BLS 서명은 주어진 키와 메시지에 대해 **고유**하기 때문에 제안자는 더 나은 값을 찾아 그라인딩할 수 없고, 공개하거나 보류할 수만 있습니다.\n\nBLS는 양자 안전하지 않습니다. 양자 컴퓨터가 있으면 공격자는 검증자의 키를 복구해 앞으로의 모든 reveal을 계산하고, 제안자 일정을 훨씬 앞서 예측하며, 난수에 더 효과적으로 편향을 줄 수 있습니다. 단순히 양자 내성 서명으로 바꾸는 것도 도움이 되지 않습니다. 계획된 해시 기반 방식에는 salt가 있어서 서명이 고유하지 않고 그라인딩될 수 있기 때문입니다.\n\nEIP-8321은 RANDAO에서 서명을 아예 없애고 충돌 저항성과 원상 저항성에만 의존하는 해시 체인을 사용합니다.\n\n## 어떻게 동작하나요?\n\n1. **오프체인에서 체인 만들기.** 검증자는 무작위 32바이트 비밀 `c_0`을 고르고 `c_n`까지 `c_i = blake3(\"HASH_CHAIN_RANDAO\" || c_{i-1})`을 계산합니다. 최소 2^16개 링크(저장에 약 2 MB)를 권장하며, 수 세기 분량의 제안에 충분합니다.\n2. **한 번만 등록.** 검증자는 `c_n`을 담은 BLS 서명된 `RandaoCommitmentRegistration`을 제출합니다. 블록당 최대 128개까지 허용됩니다. 커밋먼트는 포함된 지 3 epoch 후에 활성화되므로 알려진 임무에 맞춰 타이밍을 잴 수 없습니다. 커밋먼트는 절대 바꿀 수 없으며, 체인을 잃은 검증자는 퇴출했다가 다시 들어와야 합니다.\n3. **블록마다 링크 하나를 공개.** 제안할 때 검증자는 이전 링크를 `hash_chain_reveal`로 게시합니다. 체인은 `blake3(DST || reveal) == stored_commitment`를 확인하고, `mix = blake3(mix || reveal)`로 섞고, reveal을 새 커밋먼트로 저장합니다.\n\n(지금의 XOR 대신) 해시 누산기를 쓰는 이유는 커밋먼트를 복사할 수 있기 때문입니다. XOR을 쓰면 검증자가 다른 사람의 커밋먼트 사본을 등록해 그 사람의 기여를 상쇄할 수 있습니다. 등록하지 않는 검증자는 기존 BLS reveal을 계속 사용하며, 그 경로는 이후 양자 내성 포크에서 제거될 예정이고 그때는 예치 시점에 초기 커밋먼트를 설정하게 됩니다.\n\n## 샘플 코드\n\n체인 생성과 블록별 검사(`blake3` 패키지를 쓰는 Python):\n\n```python\nimport os\nfrom blake3 import blake3\n\nDST = b\"HASH_CHAIN_RANDAO\"\n\ndef make_chain(n: int = 2**16) -\u003e list[bytes]:\n    while True:\n        chain = [os.urandom(32)]\n        for _ in range(n):\n            chain.append(blake3(DST + chain[-1]).digest())\n        if all(c != bytes(32) for c in chain):   # zero word is forbidden\n            return chain\n\nchain = make_chain()\ncommitment = chain[-1]               # c_n: register this once\n\n# Proposal k reveals chain[n-k]; the protocol verifies and advances:\ndef process_reveal(stored: bytes, reveal: bytes, mix: bytes) -\u003e tuple[bytes, bytes]:\n    assert reveal != bytes(32)\n    assert blake3(DST + reveal).digest() == stored\n    return reveal, blake3(mix + reveal).digest()   # (new commitment, new mix)\n```\n\n## 알아둘 점\n\n- **상태: Draft.** 포크는 아직 일정이 잡히지 않았습니다.\n- **편향은 사라지지 않고 그대로입니다.** 제안자는 여전히 자기 블록을 보류할 수 있으며, 지금과 같은 1비트짜리 지렛대입니다.\n- **실수는 영구적입니다.** 커밋먼트가 틀렸거나 분실되면 검증자는 퇴출했다가 다시 들어올 때까지 해시 체인 경로로 제안할 수 없습니다. 클라이언트는 등록 전에 체인 전체를 끝까지 걸어 봐야 합니다. 자금과 슬래싱 위험에는 영향이 없습니다.\n- 체인 비밀을 서명 키처럼 다루되, 서명 키에서 파생해서는 안 됩니다. 체인을 끝까지 따라가면 결국 시드가 드러납니다.\n- 체인 비밀이 도난당하면 공격자는 그 검증자의 기여를 예측할 수는 있지만 고를 수는 없습니다.\n- 이것은 양자 내성 합의의 일부일 뿐입니다. 블록 서명과 등록 서명은 여전히 BLS를 사용합니다. 양자 내성 attestation 집계는 [EIP-8292](/eip-8292/)도 참고하세요.\n"},"zh":{"lang":"zh","tldr":"用哈希链的承诺-揭示取代基于 BLS 签名的 RANDAO reveal，使信标链的随机性不再依赖于量子计算机可能破解的签名方案。","tags":["consensus","randomness","randao","post-quantum","validators"],"related":[4399,7916,8292,8390],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-8321/","markdown":"## 它解决什么问题？\n\n每个信标区块都会把提议者的 **RANDAO reveal** 混入一个共享的随机值，该值之后用来选出提议者和委员会（EVM 把它暴露为 `PREVRANDAO`，参见 [EIP-4399](/eip-4399/)）。目前，reveal 是对 epoch 编号的 BLS 签名。由于 BLS 签名对给定的密钥和消息是**唯一**的，提议者无法通过\"磨\"（grind）来获得更好的值；它只能选择揭示或扣留。\n\nBLS 不是量子安全的。有了量子计算机，攻击者可以恢复验证者的密钥，并算出其所有未来的 reveal，从而提前很久预测提议者调度，更有效地对随机性施加偏置。单纯换成后量子签名也没有用：计划中的基于哈希的方案包含 salt，所以签名不是唯一的，可能被\"磨\"。\n\nEIP-8321 彻底去掉了 RANDAO 中的签名，改用哈希链，它只依赖抗碰撞性和抗原像性。\n\n## 它如何运作\n\n1. **在链下构建链。** 验证者选择一个随机的 32 字节秘密 `c_0`，并计算 `c_i = blake3(\"HASH_CHAIN_RANDAO\" || c_{i-1})`，直到 `c_n`。建议至少 2^16 个环节（存储约 2 MB），足够支撑几个世纪的提议。\n2. **注册一次。** 验证者提交一个带 BLS 签名的 `RandaoCommitmentRegistration`，其中包含 `c_n`。每个区块最多允许 128 个；该承诺在被打包 3 个 epoch 之后才激活，因此无法针对已知的职责卡时间。承诺永远不能更改；丢失了链的验证者必须退出后重新加入。\n3. **每个区块揭示一个环节。** 提议区块时，验证者把前一个环节作为 `hash_chain_reveal` 发布。链检查 `blake3(DST || reveal) == stored_commitment`，用 `mix = blake3(mix || reveal)` 将其混入，并把 reveal 存为新的承诺。\n\n之所以使用哈希累加器（而不是现在的 XOR），是因为承诺是可以被复制的：如果用 XOR，验证者可以注册别人承诺的副本，从而抵消对方的贡献。从未注册的验证者继续使用旧的 BLS reveal；该路径计划在后续的后量子分叉中移除，届时将在存款时设置初始承诺。\n\n## 示例代码\n\n生成链以及每个区块的检查（使用 `blake3` 包的 Python）：\n\n```python\nimport os\nfrom blake3 import blake3\n\nDST = b\"HASH_CHAIN_RANDAO\"\n\ndef make_chain(n: int = 2**16) -\u003e list[bytes]:\n    while True:\n        chain = [os.urandom(32)]\n        for _ in range(n):\n            chain.append(blake3(DST + chain[-1]).digest())\n        if all(c != bytes(32) for c in chain):   # zero word is forbidden\n            return chain\n\nchain = make_chain()\ncommitment = chain[-1]               # c_n: register this once\n\n# Proposal k reveals chain[n-k]; the protocol verifies and advances:\ndef process_reveal(stored: bytes, reveal: bytes, mix: bytes) -\u003e tuple[bytes, bytes]:\n    assert reveal != bytes(32)\n    assert blake3(DST + reveal).digest() == stored\n    return reveal, blake3(mix + reveal).digest()   # (new commitment, new mix)\n```\n\n## 需要注意\n\n- **状态：Draft。** 该分叉尚未排期。\n- **偏置没有被消除，只是保持不变。** 提议者仍然可以扣留自己的区块，这与现在一样是一个一比特的杠杆。\n- **错误是永久的。** 承诺错误或丢失，意味着验证者在退出并重新加入之前，无法走哈希链路径提议区块。客户端应在注册之前把整条链走一遍。资金和惩罚（slashing）风险不受影响。\n- 把链的秘密当作签名密钥来对待，但不要由签名密钥派生它：把链一路走到底，最终会暴露它的种子。\n- 链的秘密被盗，攻击者只能预测、却无法选择该验证者的贡献。\n- 这只是后量子共识的一部分：区块签名和注册签名仍然使用 BLS。关于后量子 attestation 聚合，另请参阅 [EIP-8292](/eip-8292/)。\n"}}}
