> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# eth_getUncleByBlockHashAndIndex | Hyperliquid EVM

> The eth_getUncleByBlockHashAndIndex JSON-RPC method returns information about an uncle block by block hash and uncle index position.

<Info>
  This method is available on Chainstack. Not all Hyperliquid methods are available on Chainstack, as the open-source node implementation does not support them yet — see [Hyperliquid methods](/docs/hyperliquid-methods) for the full availability breakdown.
</Info>

The `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.

<Check>
  **Get your own node endpoint today**

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## Parameters

1. **block\_hash** (string) — The hash of the block containing the uncle
2. **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 or `null` 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

**Index positioning:**

* 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

```javascript theme={"system"}
// Get uncle block by hash and index
const getUncleByBlockHashAndIndex = async (blockHash, uncleIndex) => {
  const response = await fetch('https://hyperliquid-mainnet.core.chainstack.com/YOUR_ENDPOINT/evm', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      jsonrpc: '2.0',
      method: 'eth_getUncleByBlockHashAndIndex',
      params: [blockHash, uncleIndex],
      id: 1
    })
  });
  
  const data = await response.json();
  return data.result;
};

// Check for uncles in a block
const checkBlockUncles = async (blockHash) => {
  const uncles = [];
  let index = 0;
  
  while (true) {
    const uncle = await getUncleByBlockHashAndIndex(
      blockHash, 
      `0x${index.toString(16)}`
    );
    
    if (uncle === null) {
      break;
    }
    
    uncles.push(uncle);
    index++;
  }
  
  return uncles;
};

// Usage
const blockHash = '0x2ce91ae0ed242b4b78b432a45b982fb81a414d6b04167762ed3c7446710a4b8e';
checkBlockUncles(blockHash).then(uncles => {
  console.log(`Found ${uncles.length} uncles in block`);
  uncles.forEach((uncle, i) => {
    console.log(`Uncle ${i}:`, uncle);
  });
});
```

## Example request

```shell Shell theme={"system"}
curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_getUncleByBlockHashAndIndex",
    "params": [
      "0x2ce91ae0ed242b4b78b432a45b982fb81a414d6b04167762ed3c7446710a4b8e",
      "0x0"
    ],
    "id": 1
  }' \
  https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm
```

## Use cases

The `eth_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

This method provides detailed access to uncle block information, enabling comprehensive blockchain analysis and network monitoring on the Hyperliquid EVM platform.


## OpenAPI

````yaml /openapi/hyperliquid_node_api/evm_eth_get_uncle_by_block_hash_and_index.json post /evm
openapi: 3.0.0
info:
  title: Hyperliquid EVM API - eth_getUncleByBlockHashAndIndex
  version: 1.0.0
servers:
  - url: >-
      https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274
security: []
paths:
  /evm:
    post:
      summary: eth_getUncleByBlockHashAndIndex
      description: >-
        Returns information about an uncle block by the 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.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - method
                - params
                - id
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  default: '2.0'
                  description: JSON-RPC version
                method:
                  type: string
                  enum:
                    - eth_getUncleByBlockHashAndIndex
                  default: eth_getUncleByBlockHashAndIndex
                  description: The RPC method name
                params:
                  type: array
                  description: 'Parameters: [block_hash, uncle_index]'
                  default:
                    - >-
                      0x2ce91ae0ed242b4b78b432a45b982fb81a414d6b04167762ed3c7446710a4b8e
                    - '0x0'
                id:
                  type: integer
                  default: 1
                  description: Request identifier
            example:
              jsonrpc: '2.0'
              method: eth_getUncleByBlockHashAndIndex
              params:
                - >-
                  0x2ce91ae0ed242b4b78b432a45b982fb81a414d6b04167762ed3c7446710a4b8e
                - '0x0'
              id: 1
      responses:
        '200':
          description: Successful response with uncle block information
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: JSON-RPC version
                  id:
                    type: integer
                    description: Request identifier
                  result:
                    type: object
                    description: Uncle block information or null if not found
                    nullable: true
              example:
                jsonrpc: '2.0'
                id: 1
                result: null

````