{"eip":8148,"title":"Custom sweep threshold for validators","description":"Allow setting custom balance thresholds for sweep withdrawals for validators with compounding withdrawal credentials (`0x02`).","authors":["Dmitry Gusakov (@dgusakov)","Dmitry Chernukhin (@madlabman)","Greg Koumoutsos (@gkoumout)","Manu (@nalepae)"],"status":"Draft","type":"Standards Track","category":"Core","created":"2026-02-05","requires":[7251,7685],"discussionsTo":"https://ethereum-magicians.org/t/eip-8148-custom-sweep-threshold-for-validators/27669","repo":"EIPs","label":"EIP-8148","officialUrl":"https://eips.ethereum.org/EIPS/eip-8148","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8148.md","url":"https://eips.huatuo.xyz/eip-8148/","tldr":{"en":"Lets compounding (0x02) validators choose the balance above which rewards are automatically swept to their withdrawal address, instead of the fixed 2,048 ETH, via a new execution-layer request contract.","ja":"コンパウンディング（0x02）バリデータが、固定の 2,048 ETH の代わりに、報酬が出金先アドレスへ自動スイープされる残高のしきい値を、新しい実行レイヤーのリクエストコントラクトを通じて自分で選べるようにする。","ko":"복리(0x02) 검증자가 고정된 2,048 ETH 대신, 보상이 출금 주소로 자동 스윕되는 잔액 기준을 새로운 실행 계층 요청 컨트랙트로 직접 정할 수 있게 한다.","zh":"让复利（0x02）验证者通过新的执行层请求合约，自行选择超过多少余额后奖励会被自动清扫到提款地址，而不是固定的 2,048 ETH。"},"tags":["staking","validators","withdrawals","consensus","core"],"explainers":{"en":{"lang":"en","tldr":"Lets compounding (0x02) validators choose the balance above which rewards are automatically swept to their withdrawal address, instead of the fixed 2,048 ETH, via a new execution-layer request contract.","tags":["staking","validators","withdrawals","consensus","core"],"related":[7251,7685,7002,4895],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-8148/","markdown":"## What problem does it solve?\n\n[EIP-7251](/eip-7251/) introduced compounding withdrawal credentials (`0x02`), which let a validator's balance grow up to 2,048 ETH. The catch: automatic reward sweeps only kick in above that 2,048 ETH ceiling. A 32 ETH or 128 ETH validator that wants regular payouts has to trigger partial withdrawals manually, which costs a transaction each time and goes through a queue whose waiting time depends on network conditions.\n\nThe authors cite this as one reason few validators have switched to `0x02`. EIP-8148 lets each compounding validator set its own sweep threshold, so rewards above, say, 128 ETH flow out automatically through the normal withdrawal sweep.\n\n## How it works\n\n**Execution layer.** A new system contract (address still TBD) accepts *set sweep threshold* requests, modelled on the [EIP-7002](/eip-7002/) withdrawal-request contract:\n\n- Calldata of exactly 56 bytes: the 48-byte validator pubkey followed by an 8-byte big-endian `uint64` threshold. The caller must send at least the current fee.\n- Empty calldata returns the current fee. The fee rises exponentially when more than 2 requests per block are queued on average (`fake_exponential` with min fee 1 wei, update fraction 17).\n- At the end of each block a system call dequeues up to 16 requests and emits them as [EIP-7685](/eip-7685/) requests of type `0x05`.\n\n**Consensus layer.**\n\n- `BeaconState` gains a `validator_sweep_thresholds` list; existing `0x02` validators default to `MAX_EFFECTIVE_BALANCE_ELECTRA` (2,048 ETH), and `0x00`/`0x01` validators get 0.\n- A new `0x02` validator can set its initial threshold in bytes 10–11 of its withdrawal credentials at deposit time; zero bytes mean the default.\n- A request can change the threshold only to a value at or above the current balance, and it must be a multiple of `EFFECTIVE_BALANCE_INCREMENT` (1 ETH). This stops the feature from being used as an instant withdrawal.\n- The sweep and effective-balance logic use the per-validator threshold instead of the global maximum.\n\n## Sample code\n\nBuilding and sending a request (ethers v6). The contract address is not yet assigned; the threshold unit below assumes Gwei, as used for consensus-layer balances.\n\n```ts\nimport { Contract, JsonRpcProvider, Wallet, concat, toBeHex, zeroPadValue } from \"ethers\";\n\nconst PREDEPLOY = process.env.SWEEP_THRESHOLD_CONTRACT!; // TBD in the EIP\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst wallet = new Wallet(process.env.PRIVATE_KEY!, provider);\n\nconst pubkey = \"0x\" + \"ab\".repeat(48);                         // 48-byte BLS pubkey\nconst thresholdGwei = 128n * 10n ** 9n;                        // 128 ETH, multiple of 1 ETH\nconst data = concat([pubkey, zeroPadValue(toBeHex(thresholdGwei), 8)]); // 56 bytes\n\nconst fee = BigInt(await provider.call({ to: PREDEPLOY, data: \"0x\" })); // fee getter\nawait wallet.sendTransaction({ to: PREDEPLOY, data, value: fee });\n```\n\n## Things to know\n\n- Status: **Draft**. The contract address, deployment transaction and full consensus specs are still placeholders.\n- Fully optional: validators that never send a request keep today's behaviour.\n- The request is sent from the execution layer; like EIP-7002, the `source_address` is recorded so the consensus layer can check it against the validator's withdrawal credentials.\n- To lower the threshold below the current balance, first partially withdraw down to the desired level, then set the new threshold.\n- Overpaying the fee is not refunded; read the current fee first, as with EIP-7002.\n"},"ja":{"lang":"ja","tldr":"コンパウンディング（0x02）バリデータが、固定の 2,048 ETH の代わりに、報酬が出金先アドレスへ自動スイープされる残高のしきい値を、新しい実行レイヤーのリクエストコントラクトを通じて自分で選べるようにする。","tags":["staking","validators","withdrawals","consensus","core"],"related":[7251,7685,7002,4895],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-8148/","markdown":"## 何を解決するのか\n\n[EIP-7251](/eip-7251/) は、バリデータの残高が最大 2,048 ETH まで増えられるようにするコンパウンディング出金クレデンシャル（`0x02`）を導入しました。ただし問題があります。報酬の自動スイープは、その 2,048 ETH の上限を超えたときにしか働きません。定期的な支払いを望む 32 ETH や 128 ETH のバリデータは、部分出金を手動で起動しなければならず、そのたびにトランザクションが必要で、待ち時間がネットワークの状況に左右されるキューを通ります。\n\n著者らは、これが `0x02` に切り替えるバリデータが少ない理由の 1 つだと述べています。EIP-8148 は、各コンパウンディングバリデータが自分のスイープしきい値を設定できるようにし、たとえば 128 ETH を超えた報酬が通常の出金スイープで自動的に流れ出るようにします。\n\n## 仕組み\n\n**実行レイヤー。** 新しいシステムコントラクト（アドレスは未定）が、[EIP-7002](/eip-7002/) の出金リクエストコントラクトをモデルにした*スイープしきい値の設定*リクエストを受け付けます。\n\n- calldata はちょうど 56 バイト: 48 バイトのバリデータ公開鍵の後に、8 バイトのビッグエンディアン `uint64` のしきい値が続きます。呼び出し元は少なくとも現在の手数料を送らなければなりません。\n- calldata が空の場合は現在の手数料を返します。ブロックあたり平均 2 件を超えるリクエストがキューに入ると、手数料は指数関数的に上昇します（`fake_exponential`、最小手数料 1 wei、更新係数 17）。\n- 各ブロックの終わりに、システムコールが最大 16 件のリクエストをデキューし、タイプ `0x05` の [EIP-7685](/eip-7685/) リクエストとして emit します。\n\n**コンセンサスレイヤー。**\n\n- `BeaconState` に `validator_sweep_thresholds` リストが加わります。既存の `0x02` バリデータのデフォルトは `MAX_EFFECTIVE_BALANCE_ELECTRA`（2,048 ETH）で、`0x00` / `0x01` のバリデータは 0 になります。\n- 新しい `0x02` バリデータは、デポジット時に出金クレデンシャルのバイト 10〜11 で初期しきい値を設定できます。ゼロのバイトはデフォルトを意味します。\n- リクエストでしきい値を変更できるのは、現在の残高以上の値に対してのみで、かつ `EFFECTIVE_BALANCE_INCREMENT`（1 ETH）の倍数でなければなりません。これにより、この機能が即時出金に使われるのを防ぎます。\n- スイープと有効残高のロジックは、グローバルな最大値の代わりに、バリデータごとのしきい値を使います。\n\n## サンプルコード\n\nリクエストを組み立てて送信する例（ethers v6）。コントラクトのアドレスはまだ割り当てられていません。以下のしきい値の単位は、コンセンサスレイヤーの残高で使われる Gwei を前提としています。\n\n```ts\nimport { Contract, JsonRpcProvider, Wallet, concat, toBeHex, zeroPadValue } from \"ethers\";\n\nconst PREDEPLOY = process.env.SWEEP_THRESHOLD_CONTRACT!; // TBD in the EIP\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst wallet = new Wallet(process.env.PRIVATE_KEY!, provider);\n\nconst pubkey = \"0x\" + \"ab\".repeat(48);                         // 48-byte BLS pubkey\nconst thresholdGwei = 128n * 10n ** 9n;                        // 128 ETH, multiple of 1 ETH\nconst data = concat([pubkey, zeroPadValue(toBeHex(thresholdGwei), 8)]); // 56 bytes\n\nconst fee = BigInt(await provider.call({ to: PREDEPLOY, data: \"0x\" })); // fee getter\nawait wallet.sendTransaction({ to: PREDEPLOY, data, value: fee });\n```\n\n## 知っておくべきこと\n\n- ステータス: **Draft**。コントラクトのアドレス、デプロイトランザクション、完全なコンセンサス仕様はまだプレースホルダーです。\n- まったくの任意機能です。リクエストを一度も送らないバリデータは、これまでどおりの動作を保ちます。\n- リクエストは実行レイヤーから送られます。EIP-7002 と同様に `source_address` が記録され、コンセンサスレイヤーがそれをバリデータの出金クレデンシャルと照合できます。\n- しきい値を現在の残高より下げるには、まず希望の水準まで部分出金してから、新しいしきい値を設定します。\n- 手数料を多く払いすぎても返金されません。EIP-7002 と同様に、まず現在の手数料を読み取ってください。\n"},"ko":{"lang":"ko","tldr":"복리(0x02) 검증자가 고정된 2,048 ETH 대신, 보상이 출금 주소로 자동 스윕되는 잔액 기준을 새로운 실행 계층 요청 컨트랙트로 직접 정할 수 있게 한다.","tags":["staking","validators","withdrawals","consensus","core"],"related":[7251,7685,7002,4895],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-8148/","markdown":"## 어떤 문제를 해결하나요?\n\n[EIP-7251](/eip-7251/)은 검증자 잔액이 최대 2,048 ETH까지 늘어날 수 있게 하는 복리 출금 자격 증명(`0x02`)을 도입했습니다. 문제는 자동 보상 스윕이 그 2,048 ETH 상한을 넘을 때만 작동한다는 점입니다. 정기적인 지급을 원하는 32 ETH나 128 ETH 검증자는 부분 출금을 수동으로 실행해야 하고, 그때마다 트랜잭션이 필요하며 대기 시간이 네트워크 상황에 따라 달라지는 큐를 거칩니다.\n\n저자들은 이를 `0x02`로 전환한 검증자가 적은 이유 중 하나로 듭니다. EIP-8148은 각 복리 검증자가 자신의 스윕 기준을 정할 수 있게 하여, 예컨대 128 ETH를 넘는 보상이 일반 출금 스윕을 통해 자동으로 나가게 합니다.\n\n## 어떻게 동작하나요?\n\n**실행 계층.** 새 시스템 컨트랙트(주소는 아직 미정)가 *스윕 기준 설정* 요청을 받으며, [EIP-7002](/eip-7002/)의 출금 요청 컨트랙트를 본떴습니다.\n\n- calldata는 정확히 56바이트입니다. 48바이트 검증자 공개 키 뒤에 8바이트 빅엔디언 `uint64` 기준값이 옵니다. 호출자는 최소한 현재 수수료를 보내야 합니다.\n- calldata가 비어 있으면 현재 수수료를 반환합니다. 블록당 평균 2개를 넘는 요청이 큐에 쌓이면 수수료가 지수적으로 오릅니다(`fake_exponential`, 최소 수수료 1 wei, 업데이트 분율 17).\n- 각 블록이 끝날 때 시스템 호출이 최대 16개의 요청을 큐에서 꺼내 타입 `0x05`의 [EIP-7685](/eip-7685/) 요청으로 내보냅니다.\n\n**합의 계층.**\n\n- `BeaconState`에 `validator_sweep_thresholds` 리스트가 추가됩니다. 기존 `0x02` 검증자의 기본값은 `MAX_EFFECTIVE_BALANCE_ELECTRA`(2,048 ETH)이고, `0x00` / `0x01` 검증자는 0입니다.\n- 새 `0x02` 검증자는 예치 시점에 출금 자격 증명의 10~11번째 바이트로 초기 기준값을 설정할 수 있습니다. 바이트가 0이면 기본값을 뜻합니다.\n- 요청은 기준값을 현재 잔액 이상의 값으로만 바꿀 수 있으며, `EFFECTIVE_BALANCE_INCREMENT`(1 ETH)의 배수여야 합니다. 이렇게 해서 이 기능이 즉시 출금 수단으로 쓰이는 것을 막습니다.\n- 스윕과 유효 잔액 로직은 전역 최댓값 대신 검증자별 기준값을 사용합니다.\n\n## 샘플 코드\n\n요청을 만들어 보내는 예(ethers v6). 컨트랙트 주소는 아직 할당되지 않았으며, 아래 기준값 단위는 합의 계층 잔액에 쓰이는 Gwei라고 가정합니다.\n\n```ts\nimport { Contract, JsonRpcProvider, Wallet, concat, toBeHex, zeroPadValue } from \"ethers\";\n\nconst PREDEPLOY = process.env.SWEEP_THRESHOLD_CONTRACT!; // TBD in the EIP\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst wallet = new Wallet(process.env.PRIVATE_KEY!, provider);\n\nconst pubkey = \"0x\" + \"ab\".repeat(48);                         // 48-byte BLS pubkey\nconst thresholdGwei = 128n * 10n ** 9n;                        // 128 ETH, multiple of 1 ETH\nconst data = concat([pubkey, zeroPadValue(toBeHex(thresholdGwei), 8)]); // 56 bytes\n\nconst fee = BigInt(await provider.call({ to: PREDEPLOY, data: \"0x\" })); // fee getter\nawait wallet.sendTransaction({ to: PREDEPLOY, data, value: fee });\n```\n\n## 알아둘 점\n\n- 상태: **Draft**. 컨트랙트 주소, 배포 트랜잭션, 전체 합의 스펙은 아직 플레이스홀더입니다.\n- 완전히 선택 사항입니다. 요청을 한 번도 보내지 않는 검증자는 지금처럼 동작합니다.\n- 요청은 실행 계층에서 보냅니다. EIP-7002와 마찬가지로 `source_address`가 기록되어, 합의 계층이 이를 검증자의 출금 자격 증명과 대조할 수 있습니다.\n- 기준값을 현재 잔액보다 낮추려면, 먼저 원하는 수준까지 부분 출금한 뒤 새 기준값을 설정하세요.\n- 수수료를 더 내도 환불되지 않습니다. EIP-7002와 마찬가지로 현재 수수료를 먼저 읽어 보세요.\n"},"zh":{"lang":"zh","tldr":"让复利（0x02）验证者通过新的执行层请求合约，自行选择超过多少余额后奖励会被自动清扫到提款地址，而不是固定的 2,048 ETH。","tags":["staking","validators","withdrawals","consensus","core"],"related":[7251,7685,7002,4895],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-8148/","markdown":"## 它解决什么问题？\n\n[EIP-7251](/eip-7251/) 引入了复利提款凭证（`0x02`），让验证者余额可以增长到 2,048 ETH。问题在于：自动奖励清扫只有在超过这个 2,048 ETH 上限之后才会启动。想要定期获得收益的 32 ETH 或 128 ETH 验证者，必须手动触发部分提款，每次都要一笔交易，并且要经过一个等待时间取决于网络状况的队列。\n\n作者将此列为很少有验证者切换到 `0x02` 的原因之一。EIP-8148 允许每个复利验证者设置自己的清扫阈值，这样超过比如 128 ETH 的奖励就会通过正常的提款清扫自动流出。\n\n## 它如何运作\n\n**执行层。** 新的系统合约（地址仍待定）接受*设置清扫阈值*请求，其设计参照 [EIP-7002](/eip-7002/) 的提款请求合约：\n\n- calldata 恰好 56 字节：48 字节的验证者公钥，后接 8 字节大端序 `uint64` 阈值。调用者必须至少发送当前费用。\n- calldata 为空时返回当前费用。当平均每个区块排队的请求超过 2 个时，费用会呈指数级上涨（`fake_exponential`，最低费用 1 wei，更新分数 17）。\n- 每个区块结束时，一次系统调用最多出队 16 个请求，并将它们作为类型 `0x05` 的 [EIP-7685](/eip-7685/) 请求发出。\n\n**共识层。**\n\n- `BeaconState` 新增 `validator_sweep_thresholds` 列表；现有 `0x02` 验证者默认为 `MAX_EFFECTIVE_BALANCE_ELECTRA`（2,048 ETH），`0x00` / `0x01` 验证者为 0。\n- 新的 `0x02` 验证者可以在存款时通过其提款凭证的第 10–11 字节设置初始阈值；字节为零表示使用默认值。\n- 请求只能把阈值改为大于等于当前余额的值，并且必须是 `EFFECTIVE_BALANCE_INCREMENT`（1 ETH）的整数倍。这样可以防止该功能被用作即时提款。\n- 清扫和有效余额逻辑使用每个验证者各自的阈值，而不是全局最大值。\n\n## 示例代码\n\n构造并发送请求（ethers v6）。合约地址尚未分配；下面的阈值单位假定为 Gwei，与共识层余额所用单位一致。\n\n```ts\nimport { Contract, JsonRpcProvider, Wallet, concat, toBeHex, zeroPadValue } from \"ethers\";\n\nconst PREDEPLOY = process.env.SWEEP_THRESHOLD_CONTRACT!; // TBD in the EIP\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst wallet = new Wallet(process.env.PRIVATE_KEY!, provider);\n\nconst pubkey = \"0x\" + \"ab\".repeat(48);                         // 48-byte BLS pubkey\nconst thresholdGwei = 128n * 10n ** 9n;                        // 128 ETH, multiple of 1 ETH\nconst data = concat([pubkey, zeroPadValue(toBeHex(thresholdGwei), 8)]); // 56 bytes\n\nconst fee = BigInt(await provider.call({ to: PREDEPLOY, data: \"0x\" })); // fee getter\nawait wallet.sendTransaction({ to: PREDEPLOY, data, value: fee });\n```\n\n## 需要注意\n\n- 状态：**Draft**。合约地址、部署交易和完整的共识规范仍是占位内容。\n- 完全可选：从未发送请求的验证者保持现在的行为。\n- 请求从执行层发出；与 EIP-7002 一样，会记录 `source_address`，以便共识层将其与验证者的提款凭证进行核对。\n- 要把阈值降到当前余额以下，先部分提款到想要的水平，再设置新的阈值。\n- 多付的费用不会退还；与 EIP-7002 一样，请先读取当前费用。\n"}}}
