eth_getBlockByHash
JSON-RPC method returns information about a block by its hash. This method is essential for retrieving detailed block information when you have the block hash, commonly used for block exploration, transaction verification, and blockchain analysis.
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
The method takes two parameters:- Block hash - The hash of the block to retrieve
- Full transaction objects - Whether to return full transaction objects or just hashes
Parameter details
blockHash
(string, required) — The 32-byte hash of the block to retrievefullTransactionObjects
(boolean, required) — Iftrue
, returns full transaction objects; iffalse
, returns only transaction hashes
Response
The method returns detailed information about the specified block, ornull
if the block is not found.
Response structure
Block object:number
— Block number as a hexadecimal stringhash
— The 32-byte hash of the blockparentHash
— Hash of the parent blocktimestamp
— Block timestamp as a Unix timestamp in hexadecimalgasLimit
— Maximum gas allowed in this blockgasUsed
— Total gas used by all transactions in the blocktransactions
— Array of transaction hashes or full transaction objectsminer
— Address of the block miner/validatordifficulty
— Block difficulty (may be 0 for some consensus mechanisms)totalDifficulty
— Total difficulty of the chain until this blocksize
— Block size in bytes as a hexadecimal stringextraData
— Extra data field of the blocknonce
— Block nonce (if applicable)receiptsRoot
— Root hash of the receipts triestateRoot
— Root hash of the state trietransactionsRoot
— Root hash of the transactions trie
Transaction data format
With fullTransactionObjects = false:- Returns array of transaction hashes as strings
- Minimal data transfer for basic block information
- Suitable for block overview and transaction counting
- Returns array of complete transaction objects
- Includes all transaction details (from, to, value, gas, etc.)
- Larger response but comprehensive transaction data
Hyperliquid-specific considerations
System transactions
HyperCore transactions:- Blocks may contain system transactions that originate from HyperCore
- Use
eth_getSystemTxsByBlockHash
to retrieve system transactions specifically - System transactions are separate from regular user transactions
- Important for complete block analysis and understanding network activity
Block data interpretation
Transaction types:- Regular transactions: Standard user-initiated transactions
- System transactions: Transactions originating from HyperCore
- Both types contribute to block gas usage and transaction count
- Consider both regular and system transactions for complete analysis
- System transactions may have different patterns and characteristics
- Use appropriate methods to retrieve the specific transaction type needed
Example request
Shell
Use cases
Theeth_getBlockByHash
method is essential for applications that need to:
- Block explorers: Display detailed block information and navigation
- Transaction verification: Confirm transaction inclusion in specific blocks
- Blockchain analytics: Analyze block data for network insights
- Audit systems: Verify block integrity and transaction history
- Development tools: Debug and test blockchain applications
- Monitoring systems: Track block production and network health
- DeFi protocols: Verify block-based events and state changes
- System transaction analysis: Analyze both regular and HyperCore system transactions
- Network diagnostics: Troubleshoot blockchain synchronization issues
- Integration services: Provide block data to external systems
Block hashes are unique identifiers. If a block hash doesn’t exist or is invalid, the method returns
null
. On Hyperliquid, blocks may contain system transactions from HyperCore - use eth_getSystemTxsByBlockHash
to retrieve these separately.Body
application/json
JSON-RPC version
Available options:
2.0
The RPC method name
Available options:
eth_getBlockByHash
Parameters: [blockHash, fullTransactionObjects]
Request identifier