{"eip":7685,"title":"General purpose execution layer requests","description":"A general purpose bus for sharing EL triggered requests with the CL","authors":["lightclient (@lightclient)","Felix Lange (@fjl)"],"status":"Final","type":"Standards Track","category":"Core","created":"2024-04-14","discussionsTo":"https://ethereum-magicians.org/t/eip-7685-general-purpose-execution-layer-requests/19668","repo":"EIPs","label":"EIP-7685","officialUrl":"https://eips.ethereum.org/EIPS/eip-7685","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7685.md","url":"https://eips.huatuo.xyz/eip-7685/","tldr":{"en":"A generic channel in the execution block header for contract-triggered requests (deposits, withdrawals, consolidations) that the consensus layer then processes, shipped in Pectra.","ja":"コントラクトが引き起こすリクエスト（deposit、引き出し、統合）を実行ブロックヘッダーで運び、コンセンサスレイヤーが処理するための汎用チャネル。Pectra で導入された。","ko":"컨트랙트가 일으키는 요청(예치, 인출, 통합)을 실행 블록 헤더에 담아 합의 계층이 처리하도록 하는 범용 채널. Pectra에서 출시되었다.","zh":"在执行区块头中为合约触发的请求（存款、提款、合并）提供一个通用通道，再由共识层处理，已随 Pectra 上线。"},"tags":["core","consensus","staking","pectra","block-header"],"explainers":{"en":{"lang":"en","tldr":"A generic channel in the execution block header for contract-triggered requests (deposits, withdrawals, consolidations) that the consensus layer then processes, shipped in Pectra.","tags":["core","consensus","staking","pectra","block-header"],"related":[6110,7002,7251,7600],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7685/","markdown":"## What problem does it solve?\n\nMore and more validators are controlled by smart contracts: staking pools, restaking protocols, DAO-run node sets. Those contracts often need to tell the beacon chain to do something, such as exit a validator or move its balance. Before Pectra, only the validator's signing key could trigger many of these actions, so contract-controlled setups had to rely on a trusted operator holding that key.\n\nEach new \"the execution layer asks the consensus layer to do X\" feature could have added its own field to the block header. EIP-7685 instead defines one general-purpose bus, so new request types can be added without changing the block structure again.\n\n## How it works\n\n- A **request** list for one type is a single byte string: `request_type ++ request_data`. The type is one byte; the data is opaque to this EIP and each request type defines its own encoding.\n- While processing a block, the execution client collects request lists of different types, typically by reading system contracts at the end of the block.\n- The header gets one new 32-byte field, **`requests_hash`**, committing to all of them:\n\n```python\ndef compute_requests_hash(block_requests):\n    m = sha256()\n    for r in block_requests:          # ordered by request_type, ascending\n        if len(r) \u003e 1:                # skip types with empty request_data\n            m.update(sha256(r).digest())\n    return m.digest()\n```\n\n- Requests are ordered by type ascending; ordering inside one type is left to that type's EIP. Empty lists are skipped, so a block with no requests always has `requests_hash = sha256(b\"\")`.\n- The consensus layer receives the actual request data and validates and applies it. They are called \"requests\" because the execution layer cannot fully check them; the beacon chain has the final say.\n\nRequest types activated in the Pectra upgrade ([EIP-7600](/eip-7600/)):\n\n| Type | Request | Defined in |\n| --- | --- | --- |\n| `0x00` | Validator deposits | [EIP-6110](/eip-6110/) |\n| `0x01` | Withdrawals / exits triggered from the EL | [EIP-7002](/eip-7002/) |\n| `0x02` | Consolidations | [EIP-7251](/eip-7251/) |\n\n## Sample code\n\nComputing `requests_hash` in TypeScript (ethers v6), given the per-type byte strings:\n\n```ts\nimport { sha256, concat, getBytes } from \"ethers\";\n\n// Each entry: one byte type prefix followed by that type's request_data.\nexport function requestsHash(requests: Uint8Array[]): string {\n  const sorted = [...requests].sort((a, b) =\u003e a[0] - b[0]);\n  const parts = sorted\n    .filter((r) =\u003e r.length \u003e 1)          // drop empty request lists\n    .map((r) =\u003e getBytes(sha256(r)));\n  return sha256(parts.length ? concat(parts) : new Uint8Array());\n}\n\n// No requests at all → sha256 of empty input\nconsole.log(requestsHash([])); // 0xe3b0c442...b855\n```\n\n## Things to know\n\n- Status is **Final**; it went live with Pectra together with the three request types above.\n- This EIP does not say where requests come from or how they are validated. The authors recommend system contracts that store requests and are drained by a post-block system call, which is how EIP-7002 and EIP-7251 work.\n- `request_data` is deliberately opaque bytes rather than RLP, leaving room for SSZ or fixed-width formats in future request types.\n- Engine API messages between execution and consensus clients carry the full request lists so the beacon node can process them and check them against `requests_hash`.\n"},"ja":{"lang":"ja","tldr":"コントラクトが引き起こすリクエスト（deposit、引き出し、統合）を実行ブロックヘッダーで運び、コンセンサスレイヤーが処理するための汎用チャネル。Pectra で導入された。","tags":["core","consensus","staking","pectra","block-header"],"related":[6110,7002,7251,7600],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7685/","markdown":"## 何を解決するのか\n\nバリデーターがスマートコントラクトによって制御されるケースが増えています。ステーキングプール、リステーキングプロトコル、DAO が運営するノード群などです。これらのコントラクトは、バリデーターの退出や残高の移動など、ビーコンチェーンに何かをさせたい場面がよくあります。Pectra 以前は、こうした操作の多くをバリデーターの署名鍵でしか実行できなかったため、コントラクト制御の構成では、その鍵を持つ信頼されたオペレーターに頼らざるを得ませんでした。\n\n「実行レイヤーがコンセンサスレイヤーに X をさせる」という機能を新しく作るたびに、ブロックヘッダーへ専用のフィールドを追加することもできました。EIP-7685 は代わりに 1 本の汎用バスを定義します。これにより、ブロック構造を再び変更することなく、新しいリクエストタイプを追加できます。\n\n## 仕組み\n\n- 1 つのタイプの**リクエスト**リストは、単一のバイト列 `request_type ++ request_data` です。タイプは 1 バイトで、データはこの EIP からは不透明であり、各リクエストタイプが独自のエンコーディングを定義します。\n- ブロックの処理中、実行クライアントは異なるタイプのリクエストリストを集めます。通常は、ブロック末尾でシステムコントラクトを読み取ります。\n- ヘッダーには、それらすべてにコミットする 32 バイトの新しいフィールド **`requests_hash`** が 1 つ加わります。\n\n```python\ndef compute_requests_hash(block_requests):\n    m = sha256()\n    for r in block_requests:          # ordered by request_type, ascending\n        if len(r) \u003e 1:                # skip types with empty request_data\n            m.update(sha256(r).digest())\n    return m.digest()\n```\n\n- リクエストはタイプの昇順に並べます。1 つのタイプ内の順序は、そのタイプの EIP に委ねられます。空のリストはスキップされるため、リクエストが 1 つもないブロックの `requests_hash` は常に `sha256(b\"\")` になります。\n- コンセンサスレイヤーは実際のリクエストデータを受け取り、検証して適用します。「リクエスト」と呼ばれるのは、実行レイヤーが完全には検証できないからで、最終的な判断はビーコンチェーンが行います。\n\nPectra アップグレード（[EIP-7600](/eip-7600/)）で有効化されたリクエストタイプ:\n\n| タイプ | リクエスト | 定義元 |\n| --- | --- | --- |\n| `0x00` | バリデーターの deposit | [EIP-6110](/eip-6110/) |\n| `0x01` | EL から起動する引き出し / 退出 | [EIP-7002](/eip-7002/) |\n| `0x02` | 統合（consolidation） | [EIP-7251](/eip-7251/) |\n\n## サンプルコード\n\nタイプごとのバイト列が与えられたときに、`requests_hash` を TypeScript（ethers v6）で計算する例:\n\n```ts\nimport { sha256, concat, getBytes } from \"ethers\";\n\n// Each entry: one byte type prefix followed by that type's request_data.\nexport function requestsHash(requests: Uint8Array[]): string {\n  const sorted = [...requests].sort((a, b) =\u003e a[0] - b[0]);\n  const parts = sorted\n    .filter((r) =\u003e r.length \u003e 1)          // drop empty request lists\n    .map((r) =\u003e getBytes(sha256(r)));\n  return sha256(parts.length ? concat(parts) : new Uint8Array());\n}\n\n// No requests at all → sha256 of empty input\nconsole.log(requestsHash([])); // 0xe3b0c442...b855\n```\n\n## 知っておくべきこと\n\n- ステータスは **Final** です。上記 3 つのリクエストタイプとともに Pectra で稼働しました。\n- この EIP は、リクエストがどこから来るのか、どう検証されるのかを定めていません。著者は、リクエストを保存し、ブロック後のシステムコールで取り出されるシステムコントラクトを推奨しており、EIP-7002 と EIP-7251 はこの方式で動いています。\n- `request_data` は RLP ではなく、意図的に不透明なバイト列になっています。将来のリクエストタイプで SSZ や固定幅の形式を使う余地を残すためです。\n- 実行クライアントとコンセンサスクライアントの間の Engine API メッセージは、リクエストリストの全体を運びます。これにより、ビーコンノードはそれを処理し、`requests_hash` と照合できます。\n"},"ko":{"lang":"ko","tldr":"컨트랙트가 일으키는 요청(예치, 인출, 통합)을 실행 블록 헤더에 담아 합의 계층이 처리하도록 하는 범용 채널. Pectra에서 출시되었다.","tags":["core","consensus","staking","pectra","block-header"],"related":[6110,7002,7251,7600],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7685/","markdown":"## 어떤 문제를 해결하나요?\n\n스마트 컨트랙트가 제어하는 밸리데이터가 점점 늘고 있습니다. 스테이킹 풀, 리스테이킹 프로토콜, DAO가 운영하는 노드 집합 등입니다. 이런 컨트랙트는 밸리데이터를 퇴출하거나 잔액을 옮기는 등 비콘 체인에 무언가를 시켜야 할 때가 많습니다. Pectra 이전에는 이런 동작 다수를 밸리데이터의 서명 키만 트리거할 수 있었기 때문에, 컨트랙트가 제어하는 구성은 그 키를 가진 신뢰받는 운영자에 의존해야 했습니다.\n\n\"실행 계층이 합의 계층에 X를 요청한다\"는 기능이 새로 생길 때마다 블록 헤더에 전용 필드를 추가할 수도 있었습니다. EIP-7685는 대신 범용 버스 하나를 정의합니다. 덕분에 블록 구조를 다시 바꾸지 않고도 새로운 요청 유형을 추가할 수 있습니다.\n\n## 어떻게 동작하나요?\n\n- 한 유형의 **요청** 리스트는 하나의 바이트열 `request_type ++ request_data`입니다. 유형은 1바이트이고, 데이터는 이 EIP에게는 불투명하며 각 요청 유형이 자체 인코딩을 정의합니다.\n- 블록을 처리하는 동안 실행 클라이언트는 서로 다른 유형의 요청 리스트를 모읍니다. 보통 블록 끝에서 시스템 컨트랙트를 읽어 수집합니다.\n- 헤더에는 이 모든 것을 커밋하는 32바이트 필드 **`requests_hash`**가 새로 하나 추가됩니다.\n\n```python\ndef compute_requests_hash(block_requests):\n    m = sha256()\n    for r in block_requests:          # ordered by request_type, ascending\n        if len(r) \u003e 1:                # skip types with empty request_data\n            m.update(sha256(r).digest())\n    return m.digest()\n```\n\n- 요청은 유형의 오름차순으로 정렬합니다. 한 유형 안의 순서는 그 유형의 EIP에 맡깁니다. 빈 리스트는 건너뛰므로 요청이 하나도 없는 블록의 `requests_hash`는 항상 `sha256(b\"\")`입니다.\n- 합의 계층은 실제 요청 데이터를 받아 검증하고 적용합니다. \"요청\"이라고 부르는 이유는 실행 계층이 이를 완전히 검증할 수 없고, 최종 결정권이 비콘 체인에 있기 때문입니다.\n\nPectra 업그레이드([EIP-7600](/eip-7600/))에서 활성화된 요청 유형:\n\n| 유형 | 요청 | 정의된 곳 |\n| --- | --- | --- |\n| `0x00` | 밸리데이터 예치 | [EIP-6110](/eip-6110/) |\n| `0x01` | EL에서 트리거하는 인출 / 퇴출 | [EIP-7002](/eip-7002/) |\n| `0x02` | 통합(consolidation) | [EIP-7251](/eip-7251/) |\n\n## 샘플 코드\n\n유형별 바이트열이 주어졌을 때 TypeScript(ethers v6)로 `requests_hash`를 계산하는 예입니다.\n\n```ts\nimport { sha256, concat, getBytes } from \"ethers\";\n\n// Each entry: one byte type prefix followed by that type's request_data.\nexport function requestsHash(requests: Uint8Array[]): string {\n  const sorted = [...requests].sort((a, b) =\u003e a[0] - b[0]);\n  const parts = sorted\n    .filter((r) =\u003e r.length \u003e 1)          // drop empty request lists\n    .map((r) =\u003e getBytes(sha256(r)));\n  return sha256(parts.length ? concat(parts) : new Uint8Array());\n}\n\n// No requests at all → sha256 of empty input\nconsole.log(requestsHash([])); // 0xe3b0c442...b855\n```\n\n## 알아둘 점\n\n- 상태는 **Final**입니다. 위의 세 가지 요청 유형과 함께 Pectra에서 가동되었습니다.\n- 이 EIP는 요청이 어디서 오는지, 어떻게 검증하는지 정하지 않습니다. 저자들은 요청을 저장하고 블록 이후의 시스템 호출로 비워지는 시스템 컨트랙트를 권장하며, EIP-7002와 EIP-7251이 이렇게 동작합니다.\n- `request_data`는 RLP가 아니라 의도적으로 불투명한 바이트입니다. 향후 요청 유형에서 SSZ나 고정 폭 형식을 쓸 여지를 남기기 위해서입니다.\n- 실행 클라이언트와 합의 클라이언트 사이의 Engine API 메시지는 전체 요청 리스트를 담고 있어, 비콘 노드가 이를 처리하고 `requests_hash`와 대조할 수 있습니다.\n"},"zh":{"lang":"zh","tldr":"在执行区块头中为合约触发的请求（存款、提款、合并）提供一个通用通道，再由共识层处理，已随 Pectra 上线。","tags":["core","consensus","staking","pectra","block-header"],"related":[6110,7002,7251,7600],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7685/","markdown":"## 它解决什么问题？\n\n越来越多的验证者由智能合约控制：质押池、再质押协议、由 DAO 运营的节点集合。这些合约常常需要通知信标链做某件事，比如让某个验证者退出，或转移它的余额。在 Pectra 之前，许多此类操作只能由验证者的签名密钥触发，因此由合约控制的方案不得不依赖持有该密钥的受信任运营者。\n\n每增加一个\"执行层要求共识层做 X\"的功能，原本都可能要在区块头里加一个专用字段。EIP-7685 则定义了一条通用总线，这样新增请求类型时无需再次改动区块结构。\n\n## 它如何运作\n\n- 某一类型的**请求**列表是一个字节串：`request_type ++ request_data`。类型占一个字节；数据对本 EIP 而言是不透明的，每种请求类型自行定义编码。\n- 处理区块时，执行客户端收集不同类型的请求列表，通常是在区块末尾读取系统合约。\n- 区块头新增一个 32 字节字段 **`requests_hash`**，对所有请求做出承诺：\n\n```python\ndef compute_requests_hash(block_requests):\n    m = sha256()\n    for r in block_requests:          # ordered by request_type, ascending\n        if len(r) \u003e 1:                # skip types with empty request_data\n            m.update(sha256(r).digest())\n    return m.digest()\n```\n\n- 请求按类型升序排列；同一类型内部的顺序由该类型的 EIP 决定。空列表会被跳过，所以没有任何请求的区块，其 `requests_hash` 恒为 `sha256(b\"\")`。\n- 共识层接收实际的请求数据，对其验证并应用。之所以称为\"请求\"，是因为执行层无法完全验证它们，最终决定权在信标链。\n\n在 Pectra 升级中激活的请求类型（[EIP-7600](/eip-7600/)）：\n\n| 类型 | 请求 | 定义于 |\n| --- | --- | --- |\n| `0x00` | 验证者存款 | [EIP-6110](/eip-6110/) |\n| `0x01` | 由 EL 触发的提款 / 退出 | [EIP-7002](/eip-7002/) |\n| `0x02` | 合并（consolidation） | [EIP-7251](/eip-7251/) |\n\n## 示例代码\n\n在 TypeScript（ethers v6）中计算 `requests_hash`，输入为各类型的字节串：\n\n```ts\nimport { sha256, concat, getBytes } from \"ethers\";\n\n// Each entry: one byte type prefix followed by that type's request_data.\nexport function requestsHash(requests: Uint8Array[]): string {\n  const sorted = [...requests].sort((a, b) =\u003e a[0] - b[0]);\n  const parts = sorted\n    .filter((r) =\u003e r.length \u003e 1)          // drop empty request lists\n    .map((r) =\u003e getBytes(sha256(r)));\n  return sha256(parts.length ? concat(parts) : new Uint8Array());\n}\n\n// No requests at all → sha256 of empty input\nconsole.log(requestsHash([])); // 0xe3b0c442...b855\n```\n\n## 需要注意\n\n- 状态为 **Final**：它已与上述三种请求类型一起随 Pectra 上线。\n- 本 EIP 没有规定请求从哪里来，也没有规定如何验证。作者推荐使用系统合约存储请求，并在区块后的系统调用中清空，EIP-7002 和 EIP-7251 就是这样工作的。\n- `request_data` 有意设计为不透明的字节，而不是 RLP，为未来的请求类型使用 SSZ 或定长格式留出空间。\n- 执行客户端与共识客户端之间的 Engine API 消息携带完整的请求列表，以便信标节点处理它们，并与 `requests_hash` 核对。\n"}},"requiredBy":[6110,7002,7251,7600,8148,8205,8282]}
