{"eip":7002,"title":"Execution layer triggerable withdrawals","description":"Allow validators to trigger exits and partial withdrawals via their execution layer (0x01) withdrawal credentials","authors":["Danny Ryan (@djrtwo)","Mikhail Kalinin (@mkalinin)","Ansgar Dietrichs (@adietrichs)","Hsiao-Wei Wang (@hwwhww)","lightclient (@lightclient)","Felix Lange (@fjl)"],"status":"Final","type":"Standards Track","category":"Core","created":"2023-05-09","requires":[7685],"discussionsTo":"https://ethereum-magicians.org/t/eip-7002-execution-layer-triggerable-exits/14195","repo":"EIPs","label":"EIP-7002","officialUrl":"https://eips.ethereum.org/EIPS/eip-7002","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7002.md","url":"https://eips.huatuo.xyz/eip-7002/","tldr":{"en":"Lets a validator's execution-layer withdrawal address, EOA or smart contract, trigger a full exit or partial withdrawal by calling a system contract, without needing the validator's signing key.","ja":"バリデーターの実行レイヤー側の引き出しアドレス（EOA またはスマートコントラクト）が、システムコントラクトを呼び出すことで、バリデーターの署名鍵なしに全額の退出または一部引き出しを実行できるようにする。","ko":"검증자의 실행 계층 인출 주소(EOA 또는 스마트 컨트랙트)가 검증자의 서명 키 없이도 시스템 컨트랙트를 호출해 전체 퇴출 또는 부분 인출을 실행할 수 있게 한다.","zh":"允许验证者的执行层提款地址（EOA 或智能合约）通过调用系统合约来触发完全退出或部分提款，而无需验证者的签名密钥。"},"tags":["staking","withdrawals","validators","pectra","core"],"explainers":{"en":{"lang":"en","tldr":"Lets a validator's execution-layer withdrawal address, EOA or smart contract, trigger a full exit or partial withdrawal by calling a system contract, without needing the validator's signing key.","tags":["staking","withdrawals","validators","pectra","core"],"related":[7685,7251,6110,4895,1559],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7002/","markdown":"## What problem does it solve?\n\nA validator has two keys: a hot BLS **signing key** that performs duties, and **withdrawal credentials**, which for `0x01` credentials is an Ethereum address that receives the funds. The withdrawal address ultimately owns the stake, yet before this EIP only the signing key could start an exit.\n\nThat's a problem whenever the two are held by different parties. A staking pool's smart contract or a delegator could not force an exit, so the operator could effectively hold the ETH hostage, and workarounds like pre-signed exit messages are clumsy. If the signing key was lost, the owner could not get out at all.\n\nEIP-7002 lets the withdrawal address trigger exits (and partial withdrawals) from the execution layer, by ordinary transaction or contract call.\n\n## How it works\n\n- A **system contract** is predeployed at `0x00000961Ef480Eb55e80D19ad83579A64c007002`.\n- **Adding a request:** call it with exactly 56 bytes of calldata: the 48-byte validator pubkey followed by a big-endian `uint64` amount, and send at least the current fee as `msg.value`. `msg.sender` is recorded as the `source_address`; the consensus layer only acts if it matches the validator's withdrawal credentials. An amount of 0 means a full exit; a non-zero amount (in Gwei) requests a partial withdrawal.\n- **Reading the fee:** call with empty calldata; it returns the current fee in wei.\n- **Queue:** requests are queued in contract storage. At the end of each block, a system call dequeues up to 16 and places them in the block as [EIP-7685](/eip-7685/) requests (type `0x01`). The consensus layer processes them like a voluntary exit, but an invalid request (e.g. validator already exiting) is just skipped rather than invalidating the block.\n- **Fee:** an [EIP-1559](/eip-1559/)-style exponential fee. It stays at 1 wei while usage averages at or below 2 requests per block, and grows exponentially with \"excess\" requests to stop griefing.\n\nUsing the pubkey rather than the validator index lets staking contracts that know the key in advance use it before the validator is assigned an index.\n\n## Sample code\n\nRequesting a full exit from a contract, paying exactly the current fee (based on the spec's example):\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ncontract ExitTrigger {\n    address constant WITHDRAWAL_REQUESTS = 0x00000961Ef480Eb55e80D19ad83579A64c007002;\n\n    // Must be called from the validator's withdrawal-credential address.\n    function requestWithdrawal(bytes calldata pubkey, uint64 amountGwei, uint256 maxFee) external payable {\n        require(pubkey.length == 48, \"bad pubkey\");\n\n        (bool ok, bytes memory feeData) = WITHDRAWAL_REQUESTS.staticcall(\"\");\n        require(ok, \"fee read failed\");\n        uint256 fee = uint256(bytes32(feeData));\n        require(fee \u003c= maxFee, \"fee too high\");\n\n        // 48-byte pubkey ++ 8-byte big-endian amount (0 = full exit)\n        (bool sent, ) = WITHDRAWAL_REQUESTS.call{value: fee}(abi.encodePacked(pubkey, amountGwei));\n        require(sent, \"request failed\");\n    }\n}\n```\n\nFor this to work, the `ExitTrigger` contract itself must be the validator's `0x01` withdrawal address.\n\n## Things to know\n\n- **Status: Final.** It went live on mainnet in the Pectra upgrade, alongside [EIP-6110](/eip-6110/) (deposits) and [EIP-7251](/eip-7251/) (larger validator balances).\n- **Overpaid fees are not refunded.** Read the fee first and pay exactly that, with a cap, as above. Sending a fixed large value from an EOA wastes the difference.\n- Under the Electra consensus rules, partial withdrawals apply only to validators with compounding (`0x02`) credentials from EIP-7251; full exits work for `0x01` and `0x02`.\n- Requests are queued, so a request may not be included in the very block of your transaction, and the exit itself still waits in the beacon chain's exit queue.\n- Custody setups that assumed the withdrawal address *couldn't* force an exit should re-check that assumption.\n"},"ja":{"lang":"ja","tldr":"バリデーターの実行レイヤー側の引き出しアドレス（EOA またはスマートコントラクト）が、システムコントラクトを呼び出すことで、バリデーターの署名鍵なしに全額の退出または一部引き出しを実行できるようにする。","tags":["staking","withdrawals","validators","pectra","core"],"related":[7685,7251,6110,4895,1559],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7002/","markdown":"## 何を解決するのか\n\nバリデーターは 2 つの鍵を持ちます。職務を実行するホットな BLS **署名鍵**と、**引き出し資格情報（withdrawal credentials）** です。`0x01` の資格情報では、これは資金を受け取る Ethereum アドレスです。引き出しアドレスは最終的にステークを所有していますが、この EIP 以前は、退出を開始できるのは署名鍵だけでした。\n\n2 つの鍵を別々の主体が持っている場合、これは問題になります。ステーキングプールのスマートコントラクトや委任者は退出を強制できず、オペレーターが事実上 ETH を人質に取れてしまううえ、事前署名した退出メッセージのような回避策は扱いにくいものでした。署名鍵を失った場合、所有者は退出自体ができませんでした。\n\nEIP-7002 は、引き出しアドレスが実行レイヤーから、通常のトランザクションやコントラクト呼び出しによって退出（および一部引き出し）を実行できるようにします。\n\n## 仕組み\n\n- **システムコントラクト**が `0x00000961Ef480Eb55e80D19ad83579A64c007002` にあらかじめデプロイされます。\n- **リクエストの追加:** ちょうど 56 バイトの calldata（48 バイトのバリデーター公開鍵に続けてビッグエンディアンの `uint64` の amount）で呼び出し、`msg.value` として現在の手数料以上を送ります。`msg.sender` は `source_address` として記録され、コンセンサスレイヤーはそれがバリデーターの引き出し資格情報と一致する場合にのみ処理します。amount が 0 なら全額退出、0 以外（Gwei 単位）なら一部引き出しの要求です。\n- **手数料の取得:** 空の calldata で呼び出すと、現在の手数料を wei で返します。\n- **キュー:** リクエストはコントラクトのストレージ内のキューに入ります。各ブロックの終わりにシステムコールが最大 16 件をキューから取り出し、[EIP-7685](/eip-7685/) のリクエスト（タイプ `0x01`）としてブロックに入れます。コンセンサスレイヤーは自発的退出と同様に処理しますが、無効なリクエスト（たとえばバリデーターがすでに退出中など）はブロックを無効にせず、単にスキップされます。\n- **手数料:** [EIP-1559](/eip-1559/) 型の指数関数的な手数料です。使用量が平均してブロックあたり 2 リクエスト以下の間は 1 wei のままで、「超過」リクエストに応じて指数的に上昇し、嫌がらせを防ぎます。\n\nバリデーターのインデックスではなく公開鍵を使うことで、鍵を事前に知っているステーキングコントラクトは、バリデーターにインデックスが割り当てられる前でも使えます。\n\n## サンプルコード\n\nコントラクトから全額退出をリクエストし、現在の手数料をちょうど支払う例です（仕様の例に基づく）。\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ncontract ExitTrigger {\n    address constant WITHDRAWAL_REQUESTS = 0x00000961Ef480Eb55e80D19ad83579A64c007002;\n\n    // Must be called from the validator's withdrawal-credential address.\n    function requestWithdrawal(bytes calldata pubkey, uint64 amountGwei, uint256 maxFee) external payable {\n        require(pubkey.length == 48, \"bad pubkey\");\n\n        (bool ok, bytes memory feeData) = WITHDRAWAL_REQUESTS.staticcall(\"\");\n        require(ok, \"fee read failed\");\n        uint256 fee = uint256(bytes32(feeData));\n        require(fee \u003c= maxFee, \"fee too high\");\n\n        // 48-byte pubkey ++ 8-byte big-endian amount (0 = full exit)\n        (bool sent, ) = WITHDRAWAL_REQUESTS.call{value: fee}(abi.encodePacked(pubkey, amountGwei));\n        require(sent, \"request failed\");\n    }\n}\n```\n\nこれを動かすには、`ExitTrigger` コントラクト自身がバリデーターの `0x01` 引き出しアドレスである必要があります。\n\n## 知っておくべきこと\n\n- **ステータス: Final。** [EIP-6110](/eip-6110/)（デポジット）や [EIP-7251](/eip-7251/)（より大きなバリデーター残高）とともに、Pectra アップグレードでメインネットに導入されました。\n- **払い過ぎた手数料は返金されません。** 上記のように、まず手数料を読み取り、上限付きでその金額ちょうどを支払ってください。EOA から固定の大きな金額を送ると、差額が無駄になります。\n- Electra のコンセンサスルールでは、一部引き出しは EIP-7251 の compounding（`0x02`）資格情報を持つバリデーターにのみ適用されます。全額退出は `0x01` と `0x02` で使えます。\n- リクエストはキューに入るため、トランザクションと同じブロックに含まれない場合があり、退出自体もビーコンチェーンの退出キューで待つことになります。\n- 引き出しアドレスは退出を強制*できない*という前提で構成されたカストディ環境は、その前提を再確認してください。\n"},"ko":{"lang":"ko","tldr":"검증자의 실행 계층 인출 주소(EOA 또는 스마트 컨트랙트)가 검증자의 서명 키 없이도 시스템 컨트랙트를 호출해 전체 퇴출 또는 부분 인출을 실행할 수 있게 한다.","tags":["staking","withdrawals","validators","pectra","core"],"related":[7685,7251,6110,4895,1559],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7002/","markdown":"## 어떤 문제를 해결하나요?\n\n검증자는 두 가지 키를 가집니다. 임무를 수행하는 핫 BLS **서명 키**와 **인출 자격 증명**(withdrawal credentials)입니다. `0x01` 자격 증명에서 이는 자금을 받는 이더리움 주소입니다. 인출 주소가 궁극적으로 스테이크를 소유하지만, 이 EIP 이전에는 서명 키만 퇴출을 시작할 수 있었습니다.\n\n두 키를 서로 다른 주체가 가지고 있을 때 이는 문제가 됩니다. 스테이킹 풀의 스마트 컨트랙트나 위임자는 퇴출을 강제할 수 없어 운영자가 사실상 ETH를 인질로 잡을 수 있었고, 미리 서명한 퇴출 메시지 같은 우회책은 번거로웠습니다. 서명 키를 잃어버리면 소유자는 아예 빠져나갈 수 없었습니다.\n\nEIP-7002는 인출 주소가 실행 계층에서 일반 트랜잭션이나 컨트랙트 호출로 퇴출(및 부분 인출)을 실행할 수 있게 합니다.\n\n## 어떻게 동작하나요?\n\n- **시스템 컨트랙트**가 `0x00000961Ef480Eb55e80D19ad83579A64c007002`에 미리 배포됩니다.\n- **요청 추가:** 정확히 56바이트의 calldata(48바이트 검증자 공개 키 뒤에 빅엔디언 `uint64` amount)로 호출하고, `msg.value`로 현재 수수료 이상을 보냅니다. `msg.sender`는 `source_address`로 기록되며, 합의 계층은 이것이 검증자의 인출 자격 증명과 일치할 때만 처리합니다. amount가 0이면 전체 퇴출, 0이 아닌 amount(Gwei 단위)는 부분 인출 요청입니다.\n- **수수료 조회:** 빈 calldata로 호출하면 현재 수수료를 wei 단위로 반환합니다.\n- **큐:** 요청은 컨트랙트 스토리지의 큐에 쌓입니다. 각 블록의 끝에서 시스템 호출이 최대 16개를 꺼내 [EIP-7685](/eip-7685/) 요청(타입 `0x01`)으로 블록에 넣습니다. 합의 계층은 이를 자발적 퇴출처럼 처리하지만, 유효하지 않은 요청(예: 검증자가 이미 퇴출 중)은 블록을 무효로 만들지 않고 그냥 건너뜁니다.\n- **수수료:** [EIP-1559](/eip-1559/) 방식의 지수 수수료입니다. 사용량이 평균적으로 블록당 2개 요청 이하인 동안은 1 wei로 유지되고, \"초과\" 요청에 따라 지수적으로 증가해 악의적인 방해를 막습니다.\n\n검증자 인덱스 대신 공개 키를 사용하기 때문에, 키를 미리 아는 스테이킹 컨트랙트는 검증자에게 인덱스가 할당되기 전에도 이를 사용할 수 있습니다.\n\n## 샘플 코드\n\n컨트랙트에서 전체 퇴출을 요청하고 현재 수수료를 정확히 지불하는 예입니다(명세의 예시 기반).\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ncontract ExitTrigger {\n    address constant WITHDRAWAL_REQUESTS = 0x00000961Ef480Eb55e80D19ad83579A64c007002;\n\n    // Must be called from the validator's withdrawal-credential address.\n    function requestWithdrawal(bytes calldata pubkey, uint64 amountGwei, uint256 maxFee) external payable {\n        require(pubkey.length == 48, \"bad pubkey\");\n\n        (bool ok, bytes memory feeData) = WITHDRAWAL_REQUESTS.staticcall(\"\");\n        require(ok, \"fee read failed\");\n        uint256 fee = uint256(bytes32(feeData));\n        require(fee \u003c= maxFee, \"fee too high\");\n\n        // 48-byte pubkey ++ 8-byte big-endian amount (0 = full exit)\n        (bool sent, ) = WITHDRAWAL_REQUESTS.call{value: fee}(abi.encodePacked(pubkey, amountGwei));\n        require(sent, \"request failed\");\n    }\n}\n```\n\n이것이 동작하려면 `ExitTrigger` 컨트랙트 자체가 검증자의 `0x01` 인출 주소여야 합니다.\n\n## 알아둘 점\n\n- **상태: Final.** [EIP-6110](/eip-6110/)(예치) 및 [EIP-7251](/eip-7251/)(더 큰 검증자 잔액)과 함께 Pectra 업그레이드에서 메인넷에 적용되었습니다.\n- **초과 지불한 수수료는 환불되지 않습니다.** 위 예시처럼 먼저 수수료를 읽고 상한을 두어 정확히 그 금액만 지불하세요. EOA에서 고정된 큰 금액을 보내면 차액이 낭비됩니다.\n- Electra 합의 규칙에서 부분 인출은 EIP-7251의 compounding(`0x02`) 자격 증명을 가진 검증자에게만 적용됩니다. 전체 퇴출은 `0x01`과 `0x02` 모두에서 동작합니다.\n- 요청은 큐에 쌓이므로 트랜잭션이 포함된 바로 그 블록에 처리되지 않을 수 있고, 퇴출 자체도 비콘 체인의 퇴출 큐에서 기다려야 합니다.\n- 인출 주소가 퇴출을 강제할 수 *없다*고 가정하고 구성한 수탁 설정은 그 가정을 다시 확인해야 합니다.\n"},"zh":{"lang":"zh","tldr":"允许验证者的执行层提款地址（EOA 或智能合约）通过调用系统合约来触发完全退出或部分提款，而无需验证者的签名密钥。","tags":["staking","withdrawals","validators","pectra","core"],"related":[7685,7251,6110,4895,1559],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7002/","markdown":"## 它解决什么问题？\n\n验证者有两把密钥：执行职责的热 BLS **签名密钥**，以及**提款凭证**（withdrawal credentials）；对于 `0x01` 凭证，它是接收资金的以太坊地址。提款地址最终拥有这笔质押，但在这项 EIP 之前，只有签名密钥才能发起退出。\n\n当这两者由不同的人持有时，就会出问题。质押池的智能合约或委托人无法强制退出，运营者实际上可以把 ETH 当作人质，而预先签名退出消息之类的变通办法又很笨拙。如果签名密钥丢失，所有者根本无法退出。\n\nEIP-7002 让提款地址可以在执行层通过普通交易或合约调用来触发退出（以及部分提款）。\n\n## 它如何运作\n\n- 一个**系统合约**预部署在 `0x00000961Ef480Eb55e80D19ad83579A64c007002`。\n- **添加请求：** 用恰好 56 字节的 calldata 调用它：48 字节的验证者公钥，后接大端序 `uint64` 的 amount，并随 `msg.value` 发送至少当前费用。`msg.sender` 被记录为 `source_address`；共识层只有在它与验证者的提款凭证匹配时才会处理。amount 为 0 表示完全退出；非零 amount（以 Gwei 计）表示请求部分提款。\n- **读取费用：** 用空 calldata 调用；它返回以 wei 计的当前费用。\n- **队列：** 请求在合约存储中排队。在每个区块末尾，一次系统调用最多取出 16 个请求，并作为 [EIP-7685](/eip-7685/) 请求（类型 `0x01`）放入区块。共识层像处理自愿退出一样处理它们，但无效请求（例如验证者已在退出）只会被跳过，而不会使区块无效。\n- **费用：** [EIP-1559](/eip-1559/) 风格的指数费用。只要平均使用量不超过每个区块 2 个请求，它就保持在 1 wei，并随\"超额\"请求呈指数增长，以防止恶意骚扰。\n\n使用公钥而不是验证者索引，使预先知道公钥的质押合约可以在验证者被分配索引之前就使用它。\n\n## 示例代码\n\n从合约请求完全退出，并恰好支付当前费用（基于规范中的示例）：\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ncontract ExitTrigger {\n    address constant WITHDRAWAL_REQUESTS = 0x00000961Ef480Eb55e80D19ad83579A64c007002;\n\n    // Must be called from the validator's withdrawal-credential address.\n    function requestWithdrawal(bytes calldata pubkey, uint64 amountGwei, uint256 maxFee) external payable {\n        require(pubkey.length == 48, \"bad pubkey\");\n\n        (bool ok, bytes memory feeData) = WITHDRAWAL_REQUESTS.staticcall(\"\");\n        require(ok, \"fee read failed\");\n        uint256 fee = uint256(bytes32(feeData));\n        require(fee \u003c= maxFee, \"fee too high\");\n\n        // 48-byte pubkey ++ 8-byte big-endian amount (0 = full exit)\n        (bool sent, ) = WITHDRAWAL_REQUESTS.call{value: fee}(abi.encodePacked(pubkey, amountGwei));\n        require(sent, \"request failed\");\n    }\n}\n```\n\n要使其生效，`ExitTrigger` 合约本身必须是验证者的 `0x01` 提款地址。\n\n## 需要注意\n\n- **状态：Final。** 它在 Pectra 升级中随 [EIP-6110](/eip-6110/)（存款）和 [EIP-7251](/eip-7251/)（更大的验证者余额）一起在主网上线。\n- **多付的费用不会退还。** 先读取费用，再如上所示以上限保护、恰好支付该金额。从 EOA 发送固定的大额数值会浪费差额。\n- 按照 Electra 共识规则，部分提款只适用于拥有 EIP-7251 中 compounding（`0x02`）凭证的验证者；完全退出对 `0x01` 和 `0x02` 都有效。\n- 请求是排队处理的，因此它可能不会包含在你的交易所在的那个区块中，而退出本身仍要在信标链的退出队列中等待。\n- 假定提款地址*无法*强制退出的托管方案，应重新检查这一假设。\n"}},"requiredBy":[7251,7600,8025,8256]}
