Unichain

eth_getUncleByBlockNumberAndIndex
The eth_getUncleByBlockNumberAndIndex method returns information about an uncle (ommer) block by a block number and uncle index position.
Use Cases
- Analyzing blockchain network health
- Verifying uncle rewards distribution
- Researching mining/validation competition
- Studying blockchain throughput and latency
- Understanding network security through uncle rate
- Historical blockchain research
- Block confirmation verification
- Network congestion analysis
Method Details
Returns information about the uncle (ommer) block by the block number and uncle index position.
Block Number Parameter Options
The blockNumber parameter accepts:
- Hex string of a block number
"earliest"for the genesis block"latest"for the most recently mined block"pending"for the pending state/transactions"safe"for the most recent block that's safe from reorgs"finalized"for the most recent finalized block
Response Example
Understanding Uncle Blocks
Uncle blocks (also called ommers) are valid blocks that were mined but not included in the main blockchain. This happens when two miners find a valid block at nearly the same time, but only one can be accepted into the main chain.
Why Uncle Blocks Matter
- Network Security: A high uncle rate may indicate network latency or high mining competition
- Rewards: Miners of uncle blocks receive partial rewards (2/32 of block reward pre-EIP-1559)
- Block Inclusion: Uncles are referenced in regular blocks (up to 2 per block)
- Chain Confirmation: Uncles contribute to blockchain security despite not being in the main chain
Differences Between eth_getUncleByBlockNumberAndIndex and eth_getUncleByBlockHashAndIndex
Both methods retrieve the same uncle block data, but they use different reference methods:
eth_getUncleByBlockNumberAndIndex- Uses the block number (or named tag like "latest") to identify the block containing the uncleeth_getUncleByBlockHashAndIndex- Uses the block hash to identify the block containing the uncle
The number parameter is often more convenient as it allows using block tags like "latest" and is easier to work with sequentially, while hash-based lookups provide absolute reference certainty.
Historical Significance
Uncle rates in Ethereum have historically been important metrics:
- Early Ethereum had uncle rates around 7-10%
- Network upgrades like Byzantium and Constantinople adjusted uncle rewards
- Post-Merge (PoS transition), uncle blocks no longer exist as validators produce blocks in determined slots
Example Usage
See also
- eth_getUncleByBlockHashAndIndex - Get uncle block data using the block hash and uncle index
- eth_getUncleCountByBlockNumber - Count the number of uncles in a block using its number
- eth_getBlockByNumber - Get full block information including uncle references
Parameters
Block number in hex format or tags: latest, earliest, pending, safe, finalized
The index position of the uncle (hex)