---
eip: 3045
label: EIP-3045
title: Adds `baseFee` to `eth_getUncleByBlockHashAndIndex`
status: Stagnant
type: Standards Track
category: Interface
created: 2020-10-14
requires: 1474, 1559
official: https://eips.ethereum.org/EIPS/eip-3045
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-3045.md
canonical: https://eips.huatuo.xyz/ko/eip-3045/
lang: ko
tldr: EIP-1559 포크 이후의 블록에 대해 `eth_getUncleByBlockHashAndIndex`가 반환하는 블록 객체에 `baseFee` 필드를 추가하자는 정체(Stagnant) 상태의 제안.
tags: [json-rpc, api, fees, uncles, interface]
---

# EIP-3045: Adds `baseFee` to `eth_getUncleByBlockHashAndIndex`

> Add basefee field to ethgetUncleByBlockHashAndIndex RPC endpoint response.

**TL;DR:** EIP-1559 포크 이후의 블록에 대해 `eth_getUncleByBlockHashAndIndex`가 반환하는 블록 객체에 `baseFee` 필드를 추가하자는 정체(Stagnant) 상태의 제안.

## 어떤 문제를 해결하나요?

[EIP-1559](/eip-1559/)는 모든 블록 헤더에 gas당 기본 수수료(base fee)를 추가했습니다. gas 가격을 추정하거나 수수료 이력을 분석하는 도구는 이 값을 JSON-RPC로 읽어야 하므로, RPC 응답에도 이를 위한 필드가 필요했습니다.

EIP-3045는 특정한 엔드포인트 하나, 즉 엉클(ommer) 블록의 헤더를 반환하는 `eth_getUncleByBlockHashAndIndex`를 다룹니다. 포크 이후에는 엉클 헤더도 기본 수수료를 담고 있으므로, 응답에도 이를 노출해야 합니다.

## 어떻게 동작하나요?

요청 매개변수는 그대로이며 블록 해시와 엉클 인덱스입니다. 결과만 바뀝니다.

- EIP-1559 포크 블록**부터** 이후의 엉클 블록에서는 결과에 `baseFee`를 **반드시 포함해야** 하며, 이는 [EIP-1474](/eip-1474/)에서 정의한 16진수 인코딩 수량입니다.
- 포크 **이전** 블록에서는 결과에 이 필드를 **포함해서는 안 됩니다**.

새 엔드포인트 대신 필드 하나를 추가한 것은 연동하기 가장 쉬운 변경이기 때문이며, 이전 블록에서는 생략하므로 기존 소비자가 계속 동작합니다.

## 샘플 코드

제안된 대로의 JSON-RPC 요청과 응답의 관련 부분:

```json
{
  "jsonrpc": "2.0",
  "id": 1559,
  "method": "eth_getUncleByBlockHashAndIndex",
  "params": ["0xc6ef2fc5426d6ad6fd9e2a26abeab0aa2411b7ab17f30a99d3cb96aed1d1055b", "0x0"]
}
```

```json
{
  "jsonrpc": "2.0",
  "id": 1559,
  "result": {
    "number": "0x1b4",
    "baseFee": "0x7",
    "gasLimit": "0x9f759",
    "gasUsed": "0x9f759"
  }
}
```

TypeScript(ethers v6)로 엉클 헤더 읽기:

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

const provider = new JsonRpcProvider(process.env.RPC_URL);
const uncle = await provider.send("eth_getUncleByBlockHashAndIndex", [blockHash, "0x0"]);
// Clients expose the field as `baseFeePerGas`, not the `baseFee` name proposed here
console.log(uncle?.baseFeePerGas ?? uncle?.baseFee);
```

## 알아둘 점

- 상태는 **Stagnant**입니다. 확정된 적이 없으며, 여기서 제안한 필드 이름(`baseFee`)은 클라이언트가 실제로 제공하는 이름이 아닙니다. 이더리움 클라이언트는 블록과 헤더 객체에서 `baseFeePerGas`를 반환합니다.
- 이 제안이 확장하는 JSON-RPC API인 [EIP-1474](/eip-1474/) 자체가 Stagnant이며, 유지되는 참조 문서는 `ethereum/execution-apis` 명세입니다.
- 더 머지(The Merge) 이후 지분증명 이더리움은 엉클 블록을 만들지 않으므로, 이 엔드포인트는 과거 작업증명 블록에만 의미가 있습니다.
- 컨트랙트 안에서는 현재 블록의 기본 수수료를 [EIP-3198](/eip-3198/)의 `BASEFEE` 옵코드로 얻을 수 있습니다.


---

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