Ethereum

Ethereum

eth_getUncleByBlockHashAndIndex

eth_getUncleByBlockHashAndIndex looks up an uncle (ommer) header by the hash of the block that references it plus the uncle's position in that block's uncles array. Uncles are a Proof-of-Work relic on Ethereum: under the old PoW consensus, two valid blocks could land at nearly the same height, and the one that lost the race could still be referenced as an uncle so its miner earned a partial reward in ETH. That stopped at The Merge (block 15537393, September 2022), when PoS began producing exactly one block per 12-second slot. So this call returns a real header for a pre-Merge block that included an uncle, and null for anything after. Send the request to https://ethereum.therpc.io/YOUR_API_KEY on chain ID 1; the result is a header object with no transactions array.

Use cases

  • Reconstruct uncle reward payouts for a pre-Merge mining analysis, using the uncle's number relative to the including block to derive how much ETH the ommer's miner earned.
  • Use the uncle's timestamp and difficulty as a proxy for how heavily nodes were competing for a block, since a high uncle rate signalled propagation latency on the PoW network.
  • Pull raw ommer headers for historical research into Ethereum's pre-Merge era, where uncles affected chain weight under the GHOST-style fork-choice rule.

Parameters

#NameTypeRequiredDescription
1blockHashstring (hex)YesThe hash of the block that references the uncle.
2uncleIndexstring (hex)YesZero-based index of the uncle within the block's uncles array.

Response

TypeDescription
object | nullBlock header object (no transactions array): number, hash, parentHash, sha3Uncles, miner, stateRoot, transactionsRoot, receiptsRoot, logsBloom, difficulty, gasLimit, gasUsed, timestamp, extraData, mixHash, nonce. Returns null if not found.

Example request

curl https://ethereum.therpc.io/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getUncleByBlockHashAndIndex",
"params": [
"0x0000000000000000000000000000000000000000000000000000000000000000",
"0x0"
],
"id": 1
}'

Try it live in the Ethereum playground.

Errors & troubleshooting

CodeMessageCause
-32602Invalid paramsBlock hash or uncle index is malformed.

Common pitfalls

  • The response is a header only. An uncle never carried its own transaction set into the canonical chain, so there is no transactions array to read.
  • Any block mined after The Merge at 15537393 has no uncles, so passing a recent block hash returns null. This method is only useful against pre-Merge PoW history.
  • Ethereum's protocol allowed at most two uncles per block, so valid indexes are 0x0 and 0x1. Index 0x2 or higher always returns null, even for a PoW block that did include uncles.

Supported networks

  • Mainnet — Chain ID: 1
  • Sepolia — Chain ID: 11155111

See also

Parameters

0x-prefixed 32-byte block hash

0x-prefixed hex integer (e.g. "0x0")

curl https://ethereum.therpc.io/YOUR_API_KEY \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getUncleByBlockHashAndIndex","params":["0x0000000000000000000000000000000000000000000000000000000000000000","0x0"]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.