---
eip: 3041
label: EIP-3041
title: Adds `baseFee` to `eth_getBlockByHash`
status: Stagnant
type: Standards Track
category: Interface
created: 2020-10-13
requires: 1474, 1559
official: https://eips.ethereum.org/EIPS/eip-3041
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-3041.md
canonical: https://eips.huatuo.xyz/eip-3041/
lang: en
tldr: Proposed adding the EIP-1559 base fee to the block object returned by the eth_getBlockByHash JSON-RPC method, so tools can read the base fee of any post-London block.
tags: [json-rpc, base-fee, interface, gas, 1559]
---

# EIP-3041: Adds `baseFee` to `eth_getBlockByHash`

> Add basefee field to ethgetBlockByHash RPC endpoint response.

**TL;DR:** Proposed adding the EIP-1559 base fee to the block object returned by the eth_getBlockByHash JSON-RPC method, so tools can read the base fee of any post-London block.

## What problem does it solve?

[EIP-1559](/eip-1559/) added a protocol-level base fee per gas to every block header. Wallets, fee estimators and analytics tools need that value to predict fees and explain what users paid. Before London, the standard JSON-RPC block object had no field for it.

EIP-3041 proposed the smallest possible change: add one field to the existing `eth_getBlockByHash` response rather than inventing a new endpoint.

## How it works

- Parameters of `eth_getBlockByHash` are unchanged: the block hash and a boolean for full transaction objects.
- For blocks **on or after** the EIP-1559 fork, the `result` object **must** include a `baseFee` field, encoded as a hex `Quantity` (see [EIP-1474](/eip-1474/)).
- For blocks **before** the fork, the field **must not** be present. This keeps the response identical to the old format for historical blocks, so existing parsers do not break.
- The field is informational only and has no security implications.

## Sample code

Request:

```sh
curl -s -X POST -H 'Content-Type: application/json' --data '{
  "jsonrpc": "2.0", "id": 1,
  "method": "eth_getBlockByHash",
  "params": ["0x<block hash>", false]
}' "$RPC_URL"
```

Response as proposed (abridged):

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "number": "0x1b4",
    "hash": "0x...",
    "gasLimit": "0x9f759",
    "gasUsed": "0x9f759",
    "baseFee": "0x7"
  }
}
```

What clients actually return today, read via ethers v6:

```ts
import { JsonRpcProvider, formatUnits } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL);
const block = await provider.getBlock(blockHash);
console.log(formatUnits(block!.baseFeePerGas ?? 0n, "gwei")); // null for pre-London blocks
```

## Things to know

- **Status: Stagnant.** The idea shipped, but not under this name: Ethereum clients expose the value as **`baseFeePerGas`** on the block object returned by `eth_getBlockByHash` and `eth_getBlockByNumber`, following the field name in the EIP-1559 header. Do not look for `baseFee`.
- Pre-London blocks have no base fee; libraries such as ethers return `null` for those.
- Inside contracts, the current block's base fee is available as `block.basefee` via the `BASEFEE` opcode from [EIP-3198](/eip-3198/).
- For fee history over a range of blocks, the `eth_feeHistory` method is usually more convenient than fetching blocks one by one.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-3041
