getblockheaderbyhash
Returns a block header by the given hash identifier.
Request
{
"jsonrpc": "2.0",
"id": 0,
"method": "getblockheaderbyhash",
"params": {
"hash": "067fb9861f702b4eabee2e2f9265db3b9adde8a2c43e5afe6887574a12923652"
}
}
Request parameters
- hash - string; the 32-byte hex-encoded identifier of the block whose header is requested. If the value cannot be parsed as a hash, or no block with this id is known to the node, the call returns a JSON-RPC error instead of a result.
Response
{
"id": 0,
"jsonrpc": "2.0",
"result": {
"block_header": {
"depth": 3336,
"difficulty": "6867412547068",
"hash": "067fb9861f702b4eabee2e2f9265db3b9adde8a2c43e5afe6887574a12923652",
"height": 2111612,
"major_version": 2,
"minor_version": 0,
"nonce": 5464575110210072335,
"orphan_status": false,
"prev_hash": "6860a4742f167fcf7c46e121c8e139fd5232537f580a22ae76ce8013c06d0f09",
"reward": 1000000000000,
"timestamp": 1684409286
},
"status": "OK"
}
}
Response information
- depth - unsigned int; distance in blocks from the blockchain top, i.e. the number of blocks mined on top of this one.
0means this block is the current top block. - difficulty - unsigned int; block difficulty.
- hash - string; block identifier.
- height - unsigned int; block height.
- major_version - unsigned int; major version of a block.
- minor_version - unsigned int; minor version of a block.
- nonce - unsigned int; block nonce.
- orphan_status - boolean; indicates whether the block is an alternative (orphaned) block rather than part of the main chain. The daemon does not currently determine this for header lookups and always reports
false, so do not rely on it to detect orphans — use get_alt_blocks_details or theis_orphanfield of get_blocks_details instead. - prev_hash - string; hex-encoded identifier of the previous block, i.e. the block this one was built on top of.
- reward - unsigned int; how much money this block has generated.
- status - string; call result.
OKif the header has been retrieved successfully, otherwise an error string such asBUSY. - timestamp - unsigned int; block timestamp.