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
numberrelative to the including block to derive how much ETH the ommer's miner earned. - Use the uncle's
timestampanddifficultyas 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
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | blockHash | string (hex) | Yes | The hash of the block that references the uncle. |
| 2 | uncleIndex | string (hex) | Yes | Zero-based index of the uncle within the block's uncles array. |
Response
| Type | Description |
|---|---|
| object | null | Block 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
Try it live in the Ethereum playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32602 | Invalid params | Block 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
0x0and0x1. Index0x2or higher always returnsnull, 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")