{"eip":7998,"title":"Turn `randao_reveal` into a VRF","description":"Transforms Ethereum’s `randao_reveal` into a per-slot BLS-based VRF by signing the previous epoch’s mix and current slot.","authors":["Alberto La Rocca (@71104)","Aryaethn (@aryaethn)"],"status":"Draft","type":"Standards Track","category":"Core","created":"2025-08-03","discussionsTo":"https://ethereum-magicians.org/t/eip-7998-turn-randao-reveal-into-a-vrf/24999","repo":"EIPs","label":"EIP-7998","officialUrl":"https://eips.ethereum.org/EIPS/eip-7998","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7998.md","url":"https://eips.huatuo.xyz/eip-7998/","tldr":{"en":"Makes the block proposer's `randao_reveal` sign the previous epoch's RANDAO mix and the slot instead of just the epoch number, turning it into a per-slot BLS VRF that nobody can precompute.","ja":"ブロック提案者の `randao_reveal` が、エポック番号だけでなく前エポックの RANDAO mix とスロットに署名するようにし、誰も事前計算できないスロットごとの BLS VRF にする。","ko":"블록 제안자의 `randao_reveal`이 epoch 번호 대신 이전 epoch의 RANDAO mix와 slot에 서명하도록 바꿔, 아무도 미리 계산할 수 없는 슬롯별 BLS VRF로 만든다.","zh":"让区块提议者的 `randao_reveal` 签署上一个 epoch 的 RANDAO mix 和 slot，而不再只签 epoch 编号，使其成为任何人都无法预先计算的、按 slot 生成的 BLS VRF。"},"tags":["consensus","randomness","randao","vrf","bls"],"explainers":{"en":{"lang":"en","tldr":"Makes the block proposer's `randao_reveal` sign the previous epoch's RANDAO mix and the slot instead of just the epoch number, turning it into a per-slot BLS VRF that nobody can precompute.","tags":["consensus","randomness","randao","vrf","bls"],"related":[7956],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7998/","markdown":"## What problem does it solve?\n\nEach beacon block contains a `randao_reveal`: the proposer's BLS signature over the current **epoch number**. It is hashed into the RANDAO mix that the protocol uses as on-chain randomness (and that contracts read via `PREVRANDAO`).\n\nBecause the signed message is just the epoch number, a validator can compute all of its future reveals in advance. That makes the reveal useless as a fresh random value per proposer and blocks designs that need a private, unpredictable value from each proposer, such as Single Secret Leader Election (secret proposer election), which the authors say would reduce MEV and remove the known RANDAO bias attack.\n\n## How it works\n\nAfter the fork, the proposer signs a new SSZ container instead of the epoch:\n\n```python\nclass RandaoRevealSeed(Container):\n    previous_mix: Bytes32  # final RANDAO mix of the previous epoch\n    slot: Slot             # current slot\n```\n\n- `previous_mix` is not known until the previous epoch ends, so reveals cannot be computed for future epochs, not even by the validator itself.\n- `slot` makes every reveal unique, even when a validator proposes several times in one epoch.\n\nVerification in `process_randao` stays a single `bls.Verify` against the proposer's public key, using the same `DOMAIN_RANDAO`. The reveal is still mixed into the RANDAO mix exactly as before. A BLS signature on a message is deterministic and verifiable, so it acts as a VRF (secure under the Computational Diffie-Hellman assumption) without a separate proof.\n\nThe authors chose the *previous* epoch's mix rather than the latest one, because using the latest mix would create fork ambiguity if the reveal is later used for SSLE.\n\n## Sample code\n\nThe modified `process_randao` (consensus-spec Python):\n\n```python\ndef process_randao(state: BeaconState, body: BeaconBlockBody) -\u003e None:\n    epoch = get_current_epoch(state)\n    proposer = state.validators[get_beacon_proposer_index(state)]\n    if epoch \u003c FORK_EPOCH:\n        signing_root = compute_signing_root(epoch, get_domain(state, DOMAIN_RANDAO))\n    else:\n        seed = RandaoRevealSeed(\n            previous_mix=get_randao_mix(state, get_previous_epoch(state)),\n            slot=state.slot,\n        )\n        signing_root = compute_signing_root(seed, get_domain(state, DOMAIN_RANDAO))\n    assert bls.Verify(proposer.pubkey, signing_root, body.randao_reveal)\n\n    mix = xor(get_randao_mix(state, epoch), hash(body.randao_reveal))\n    state.randao_mixes[epoch % EPOCHS_PER_HISTORICAL_VECTOR] = mix\n```\n\n## Things to know\n\n- **Status: Draft.** It is a consensus-layer hard-fork change; blocks after the fork that sign the old message are invalid.\n- Validator clients and remote signers must be updated to sign `RandaoRevealSeed` instead of the epoch number.\n- Within the current epoch, the reveal is still predictable to the proposer itself; the slot field only matters once secret leader election or [EIP-7956](/eip-7956/) builds on it.\n- The reveal has no grindable inputs, but this proposal does not by itself remove the existing \"last revealer\" bias of RANDAO; that requires the follow-up designs it enables.\n"},"ja":{"lang":"ja","tldr":"ブロック提案者の `randao_reveal` が、エポック番号だけでなく前エポックの RANDAO mix とスロットに署名するようにし、誰も事前計算できないスロットごとの BLS VRF にする。","tags":["consensus","randomness","randao","vrf","bls"],"related":[7956],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7998/","markdown":"## 何を解決するのか\n\n各ビーコンブロックには `randao_reveal`、つまり現在の**エポック番号**に対する提案者の BLS 署名が含まれています。これはプロトコルがオンチェーンの乱数として使う RANDAO mix にハッシュとして混ぜられます（コントラクトは `PREVRANDAO` で読み取ります）。\n\n署名対象のメッセージがエポック番号だけなので、バリデータは将来のすべての reveal を事前に計算できます。そのため reveal は提案者ごとの新鮮な乱数として役に立たず、各提案者から非公開で予測不能な値を必要とする設計の妨げになります。例えば Single Secret Leader Election（提案者の秘密選出）がそうで、著者らは、これが MEV を減らし、既知の RANDAO バイアス攻撃を除去できるとしています。\n\n## 仕組み\n\nフォーク後、提案者はエポックの代わりに新しい SSZ コンテナに署名します。\n\n```python\nclass RandaoRevealSeed(Container):\n    previous_mix: Bytes32  # final RANDAO mix of the previous epoch\n    slot: Slot             # current slot\n```\n\n- `previous_mix` は前のエポックが終わるまで分からないため、将来のエポックの reveal は、バリデータ自身でも計算できません。\n- `slot` により、1 つのエポックで同じバリデータが複数回提案する場合でも、すべての reveal が一意になります。\n\n`process_randao` での検証は、同じ `DOMAIN_RANDAO` を使い、提案者の公開鍵に対する 1 回の `bls.Verify` のままです。reveal はこれまでとまったく同じ方法で RANDAO mix に混ぜられます。メッセージに対する BLS 署名は決定的で検証可能なので、別の証明なしに VRF として機能します（Computational Diffie-Hellman 仮定の下で安全）。\n\n著者らが最新の mix ではなく*前*のエポックの mix を選んだのは、最新の mix を使うと、reveal を後で SSLE に使う場合にフォークの曖昧さが生じるためです。\n\n## サンプルコード\n\n変更後の `process_randao`（consensus-spec の Python）:\n\n```python\ndef process_randao(state: BeaconState, body: BeaconBlockBody) -\u003e None:\n    epoch = get_current_epoch(state)\n    proposer = state.validators[get_beacon_proposer_index(state)]\n    if epoch \u003c FORK_EPOCH:\n        signing_root = compute_signing_root(epoch, get_domain(state, DOMAIN_RANDAO))\n    else:\n        seed = RandaoRevealSeed(\n            previous_mix=get_randao_mix(state, get_previous_epoch(state)),\n            slot=state.slot,\n        )\n        signing_root = compute_signing_root(seed, get_domain(state, DOMAIN_RANDAO))\n    assert bls.Verify(proposer.pubkey, signing_root, body.randao_reveal)\n\n    mix = xor(get_randao_mix(state, epoch), hash(body.randao_reveal))\n    state.randao_mixes[epoch % EPOCHS_PER_HISTORICAL_VECTOR] = mix\n```\n\n## 知っておくべきこと\n\n- **ステータス: Draft。** コンセンサスレイヤーのハードフォークによる変更です。フォーク後に旧メッセージに署名したブロックは無効になります。\n- バリデータクライアントとリモート署名者は、エポック番号の代わりに `RandaoRevealSeed` に署名するよう更新する必要があります。\n- 現在のエポック内では、reveal は提案者自身にはまだ予測可能です。slot フィールドが意味を持つのは、秘密のリーダー選出や [EIP-7956](/eip-7956/) がこれを土台にしたときです。\n- reveal にはグラインドできる入力はありませんが、この提案だけでは RANDAO に既にある「最後の reveal 者」バイアスは除去されません。それには、この提案が可能にする後続の設計が必要です。\n"},"ko":{"lang":"ko","tldr":"블록 제안자의 `randao_reveal`이 epoch 번호 대신 이전 epoch의 RANDAO mix와 slot에 서명하도록 바꿔, 아무도 미리 계산할 수 없는 슬롯별 BLS VRF로 만든다.","tags":["consensus","randomness","randao","vrf","bls"],"related":[7956],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7998/","markdown":"## 어떤 문제를 해결하나요?\n\n각 비콘 블록에는 `randao_reveal`, 즉 현재 **epoch 번호**에 대한 제안자의 BLS 서명이 들어 있습니다. 이 값은 프로토콜이 온체인 난수로 사용하는 RANDAO mix에 해시로 섞입니다(컨트랙트는 `PREVRANDAO`로 읽습니다).\n\n서명하는 메시지가 epoch 번호뿐이기 때문에 검증자는 앞으로의 reveal을 모두 미리 계산할 수 있습니다. 그래서 reveal은 제안자별로 새로운 난수 값으로 쓸 수 없고, 각 제안자로부터 비공개이고 예측할 수 없는 값을 필요로 하는 설계를 막습니다. 예를 들어 Single Secret Leader Election(제안자 비밀 선출)이 그렇고, 저자들은 이것이 MEV를 줄이고 알려진 RANDAO 편향 공격을 없앨 것이라고 말합니다.\n\n## 어떻게 동작하나요?\n\n포크 이후 제안자는 epoch 대신 새 SSZ 컨테이너에 서명합니다.\n\n```python\nclass RandaoRevealSeed(Container):\n    previous_mix: Bytes32  # final RANDAO mix of the previous epoch\n    slot: Slot             # current slot\n```\n\n- `previous_mix`는 이전 epoch가 끝나야 알 수 있으므로, 미래 epoch의 reveal은 검증자 본인조차 계산할 수 없습니다.\n- `slot` 덕분에 한 epoch에서 같은 검증자가 여러 번 제안하더라도 모든 reveal이 고유해집니다.\n\n`process_randao`의 검증은 같은 `DOMAIN_RANDAO`를 사용해 제안자의 공개키에 대해 `bls.Verify`를 한 번 호출하는 것으로 그대로입니다. reveal은 이전과 똑같이 RANDAO mix에 섞입니다. 메시지에 대한 BLS 서명은 결정적이고 검증 가능하므로, 별도의 증명 없이 VRF로 동작합니다(Computational Diffie-Hellman 가정 하에서 안전).\n\n저자들이 최신 mix가 아니라 *이전* epoch의 mix를 고른 것은, 나중에 reveal을 SSLE에 쓸 경우 최신 mix를 사용하면 포크 모호성이 생기기 때문입니다.\n\n## 샘플 코드\n\n수정된 `process_randao`(consensus-spec Python):\n\n```python\ndef process_randao(state: BeaconState, body: BeaconBlockBody) -\u003e None:\n    epoch = get_current_epoch(state)\n    proposer = state.validators[get_beacon_proposer_index(state)]\n    if epoch \u003c FORK_EPOCH:\n        signing_root = compute_signing_root(epoch, get_domain(state, DOMAIN_RANDAO))\n    else:\n        seed = RandaoRevealSeed(\n            previous_mix=get_randao_mix(state, get_previous_epoch(state)),\n            slot=state.slot,\n        )\n        signing_root = compute_signing_root(seed, get_domain(state, DOMAIN_RANDAO))\n    assert bls.Verify(proposer.pubkey, signing_root, body.randao_reveal)\n\n    mix = xor(get_randao_mix(state, epoch), hash(body.randao_reveal))\n    state.randao_mixes[epoch % EPOCHS_PER_HISTORICAL_VECTOR] = mix\n```\n\n## 알아둘 점\n\n- **상태: Draft.** 합의 계층의 하드포크 변경입니다. 포크 이후 이전 메시지에 서명한 블록은 유효하지 않습니다.\n- 검증자 클라이언트와 원격 서명자는 epoch 번호 대신 `RandaoRevealSeed`에 서명하도록 업데이트해야 합니다.\n- 현재 epoch 안에서는 reveal이 제안자 본인에게는 여전히 예측 가능합니다. slot 필드가 의미를 갖는 것은 비밀 리더 선출이나 [EIP-7956](/eip-7956/)이 이를 기반으로 할 때입니다.\n- reveal에는 그라인딩할 수 있는 입력이 없지만, 이 제안만으로는 RANDAO에 이미 있는 \"마지막 reveal 제출자\" 편향이 사라지지 않습니다. 그러려면 이 제안이 가능하게 하는 후속 설계가 필요합니다.\n"},"zh":{"lang":"zh","tldr":"让区块提议者的 `randao_reveal` 签署上一个 epoch 的 RANDAO mix 和 slot，而不再只签 epoch 编号，使其成为任何人都无法预先计算的、按 slot 生成的 BLS VRF。","tags":["consensus","randomness","randao","vrf","bls"],"related":[7956],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7998/","markdown":"## 它解决什么问题？\n\n每个信标区块都包含一个 `randao_reveal`：提议者对当前 **epoch 编号**的 BLS 签名。它会被哈希进 RANDAO mix，协议将其用作链上随机数（合约通过 `PREVRANDAO` 读取）。\n\n由于被签名的消息只是 epoch 编号，验证者可以提前算出自己所有未来的 reveal。这使得 reveal 无法作为每个提议者各自新鲜的随机值，也妨碍了那些需要每个提议者提供私密、不可预测值的设计，例如 Single Secret Leader Election（秘密提议者选举）；作者认为它能减少 MEV，并消除已知的 RANDAO 偏置攻击。\n\n## 它如何运作\n\n分叉之后，提议者签署的是一个新的 SSZ 容器，而不是 epoch：\n\n```python\nclass RandaoRevealSeed(Container):\n    previous_mix: Bytes32  # final RANDAO mix of the previous epoch\n    slot: Slot             # current slot\n```\n\n- `previous_mix` 要等到上一个 epoch 结束后才知道，所以未来 epoch 的 reveal 无法提前计算，验证者自己也不行。\n- `slot` 让每个 reveal 都唯一，即使同一个验证者在一个 epoch 中多次提议区块也是如此。\n\n`process_randao` 中的验证仍然是针对提议者公钥的一次 `bls.Verify`，使用相同的 `DOMAIN_RANDAO`。reveal 仍然像以前一样混入 RANDAO mix。对某条消息的 BLS 签名是确定性且可验证的，因此无需单独的证明就可以充当 VRF（在计算性 Diffie-Hellman 假设下是安全的）。\n\n作者选择*上一个* epoch 的 mix 而不是最新的 mix，因为如果以后把 reveal 用于 SSLE，使用最新的 mix 会造成分叉歧义。\n\n## 示例代码\n\n修改后的 `process_randao`（consensus-spec Python）：\n\n```python\ndef process_randao(state: BeaconState, body: BeaconBlockBody) -\u003e None:\n    epoch = get_current_epoch(state)\n    proposer = state.validators[get_beacon_proposer_index(state)]\n    if epoch \u003c FORK_EPOCH:\n        signing_root = compute_signing_root(epoch, get_domain(state, DOMAIN_RANDAO))\n    else:\n        seed = RandaoRevealSeed(\n            previous_mix=get_randao_mix(state, get_previous_epoch(state)),\n            slot=state.slot,\n        )\n        signing_root = compute_signing_root(seed, get_domain(state, DOMAIN_RANDAO))\n    assert bls.Verify(proposer.pubkey, signing_root, body.randao_reveal)\n\n    mix = xor(get_randao_mix(state, epoch), hash(body.randao_reveal))\n    state.randao_mixes[epoch % EPOCHS_PER_HISTORICAL_VECTOR] = mix\n```\n\n## 需要注意\n\n- **状态：Draft。** 这是共识层的硬分叉变更；分叉之后签署旧消息的区块无效。\n- 验证者客户端和远程签名器必须更新，改为签署 `RandaoRevealSeed` 而不是 epoch 编号。\n- 在当前 epoch 内，reveal 对提议者自己仍然是可预测的；只有在秘密领导者选举或 [EIP-7956](/eip-7956/) 以它为基础时，slot 字段才有意义。\n- reveal 没有可被\"磨\"（grind）的输入，但这个提案本身并不能消除 RANDAO 现有的\"最后揭示者\"偏置；那需要它所启用的后续设计。\n"}},"requiredBy":[7956]}
