eth_getBlockByHash

The eth_getBlockByHash method returns information about a block by block hash. Identical to eth_getBlockByNumber but uses the block's unique hash as the identifier instead of its number.

This is useful when you have a specific block hash from a transaction receipt or event log and need to retrieve the complete block information. Using the hash ensures you get the exact block even in case of chain reorganizations, since block numbers can refer to different blocks after a reorg, but hashes are immutable identifiers. Developers use this for precise block lookups, analyzing specific blocks referenced in events, and ensuring data consistency across reorganizations.


Parameters

parameter
type
description
blockHash
string (required)
Hash of the block (32-byte hex string with 0x prefix)
fullTransactions
boolean (required)
If true, returns full transaction objects with all fields; if false, returns only an array of transaction hashes for better performance
Return Object

The method returns a block object, or null if the block is not found:

field
type
description
number
string
The block number encoded as hexadecimal
hash
string
Hash of the block (32 bytes)
parentHash
string
Hash of the parent block (32 bytes)
nonce
string
Hash of the generated proof-of-work, null for PoS blocks (8 bytes)
sha3Uncles
string
SHA3 of the uncles data in the block (32 bytes)
logsBloom
string
The bloom filter for the logs of the block (256 bytes)
transactionsRoot
string
The root of the transaction trie of the block (32 bytes)
stateRoot
string
The root of the final state trie of the block (32 bytes)
receiptsRoot
string
The root of the receipts trie of the block (32 bytes)
miner
string
The address of the beneficiary to whom the mining/validation rewards were given (20 bytes)
difficulty
string
Integer of the difficulty for this block (hex), 0 for PoS
totalDifficulty
string
Integer of the total difficulty of the chain until this block (hex)
extraData
string
The extra data field of this block (max 32 bytes)
size
string
The size of this block in bytes (hex)
gasLimit
string
The maximum gas allowed in this block (hex)
gasUsed
string
The total gas used by all transactions in this block (hex)
timestamp
string
The unix timestamp for when the block was collated (hex)
transactions
array
Array of transaction objects (if fullTransactions=true) or array of transaction hashes (if fullTransactions=false)
uncles
array
Array of uncle hashes (32 bytes each)
baseFeePerGas
string
The base fee per gas for this block (hex), introduced in EIP-1559
Request Example
Request
Response Example
Response

Share on
Share on FacebookShare on XShare on LinkedIn
Did you find this page useful?