{"eip":8222,"title":"Lean Staking","description":"L1 native, two-phase staking with validator unlinkability","authors":["Mohammad Jahanara (@mmjahanara)","Pierre Daix-Moreux (@dmpierre)"],"status":"Draft","type":"Standards Track","category":"Core","created":"2026-04-09","requires":[6110,7251],"discussionsTo":"https://ethereum-magicians.org/t/eip-8222-lean-staking/28196","repo":"EIPs","label":"EIP-8222","officialUrl":"https://eips.ethereum.org/EIPS/eip-8222","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8222.md","url":"https://eips.huatuo.xyz/eip-8222/","tldr":{"en":"Proposes a two-phase, zero-knowledge staking deposit that breaks the public link between the address that funds a validator and the validator's keys, and can double as a private ETH transfer.","ja":"バリデーターに資金を提供するアドレスとバリデーターの鍵との公開された関連を断ち切り、プライベートな ETH 送金としても使える、2 フェーズのゼロ知識ステーキングデポジットを提案する。","ko":"검증자에게 자금을 대는 주소와 검증자 키 사이의 공개적인 연결을 끊고, 비공개 ETH 전송으로도 쓸 수 있는 2단계 영지식 스테이킹 예치를 제안한다.","zh":"提出一种两阶段的零知识质押存款，切断为验证者出资的地址与验证者密钥之间的公开关联，还可以兼作私密的 ETH 转账。"},"tags":["staking","privacy","zero-knowledge","deposits","core"],"explainers":{"en":{"lang":"en","tldr":"Proposes a two-phase, zero-knowledge staking deposit that breaks the public link between the address that funds a validator and the validator's keys, and can double as a private ETH transfer.","tags":["staking","privacy","zero-knowledge","deposits","core"],"related":[6110,7251,7002,7503],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-8222/","markdown":"## What problem does it solve?\n\nToday a staking deposit is fully public: anyone can see which execution-layer address funded which validator key. That leaks who runs which validators, which can expose solo and institutional stakers to targeted attacks, including physical ones.\n\nSince [EIP-6110](/eip-6110/) moved deposit processing to the execution layer, the deposit contract itself can be changed to hide that link. Lean Staking does this with a commitment tree and a zero-knowledge proof, in the style of mixer protocols, but built into the one mechanism every validator must use.\n\n## How it works\n\n**Phase 1: pending deposit.** The depositor sends ETH (at least 1 ETH) and a commitment to `add_pending_deposit`, which appends it to an on-chain *pending deposit tree* (an incremental Merkle tree using a SNARK-friendly hash such as Poseidon):\n\n```\ncommitment = hash(nullifier_preimage | validator_key | withdrawal_cred | amount)\nnullifier  = hash(nullifier_preimage)\n```\n\nThis transaction is public but reveals nothing about the future validator.\n\n**Phase 2: claim.** Later, a *different* party (a relayer or AA bundler) calls `claim` with the validator key, withdrawal credentials, amount, the nullifier and a zk-proof that some unclaimed leaf in a recent tree root matches those values. The contract records the nullifier to block double claims and sends the deposit to the normal validator entry queue. Because the credentials are inside the committed preimage, a front-runner cannot swap in their own keys. The contract keeps a ring buffer of recent roots (the spec suggests something like 1024), so proofs stay valid for a while.\n\n**Optional: two-phase withdrawals.** A new withdrawal credential type `0x03` stores a *withdrawal commitment* instead of an address. On exit, the consensus layer inserts it into a *pending withdrawal tree*, and anyone who knows the secret can claim the ETH to the committed recipient. A pending deposit may also go straight into the withdrawal tree without ever becoming a validator. The result is a private transfer where both sender and recipient look like ordinary stakers. This part requires consensus-layer changes; the deposit side alone does not.\n\n## Sample code\n\nThe new deposit entry point, as sketched in the spec:\n\n```solidity\nfunction add_pending_deposit(bytes32 commitment) external payable {\n    require(msg.value \u003e= 1 ether);\n    bytes32 newRoot = insertLeaf(root, commitment);\n    storeRoot(newRoot);                         // kept in a circular buffer\n    emit PendingDeposit(commitment, commitmentCount - 1);\n}\n```\n\nOff-chain, the depositor keeps three secrets safe until the claim: `nullifier_preimage`, the validator key and withdrawal credentials (plus `withdrawal_nullifier_preimage` if using `0x03`).\n\n## Things to know\n\n- **Status: Draft.** The proof encoding, hash function and field are not fixed; the reference implementation uses LeanVM with Poseidon over the Koala-Bear field, which the authors describe as post-quantum ready.\n- Privacy depends on the anonymity set. Unusual amounts stand out, so the spec discusses restricting deposits to fixed denominations (e.g. 32 up to 2048 ETH, reflecting [EIP-7251](/eip-7251/) balances), each with its own tree.\n- Users should wait a variable time and let many other commitments land before claiming, or timing can link the two phases. The original depositor should not send the claim themselves.\n- `0x03` credentials in their current form do not work with [EIP-7002](/eip-7002/) contract-triggered exits; the spec suggests a separate public exit-authority address as a fix.\n- The spent-nullifier set grows forever; \"evolving nullifiers\" are mentioned as a possible remedy.\n- Compare [EIP-7503](/eip-7503/) (Wormhole), a different in-protocol privacy approach.\n"},"ja":{"lang":"ja","tldr":"バリデーターに資金を提供するアドレスとバリデーターの鍵との公開された関連を断ち切り、プライベートな ETH 送金としても使える、2 フェーズのゼロ知識ステーキングデポジットを提案する。","tags":["staking","privacy","zero-knowledge","deposits","core"],"related":[6110,7251,7002,7503],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-8222/","markdown":"## 何を解決するのか\n\n現在、ステーキングのデポジットは完全に公開されています。どの実行レイヤーのアドレスがどのバリデーター鍵に資金を提供したかを、誰でも見ることができます。これは、誰がどのバリデーターを運用しているかを漏らし、ソロステーカーや機関投資家のステーカーを、物理的なものを含む標的型攻撃にさらす可能性があります。\n\n[EIP-6110](/eip-6110/) がデポジットの処理を実行レイヤーに移したことで、デポジットコントラクト自体を変更してその関連を隠せるようになりました。Lean Staking は、ミキサープロトコルに倣ったコミットメントツリーとゼロ知識証明を使い、すべてのバリデーターが必ず使う仕組みの中にこれを組み込みます。\n\n## 仕組み\n\n**フェーズ 1: 保留中のデポジット。** デポジット者は ETH（1 ETH 以上）とコミットメントを `add_pending_deposit` に送ります。これはコミットメントを、オンチェーンの*保留中デポジットツリー*（Poseidon のような SNARK フレンドリーなハッシュを使うインクリメンタルな Merkle ツリー）に追加します。\n\n```\ncommitment = hash(nullifier_preimage | validator_key | withdrawal_cred | amount)\nnullifier  = hash(nullifier_preimage)\n```\n\nこのトランザクションは公開されますが、将来のバリデーターについては何も明かしません。\n\n**フェーズ 2: クレーム。** 後で、*別の*当事者（リレイヤーまたは AA バンドラー）が、バリデーター鍵、ウィズドローアル・クレデンシャル、金額、nullifier、そして最近のツリー root 内の未クレームのリーフがそれらの値と一致することを示すゼロ知識証明を指定して `claim` を呼び出します。コントラクトは二重クレームを防ぐために nullifier を記録し、デポジットを通常のバリデーター参加キューに送ります。クレデンシャルはコミットされたプリイメージの中にあるため、フロントランナーが自分の鍵に差し替えることはできません。コントラクトは最近の root のリングバッファを保持しており（仕様は 1024 程度を提案しています）、証明はしばらくの間有効です。\n\n**任意: 2 フェーズのウィズドローアル。** 新しいウィズドローアル・クレデンシャルのタイプ `0x03` は、アドレスの代わりに*ウィズドローアル・コミットメント*を保存します。退出時にコンセンサスレイヤーがそれを*保留中ウィズドローアルツリー*に挿入し、秘密を知っている者は誰でも、コミットされた受取人宛てに ETH をクレームできます。保留中のデポジットは、バリデーターになることなく直接ウィズドローアルツリーに入ることもできます。その結果、送信者も受取人も通常のステーカーに見える、プライベートな送金になります。この部分にはコンセンサスレイヤーの変更が必要で、デポジット側だけであれば不要です。\n\n## サンプルコード\n\n仕様に示されている新しいデポジットのエントリポイント:\n\n```solidity\nfunction add_pending_deposit(bytes32 commitment) external payable {\n    require(msg.value \u003e= 1 ether);\n    bytes32 newRoot = insertLeaf(root, commitment);\n    storeRoot(newRoot);                         // kept in a circular buffer\n    emit PendingDeposit(commitment, commitmentCount - 1);\n}\n```\n\nオフチェーンでは、デポジット者はクレームまでの間、3 つの秘密を安全に保管します。`nullifier_preimage`、バリデーター鍵、ウィズドローアル・クレデンシャルです（`0x03` を使う場合は `withdrawal_nullifier_preimage` も）。\n\n## 知っておくべきこと\n\n- **ステータス: Draft。** 証明のエンコーディング、ハッシュ関数、体は固定されていません。リファレンス実装は、著者がポスト量子対応と説明している Koala-Bear 体上の Poseidon を用いた LeanVM を使っています。\n- プライバシーは匿名セットに依存します。普通でない金額は目立つため、仕様は、デポジットを固定の額面（たとえば [EIP-7251](/eip-7251/) の残高を反映した 32 から 2048 ETH）に制限し、それぞれに専用のツリーを持たせることを検討しています。\n- ユーザーはクレームの前に、ばらつきのある時間待って、他の多くのコミットメントが入るのを待つべきです。そうしないと、タイミングによって 2 つのフェーズが結び付けられる可能性があります。元のデポジット者は、自分でクレームを送るべきではありません。\n- 現在の形の `0x03` クレデンシャルは、[EIP-7002](/eip-7002/) のコントラクトによる退出では動作しません。仕様は、修正として別の公開の退出権限アドレスを設けることを提案しています。\n- 使用済み nullifier の集合は際限なく増え続けます。対処案として「進化する nullifier」が言及されています。\n- プロトコル内のプライバシーに対する別のアプローチである [EIP-7503](/eip-7503/)（Wormhole）と比較してください。\n"},"ko":{"lang":"ko","tldr":"검증자에게 자금을 대는 주소와 검증자 키 사이의 공개적인 연결을 끊고, 비공개 ETH 전송으로도 쓸 수 있는 2단계 영지식 스테이킹 예치를 제안한다.","tags":["staking","privacy","zero-knowledge","deposits","core"],"related":[6110,7251,7002,7503],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-8222/","markdown":"## 어떤 문제를 해결하나요?\n\n오늘날 스테이킹 예치는 완전히 공개됩니다. 어떤 실행 계층 주소가 어떤 검증자 키에 자금을 댔는지 누구나 볼 수 있습니다. 이는 누가 어떤 검증자를 운영하는지 드러내어, 개인 스테이커와 기관 스테이커를 물리적 공격을 포함한 표적 공격에 노출시킬 수 있습니다.\n\n[EIP-6110](/eip-6110/)이 예치 처리를 실행 계층으로 옮긴 뒤로, 예치 컨트랙트 자체를 바꿔 그 연결을 숨길 수 있게 되었습니다. Lean Staking은 믹서 프로토콜 방식의 커밋먼트 트리와 영지식 증명으로 이를 구현하되, 모든 검증자가 반드시 사용하는 메커니즘 안에 내장합니다.\n\n## 어떻게 동작하나요?\n\n**1단계: 대기 중인 예치.** 예치자는 ETH(최소 1 ETH)와 커밋먼트를 `add_pending_deposit`에 보내며, 이는 커밋먼트를 온체인 *대기 예치 트리*(Poseidon 같은 SNARK 친화 해시를 쓰는 증분 Merkle 트리)에 추가합니다.\n\n```\ncommitment = hash(nullifier_preimage | validator_key | withdrawal_cred | amount)\nnullifier  = hash(nullifier_preimage)\n```\n\n이 트랜잭션은 공개되지만 미래의 검증자에 대해서는 아무것도 드러내지 않습니다.\n\n**2단계: 청구.** 나중에 *다른* 당사자(릴레이어 또는 AA 번들러)가 검증자 키, 인출 자격 증명, 금액, nullifier, 그리고 최근 트리 루트의 아직 청구되지 않은 리프가 이 값들과 일치함을 보이는 영지식 증명으로 `claim`을 호출합니다. 컨트랙트는 이중 청구를 막기 위해 nullifier를 기록하고 예치금을 일반 검증자 진입 대기열로 보냅니다. 자격 증명이 커밋된 프리이미지 안에 있으므로 프론트러너가 자기 키로 바꿔치기할 수 없습니다. 컨트랙트는 최근 루트의 링 버퍼를 유지하므로(스펙은 1024개 정도를 제안합니다) 증명은 한동안 유효합니다.\n\n**선택: 2단계 인출.** 새로운 인출 자격 증명 유형 `0x03`은 주소 대신 *인출 커밋먼트*를 저장합니다. 종료할 때 합의 계층이 이를 *대기 인출 트리*에 삽입하고, 비밀을 아는 사람은 누구나 커밋된 수취인에게 ETH를 청구할 수 있습니다. 대기 중인 예치는 검증자가 되지 않고 곧바로 인출 트리로 들어갈 수도 있습니다. 그 결과 송신자와 수신자 모두 평범한 스테이커처럼 보이는 비공개 전송이 됩니다. 이 부분은 합의 계층 변경이 필요하며, 예치 쪽만으로는 필요하지 않습니다.\n\n## 샘플 코드\n\n스펙에 스케치된 새 예치 진입점:\n\n```solidity\nfunction add_pending_deposit(bytes32 commitment) external payable {\n    require(msg.value \u003e= 1 ether);\n    bytes32 newRoot = insertLeaf(root, commitment);\n    storeRoot(newRoot);                         // kept in a circular buffer\n    emit PendingDeposit(commitment, commitmentCount - 1);\n}\n```\n\n오프체인에서 예치자는 청구할 때까지 세 가지 비밀을 안전하게 보관해야 합니다. `nullifier_preimage`, 검증자 키, 인출 자격 증명입니다(`0x03`을 쓴다면 `withdrawal_nullifier_preimage`도).\n\n## 알아둘 점\n\n- **상태: Draft.** 증명 인코딩, 해시 함수, 체는 정해지지 않았습니다. 레퍼런스 구현은 LeanVM과 Koala-Bear 체 위의 Poseidon을 사용하며, 저자들은 이를 양자 내성 준비가 된 것으로 설명합니다.\n- 프라이버시는 익명 집합에 달려 있습니다. 특이한 금액은 눈에 띄므로, 스펙은 예치를 고정 단위(예: [EIP-7251](/eip-7251/) 잔액을 반영한 32에서 2048 ETH)로 제한하고 각각 별도의 트리를 두는 방안을 논의합니다.\n- 사용자는 청구하기 전에 불규칙한 시간 동안 기다리며 다른 많은 커밋먼트가 들어오도록 해야 합니다. 그렇지 않으면 타이밍으로 두 단계가 연결될 수 있습니다. 원래 예치자가 직접 청구를 보내서는 안 됩니다.\n- 현재 형태의 `0x03` 자격 증명은 [EIP-7002](/eip-7002/) 컨트랙트 트리거 종료와 함께 동작하지 않습니다. 스펙은 해결책으로 별도의 공개 종료 권한 주소를 제안합니다.\n- 사용된 nullifier 집합은 영원히 커집니다. 가능한 해결책으로 \"진화하는 nullifier\"가 언급됩니다.\n- 프로토콜 내 프라이버시에 대한 다른 접근인 [EIP-7503](/eip-7503/)(Wormhole)과 비교해 보세요.\n"},"zh":{"lang":"zh","tldr":"提出一种两阶段的零知识质押存款，切断为验证者出资的地址与验证者密钥之间的公开关联，还可以兼作私密的 ETH 转账。","tags":["staking","privacy","zero-knowledge","deposits","core"],"related":[6110,7251,7002,7503],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-8222/","markdown":"## 它解决什么问题？\n\n如今，质押存款是完全公开的：任何人都能看到是哪个执行层地址为哪个验证者密钥出的资。这会泄露谁在运行哪些验证者，使个人和机构质押者面临有针对性的攻击，包括人身攻击。\n\n自从 [EIP-6110](/eip-6110/) 把存款处理移到执行层之后，就可以修改存款合约本身来隐藏这种关联。Lean Staking 借鉴混币协议的思路，使用承诺树和零知识证明来实现这一点，只不过它被构建进了每个验证者都必须使用的那套机制之中。\n\n## 它如何运作\n\n**第一阶段：待处理存款。** 存款人把 ETH（至少 1 ETH）和一个承诺发送给 `add_pending_deposit`，它会把该承诺追加到链上的*待处理存款树*中（一棵使用 Poseidon 等对 SNARK 友好的哈希的增量 Merkle 树）：\n\n```\ncommitment = hash(nullifier_preimage | validator_key | withdrawal_cred | amount)\nnullifier  = hash(nullifier_preimage)\n```\n\n这笔交易是公开的，但不会透露任何关于未来验证者的信息。\n\n**第二阶段：领取。** 之后，由一个*不同的*参与方（中继者或 AA bundler）调用 `claim`，提供验证者密钥、提款凭证、金额、nullifier，以及一个零知识证明，证明在某个最近的树根中存在一个未被领取的叶子与这些值相匹配。合约记录 nullifier 以阻止重复领取，并把存款送入正常的验证者进入队列。由于凭证位于被承诺的原像之中，抢跑者无法换成自己的密钥。合约保留一个最近树根的环形缓冲区（规范建议大约 1024 个），因此证明可以在一段时间内保持有效。\n\n**可选：两阶段提款。** 新的提款凭证类型 `0x03` 存储的是*提款承诺*而不是地址。退出时，共识层把它插入*待处理提款树*，任何知道秘密的人都可以把 ETH 领取到被承诺的接收方。待处理存款也可以直接进入提款树，而从不成为验证者。结果是一次私密转账，发送方和接收方看起来都像是普通质押者。这一部分需要修改共识层；仅存款一侧则不需要。\n\n## 示例代码\n\n规范中勾勒的新存款入口：\n\n```solidity\nfunction add_pending_deposit(bytes32 commitment) external payable {\n    require(msg.value \u003e= 1 ether);\n    bytes32 newRoot = insertLeaf(root, commitment);\n    storeRoot(newRoot);                         // kept in a circular buffer\n    emit PendingDeposit(commitment, commitmentCount - 1);\n}\n```\n\n在链下，存款人在领取之前需要妥善保管三个秘密：`nullifier_preimage`、验证者密钥和提款凭证（如果使用 `0x03`，还有 `withdrawal_nullifier_preimage`）。\n\n## 需要注意\n\n- **状态：Draft。** 证明编码、哈希函数和域都没有确定；参考实现使用 LeanVM，以及 Koala-Bear 域上的 Poseidon，作者称其已为后量子做好准备。\n- 隐私取决于匿名集。不寻常的金额会很显眼，因此规范讨论了把存款限制在固定面额（例如 32 到 2048 ETH，对应 [EIP-7251](/eip-7251/) 的余额），每种面额各有自己的树。\n- 用户应等待一段不固定的时间，并让许多其他承诺先上链再领取，否则时间上的关联可能把两个阶段联系起来。原始存款人不应自己发送领取交易。\n- 当前形式的 `0x03` 凭证无法配合 [EIP-7002](/eip-7002/) 由合约触发的退出使用；规范建议设置一个单独的公开退出授权地址作为修复。\n- 已使用的 nullifier 集合会无限增长；文中提到\"演进式 nullifier\"作为一种可能的补救办法。\n- 可与 [EIP-7503](/eip-7503/)（Wormhole）对比，那是另一种协议内的隐私方案。\n"}}}
