> ## 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_getBlockByNumber | Hyperliquid EVM

> The eth_getBlockByNumber JSON-RPC method returns information about a block by its number. Use it on Hyperliquid EVM via Chainstack.

<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_getBlockByNumber` JSON-RPC method returns information about a block by its number. This method is essential for retrieving block data when you know the block number, commonly used for sequential block processing, blockchain synchronization, and historical data analysis.

## Parameters

The method takes two parameters:

1. **Block number** - The number of the block to retrieve
2. **Full transaction objects** - Whether to return full transaction objects or just hashes

### Parameter details

* `blockNumber` (string, required) — Block identifier: `"latest"`, `"earliest"`, `"pending"`, or a specific block number in hexadecimal
* `fullTransactionObjects` (boolean, required) — If `true`, returns full transaction objects; if `false`, returns only transaction hashes

## Response

The method returns detailed information about the specified block, or `null` if the block is not found.

### Response structure

**Block object:**

* `number` — Block number as a hexadecimal string
* `hash` — The 32-byte hash of the block
* `parentHash` — Hash of the parent block
* `timestamp` — Block timestamp as a Unix timestamp in hexadecimal
* `gasLimit` — Maximum gas allowed in this block
* `gasUsed` — Total gas used by all transactions in the block
* `transactions` — Array of transaction hashes or full transaction objects
* `miner` — Address of the block miner/validator
* `difficulty` — Block difficulty (may be 0 for some consensus mechanisms)
* `totalDifficulty` — Total difficulty of the chain until this block
* `size` — Block size in bytes as a hexadecimal string
* `extraData` — Extra data field of the block
* `nonce` — Block nonce (if applicable)
* `receiptsRoot` — Root hash of the receipts trie
* `stateRoot` — Root hash of the state trie
* `transactionsRoot` — Root hash of the transactions trie

### Block number formats

**Special identifiers:**

* `"latest"` — Most recent block
* `"earliest"` — Genesis block (block 0)
* `"pending"` — Pending block being mined

**Hexadecimal numbers:**

* `"0x0"` — Genesis block
* `"0x1"` — Block 1
* `"0x9d0c37"` — Block 10,291,255 (decimal)

## Hyperliquid-specific considerations

### System transactions

**HyperCore transactions:**

* Blocks may contain system transactions that originate from HyperCore
* Use `eth_getSystemTxsByBlockNumber` to retrieve system transactions specifically
* System transactions are separate from regular user transactions
* Important for complete block analysis and understanding network activity

### Block processing

**Sequential access:**

* Process blocks sequentially for complete chain analysis
* Handle missing blocks gracefully in case of gaps
* Use block numbers for efficient sequential processing
* Track last processed block for incremental updates

**Block number formats:**

* `"latest"` — Most recent block
* `"earliest"` — Genesis block (block 0)
* `"0x1a4"` — Specific block number in hexadecimal (420 in decimal)

## Example request

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

  ```python Python (web3.py) theme={"system"}
  from web3 import Web3

  w3 = Web3(Web3.HTTPProvider("YOUR_CHAINSTACK_ENDPOINT"))

  block = w3.eth.get_block(10291255, full_transactions=False)
  print(block)
  ```

  ```javascript JavaScript (ethers.js) theme={"system"}
  import { JsonRpcProvider } from "ethers";

  const provider = new JsonRpcProvider("YOUR_CHAINSTACK_ENDPOINT");

  const block = await provider.getBlock(10291255, false);
  console.log(block);
  ```

  ```typescript TypeScript (viem) theme={"system"}
  import { createPublicClient, http } from "viem";

  const client = createPublicClient({
    transport: http("YOUR_CHAINSTACK_ENDPOINT"),
  });

  const block = await client.getBlock({
    blockNumber: 10291255n,
    includeTransactions: false,
  });
  console.log(block);
  ```
</CodeGroup>

<Note>
  **Use your own endpoint in your code.** The code examples use a placeholder Chainstack endpoint (YOUR\_CHAINSTACK\_ENDPOINT) — replace it with your own Hyperliquid node endpoint from the [Chainstack console](https://console.chainstack.com/). The curl above uses a shared public endpoint for quick checks only; do not use it in production.
</Note>

## Use cases

The `eth_getBlockByNumber` method is essential for applications that need to:

* **Blockchain synchronization**: Download and process blocks sequentially
* **Block explorers**: Display block information and enable navigation
* **Analytics platforms**: Collect block data for network analysis
* **Transaction monitoring**: Track transactions within specific blocks
* **Historical analysis**: Study past blockchain states and events
* **Audit systems**: Verify blockchain integrity and transaction history
* **Development tools**: Debug and test blockchain applications
* **System transaction analysis**: Analyze both regular and HyperCore system transactions
* **Network monitoring**: Track block production and network health
* **Integration services**: Provide block data to external systems

<Note>
  Block numbers are sequential. If a block number doesn't exist (e.g., future block), the method returns `null`. On Hyperliquid, blocks may contain system transactions from HyperCore - use `eth_getSystemTxsByBlockNumber` to retrieve these separately.
</Note>


## OpenAPI

````yaml openapi/hyperliquid_node_api/hyperevm/evm_eth_get_block_by_number.json post /evm
openapi: 3.0.0
info:
  title: Hyperliquid EVM API - eth_getBlockByNumber
  version: 1.0.0
servers:
  - url: >-
      https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274
security: []
paths:
  /evm:
    post:
      summary: eth_getBlockByNumber
      description: Returns information about a block by its number.
      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_getBlockByNumber
                  default: eth_getBlockByNumber
                  description: The RPC method name
                params:
                  type: array
                  description: 'Parameters: [blockNumber, fullTransactionObjects]'
                  default:
                    - '0x9d0c37'
                    - false
                id:
                  type: integer
                  default: 1
                  description: Request identifier
            example:
              jsonrpc: '2.0'
              method: eth_getBlockByNumber
              params:
                - '0x9d0c37'
                - false
              id: 1
      responses:
        '200':
          description: Successful response with 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
                    properties:
                      number:
                        type: string
                        description: Block number as a hexadecimal string
                      hash:
                        type: string
                        description: Block hash
                      parentHash:
                        type: string
                        description: Hash of the parent block
                      timestamp:
                        type: string
                        description: Block timestamp as a hexadecimal string
                      gasLimit:
                        type: string
                        description: Gas limit for the block
                      gasUsed:
                        type: string
                        description: Total gas used by all transactions in the block
                      transactions:
                        type: array
                        description: >-
                          Array of transaction hashes or full transaction
                          objects
                      miner:
                        type: string
                        description: Address of the block miner
                      difficulty:
                        type: string
                        description: Block difficulty
                      totalDifficulty:
                        type: string
                        description: Total difficulty of the chain until this block
                      size:
                        type: string
                        description: Block size in bytes
                      extraData:
                        type: string
                        description: Extra data field of the block
              example:
                jsonrpc: '2.0'
                id: 1
                result:
                  number: '0x9d0c37'
                  hash: >-
                    0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
                  parentHash: >-
                    0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890
                  timestamp: '0x61bc8c3a'
                  gasLimit: '0x1c9c380'
                  gasUsed: '0x5208'
                  transactions:
                    - 0xabc123...
                    - 0xdef456...
                  miner: '0x0000000000000000000000000000000000000000'
                  difficulty: '0x0'
                  totalDifficulty: '0x0'
                  size: '0x220'
                  extraData: 0x

````