eth_getUncleByBlockHashAndIndex
JSON-RPC method returns information about an uncle block by block hash and uncle index position. Uncle blocks are valid blocks that were not included in the main chain but are referenced by the main chain blocks for network security.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
- block_hash (string) — The hash of the block containing the uncle
- uncle_index (string) — The uncle index position as a hexadecimal string (e.g., “0x0” for the first uncle)
Response
The method returns uncle block information ornull
if no uncle exists at the specified index.
Response structure
Uncle block information:- Returns uncle block object with header information if found
- Returns
null
if no uncle exists at the specified index - Uncle blocks contain header information but no transaction data
Uncle block interpretation
Block structure:- Uncle blocks are valid blocks that were not included in the main chain
- They are referenced by main chain blocks to maintain network security
- Uncle blocks earn reduced rewards compared to main chain blocks
- Uncle index starts from 0 for the first uncle in the block
- Multiple uncles can exist in a single block
- Index must be provided as hexadecimal string with “0x” prefix
Usage example
Basic implementation
Example request
Shell
Use cases
Theeth_getUncleByBlockHashAndIndex
method is useful for applications that need to:
- Network analysis: Analyze network health and uncle block rates
- Mining pool monitoring: Monitor mining pool performance and uncle rates
- Blockchain research: Study blockchain consensus and network behavior
- Security analysis: Analyze network security and decentralization metrics
- Uncle block tracking: Track uncle blocks for reward calculations
- Network statistics: Generate statistics about blockchain efficiency
- Mining analytics: Analyze mining patterns and uncle block occurrences
- Block validation: Validate block structure and uncle references
- Chain analysis: Perform detailed blockchain analysis and metrics
- Educational tools: Build tools for blockchain education and visualization
- Academic research: Support academic research on blockchain consensus
- Mining optimization: Optimize mining strategies based on uncle patterns
- Network monitoring: Monitor network consensus and fork behavior
- Reward calculation: Calculate accurate mining rewards including uncles
- Historical analysis: Analyze historical uncle block patterns and trends
Body
application/json
JSON-RPC version
Available options:
2.0
The RPC method name
Available options:
eth_getUncleByBlockHashAndIndex
Parameters: [block_hash, uncle_index]
Request identifier