Skip to main content

eth_getBlockByHash RPC Method

Returns information of the block matching the given block hash.

Updated on
Sep 23, 2024

eth_getBlockByHash RPC Method

Parameters

hash
string
REQUIRED
The hash (32 bytes) of the block
transaction detail flag
boolean
REQUIRED
It returns the full transaction objects when it is true otherwise it returns only the hashes of the transactions

Returns

object
object
A block object, or null when no block was found:
baseFeePerGas
A string of the base fee encoded in hexadecimal format. Please note that this response field will not be included in a block requested before the EIP-1559 upgrade
blobGasUsed
string
The amount of gas used by the blob
difficulty
string
The integer of the difficulty for this block encoded as hexadecimal
excessBlobGas
string
The excess gas used by the blob
extraData
The “extra data” field of this block
gasLimit
The maximum gas allowed in this block encoded as a hexadecimal
gasUsed
The total used gas by all transactions in this block encoded as a hexadecimal
hash
The block hash of the requested block. null if pending
logsBloom
The bloom filter for the logs of the block. null if pending
miner
The address of the beneficiary to whom the mining rewards were given
mixHash
A string of a 256-bit hash encoded as a hexadecimal
nonce
The hash of the generated proof-of-work. null if pending
number
The block number of the requested block encoded as a hexadecimal. null if pending
parentBeaconBlockRoot
The root of the parent beacon block
parentHash
The hash of the parent block
receiptsRoot
The root of the receipts trie of the block
sha3Uncles
The SHA3 of the uncles data in the block
size
The size of this block in bytes as an Integer value encoded as hexadecimal
stateRoot
The root of the final state trie of the block
timestamp
The unix timestamp for when the block was collated
transactions
An array of transaction objects - please see eth_getTransactionByHash for exact shape
transactionsRoot
The root of the transaction trie of the block
uncles
An array of uncle hashes
withdrawals
A withdrawals object contains information about withdrawals made by validators. Please note that this field will not be included in a block requested before the EIP-4895 upgrade
index
The index of the withdrawal to uniquely identify each withdrawal
validatorIndex
The index of the validator who initiated the withdrawal
address
The address to which the withdrawn amount is sent
amount
The amount of ether, provided in hexadecimal format, corresponding to a certain value in gwei
withdrawalsRoot
The Merkle root of withdrawal data. Also, please note that this field will not be included in a block requested before the EIP-4895 upgrade
Request
1
curl https://docs-demo.omni-omega.quiknode.pro/ \
2
-X POST \
3
-H "Content-Type: application/json" \
4
--data '{"method":"eth_getBlockByHash","params":["0x5da7129315212ca60431718054f1092fa7e72ab4de10b2a4b15debd3f3ee6e5f",false],"id":1,"jsonrpc":"2.0"}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free