{"eip":3045,"title":"Adds `baseFee` to `eth_getUncleByBlockHashAndIndex`","description":"Add basefee field to ethgetUncleByBlockHashAndIndex RPC endpoint response.","authors":["Abdelhamid Bakhta (@abdelhamidbakhta)"],"status":"Stagnant","type":"Standards Track","category":"Interface","created":"2020-10-14","requires":[1474,1559],"discussionsTo":"https://ethereum-magicians.org/t/add-basefee-to-eth-getunclebyblockhashandindex/4829","repo":"EIPs","label":"EIP-3045","officialUrl":"https://eips.ethereum.org/EIPS/eip-3045","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-3045.md","url":"https://eips.huatuo.xyz/eip-3045/","tldr":{"en":"A stagnant proposal to add a `baseFee` field to the block object returned by `eth_getUncleByBlockHashAndIndex` for blocks after the EIP-1559 fork.","ja":"EIP-1559 フォーク以降のブロックについて、`eth_getUncleByBlockHashAndIndex` が返すブロックオブジェクトに `baseFee` フィールドを追加するという、停滞中（Stagnant）の提案。","ko":"EIP-1559 포크 이후의 블록에 대해 `eth_getUncleByBlockHashAndIndex`가 반환하는 블록 객체에 `baseFee` 필드를 추가하자는 정체(Stagnant) 상태의 제안.","zh":"一项停滞（Stagnant）的提案：对于 EIP-1559 分叉之后的区块，在 `eth_getUncleByBlockHashAndIndex` 返回的区块对象中增加 `baseFee` 字段。"},"tags":["json-rpc","api","fees","uncles","interface"],"explainers":{"en":{"lang":"en","tldr":"A stagnant proposal to add a `baseFee` field to the block object returned by `eth_getUncleByBlockHashAndIndex` for blocks after the EIP-1559 fork.","tags":["json-rpc","api","fees","uncles","interface"],"related":[1559,1474,3198],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-3045/","markdown":"## What problem does it solve?\n\n[EIP-1559](/eip-1559/) added a base fee per gas to every block header. Tools that estimate gas prices or analyze fee history need to read that value through JSON-RPC, and the RPC responses had to grow a field for it.\n\nEIP-3045 covers one specific endpoint: `eth_getUncleByBlockHashAndIndex`, which returns the header of an uncle (ommer) block. Since uncle headers also carry a base fee after the fork, the response should expose it.\n\n## How it works\n\nThe request parameters are unchanged: a block hash and an uncle index. Only the result changes:\n\n- For uncle blocks **on or after** the EIP-1559 fork block, the result **must** include `baseFee`, a hex-encoded quantity as defined in [EIP-1474](/eip-1474/).\n- For blocks **before** the fork, the result **must not** include the field.\n\nAdding one field instead of a new endpoint was chosen as the simplest change to integrate, and omitting it for older blocks keeps existing consumers working.\n\n## Sample code\n\nJSON-RPC request and the relevant part of the response, as proposed:\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1559,\n  \"method\": \"eth_getUncleByBlockHashAndIndex\",\n  \"params\": [\"0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b\", \"0x0\"]\n}\n```\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1559,\n  \"result\": {\n    \"number\": \"0x1b4\",\n    \"baseFee\": \"0x7\",\n    \"gasLimit\": \"0x9f759\",\n    \"gasUsed\": \"0x9f759\"\n  }\n}\n```\n\nReading an uncle header from TypeScript (ethers v6):\n\n```ts\nimport { JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst uncle = await provider.send(\"eth_getUncleByBlockHashAndIndex\", [blockHash, \"0x0\"]);\n// Clients expose the field as `baseFeePerGas`, not the `baseFee` name proposed here\nconsole.log(uncle?.baseFeePerGas ?? uncle?.baseFee);\n```\n\n## Things to know\n\n- Status is **Stagnant**. It was never finalized, and the field name proposed here (`baseFee`) is not what clients ship: Ethereum clients return `baseFeePerGas` in block and header objects.\n- The JSON-RPC API it extends, [EIP-1474](/eip-1474/), is itself Stagnant; the maintained reference is the `ethereum/execution-apis` specification.\n- Since The Merge, proof-of-stake Ethereum produces no uncle blocks, so this endpoint is only relevant for historical proof-of-work blocks.\n- Inside contracts, the current block's base fee is available via the `BASEFEE` opcode from [EIP-3198](/eip-3198/).\n"},"ja":{"lang":"ja","tldr":"EIP-1559 フォーク以降のブロックについて、`eth_getUncleByBlockHashAndIndex` が返すブロックオブジェクトに `baseFee` フィールドを追加するという、停滞中（Stagnant）の提案。","tags":["json-rpc","api","fees","uncles","interface"],"related":[1559,1474,3198],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-3045/","markdown":"## 何を解決するのか\n\n[EIP-1559](/eip-1559/) は、すべてのブロックヘッダーにガスあたりのベースフィーを追加しました。ガス価格を見積もったり手数料履歴を分析したりするツールは、この値を JSON-RPC 経由で読み取る必要があり、RPC のレスポンスにもそのためのフィールドが必要でした。\n\nEIP-3045 は特定の 1 つのエンドポイント、`eth_getUncleByBlockHashAndIndex` を対象とします。これはアンクル（ommer）ブロックのヘッダーを返します。フォーク以降はアンクルのヘッダーにもベースフィーが含まれるため、レスポンスでもそれを公開すべきです。\n\n## 仕組み\n\nリクエストのパラメーターは変わらず、ブロックハッシュとアンクルのインデックスです。変わるのは結果だけです。\n\n- EIP-1559 のフォークブロック**以降**のアンクルブロックでは、結果に `baseFee` を**含めなければなりません**。値は [EIP-1474](/eip-1474/) で定義された 16 進エンコードの数量です。\n- フォーク**以前**のブロックでは、結果にこのフィールドを**含めてはなりません**。\n\n新しいエンドポイントではなくフィールドを 1 つ追加する方法が選ばれたのは、組み込みが最も簡単な変更だからです。古いブロックでは省略することで、既存の利用側が動作し続けます。\n\n## サンプルコード\n\n提案どおりの JSON-RPC リクエストと、レスポンスの該当部分:\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1559,\n  \"method\": \"eth_getUncleByBlockHashAndIndex\",\n  \"params\": [\"0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b\", \"0x0\"]\n}\n```\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1559,\n  \"result\": {\n    \"number\": \"0x1b4\",\n    \"baseFee\": \"0x7\",\n    \"gasLimit\": \"0x9f759\",\n    \"gasUsed\": \"0x9f759\"\n  }\n}\n```\n\nTypeScript（ethers v6）でアンクルのヘッダーを読む例:\n\n```ts\nimport { JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst uncle = await provider.send(\"eth_getUncleByBlockHashAndIndex\", [blockHash, \"0x0\"]);\n// Clients expose the field as `baseFeePerGas`, not the `baseFee` name proposed here\nconsole.log(uncle?.baseFeePerGas ?? uncle?.baseFee);\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** です。確定には至らず、ここで提案されたフィールド名（`baseFee`）はクライアントが実際に出荷しているものとは異なります。Ethereum クライアントは、ブロックやヘッダーのオブジェクトで `baseFeePerGas` を返します。\n- 拡張対象の JSON-RPC API である [EIP-1474](/eip-1474/) 自体が Stagnant です。維持されている参照仕様は `ethereum/execution-apis` の仕様です。\n- The Merge 以降、プルーフ・オブ・ステークの Ethereum はアンクルブロックを生成しないため、このエンドポイントが関係するのは過去のプルーフ・オブ・ワークのブロックだけです。\n- コントラクト内では、現在のブロックのベースフィーは [EIP-3198](/eip-3198/) の `BASEFEE` オペコードで取得できます。\n"},"ko":{"lang":"ko","tldr":"EIP-1559 포크 이후의 블록에 대해 `eth_getUncleByBlockHashAndIndex`가 반환하는 블록 객체에 `baseFee` 필드를 추가하자는 정체(Stagnant) 상태의 제안.","tags":["json-rpc","api","fees","uncles","interface"],"related":[1559,1474,3198],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-3045/","markdown":"## 어떤 문제를 해결하나요?\n\n[EIP-1559](/eip-1559/)는 모든 블록 헤더에 gas당 기본 수수료(base fee)를 추가했습니다. gas 가격을 추정하거나 수수료 이력을 분석하는 도구는 이 값을 JSON-RPC로 읽어야 하므로, RPC 응답에도 이를 위한 필드가 필요했습니다.\n\nEIP-3045는 특정한 엔드포인트 하나, 즉 엉클(ommer) 블록의 헤더를 반환하는 `eth_getUncleByBlockHashAndIndex`를 다룹니다. 포크 이후에는 엉클 헤더도 기본 수수료를 담고 있으므로, 응답에도 이를 노출해야 합니다.\n\n## 어떻게 동작하나요?\n\n요청 매개변수는 그대로이며 블록 해시와 엉클 인덱스입니다. 결과만 바뀝니다.\n\n- EIP-1559 포크 블록**부터** 이후의 엉클 블록에서는 결과에 `baseFee`를 **반드시 포함해야** 하며, 이는 [EIP-1474](/eip-1474/)에서 정의한 16진수 인코딩 수량입니다.\n- 포크 **이전** 블록에서는 결과에 이 필드를 **포함해서는 안 됩니다**.\n\n새 엔드포인트 대신 필드 하나를 추가한 것은 연동하기 가장 쉬운 변경이기 때문이며, 이전 블록에서는 생략하므로 기존 소비자가 계속 동작합니다.\n\n## 샘플 코드\n\n제안된 대로의 JSON-RPC 요청과 응답의 관련 부분:\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1559,\n  \"method\": \"eth_getUncleByBlockHashAndIndex\",\n  \"params\": [\"0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b\", \"0x0\"]\n}\n```\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1559,\n  \"result\": {\n    \"number\": \"0x1b4\",\n    \"baseFee\": \"0x7\",\n    \"gasLimit\": \"0x9f759\",\n    \"gasUsed\": \"0x9f759\"\n  }\n}\n```\n\nTypeScript(ethers v6)로 엉클 헤더 읽기:\n\n```ts\nimport { JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst uncle = await provider.send(\"eth_getUncleByBlockHashAndIndex\", [blockHash, \"0x0\"]);\n// Clients expose the field as `baseFeePerGas`, not the `baseFee` name proposed here\nconsole.log(uncle?.baseFeePerGas ?? uncle?.baseFee);\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**입니다. 확정된 적이 없으며, 여기서 제안한 필드 이름(`baseFee`)은 클라이언트가 실제로 제공하는 이름이 아닙니다. 이더리움 클라이언트는 블록과 헤더 객체에서 `baseFeePerGas`를 반환합니다.\n- 이 제안이 확장하는 JSON-RPC API인 [EIP-1474](/eip-1474/) 자체가 Stagnant이며, 유지되는 참조 문서는 `ethereum/execution-apis` 명세입니다.\n- 더 머지(The Merge) 이후 지분증명 이더리움은 엉클 블록을 만들지 않으므로, 이 엔드포인트는 과거 작업증명 블록에만 의미가 있습니다.\n- 컨트랙트 안에서는 현재 블록의 기본 수수료를 [EIP-3198](/eip-3198/)의 `BASEFEE` 옵코드로 얻을 수 있습니다.\n"},"zh":{"lang":"zh","tldr":"一项停滞（Stagnant）的提案：对于 EIP-1559 分叉之后的区块，在 `eth_getUncleByBlockHashAndIndex` 返回的区块对象中增加 `baseFee` 字段。","tags":["json-rpc","api","fees","uncles","interface"],"related":[1559,1474,3198],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-3045/","markdown":"## 它解决什么问题？\n\n[EIP-1559](/eip-1559/) 为每个区块头增加了每单位 gas 的基础费用。估算 gas 价格或分析费用历史的工具需要通过 JSON-RPC 读取这个值，因此 RPC 响应也必须为它增加一个字段。\n\nEIP-3045 只涉及一个特定的端点：`eth_getUncleByBlockHashAndIndex`，它返回叔块（uncle，也称 ommer）的区块头。由于分叉之后叔块的区块头也带有基础费用，响应中也应当提供它。\n\n## 它如何运作\n\n请求参数不变：一个区块哈希和一个叔块索引。只有结果改变：\n\n- 对于 EIP-1559 分叉区块**当时及之后**的叔块，结果**必须**包含 `baseFee`，其为 [EIP-1474](/eip-1474/) 中定义的十六进制编码数量。\n- 对于分叉**之前**的区块，结果**不得**包含该字段。\n\n选择增加一个字段而不是新增端点，是因为这是最容易集成的改动；对旧区块省略该字段，则能让现有的使用方继续正常工作。\n\n## 示例代码\n\n按提案给出的 JSON-RPC 请求和响应的相关部分：\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1559,\n  \"method\": \"eth_getUncleByBlockHashAndIndex\",\n  \"params\": [\"0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b\", \"0x0\"]\n}\n```\n\n```json\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1559,\n  \"result\": {\n    \"number\": \"0x1b4\",\n    \"baseFee\": \"0x7\",\n    \"gasLimit\": \"0x9f759\",\n    \"gasUsed\": \"0x9f759\"\n  }\n}\n```\n\n用 TypeScript（ethers v6）读取叔块区块头：\n\n```ts\nimport { JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst uncle = await provider.send(\"eth_getUncleByBlockHashAndIndex\", [blockHash, \"0x0\"]);\n// Clients expose the field as `baseFeePerGas`, not the `baseFee` name proposed here\nconsole.log(uncle?.baseFeePerGas ?? uncle?.baseFee);\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**。它从未最终确定，这里提议的字段名（`baseFee`）也不是客户端实际使用的名字：以太坊客户端在区块和区块头对象中返回的是 `baseFeePerGas`。\n- 它所扩展的 JSON-RPC API，即 [EIP-1474](/eip-1474/)，本身也是 Stagnant；目前维护的参考规范是 `ethereum/execution-apis`。\n- 自合并（The Merge）以来，权益证明的以太坊不再产生叔块，所以这个端点只与历史上的工作量证明区块有关。\n- 在合约内部，可以通过 [EIP-3198](/eip-3198/) 的 `BASEFEE` 操作码获取当前区块的基础费用。\n"}}}
