debug_getRawHeader
The debug_getRawHeader method returns the RLP-encoded block header for a given block number. This method retrieves just the block header in its raw encoded form, which is significantly more efficient than fetching the entire block when you only need header information.
The block header contains crucial metadata including parent hash, uncle hash, coinbase address, state root, transactions root, receipts root, logs bloom, difficulty, block number, gas limit, gas used, timestamp, extra data, mix hash, and nonce. This makes the method ideal for lightweight blockchain analysis, header verification, building light clients, and implementing custom consensus validation without the overhead of processing full block data including all transactions.
This method is available only on the full archive node.
Parameters
parameter | type | description |
|---|---|---|
blockNumber | string (required) | Block number in hex format (e.g., '0x10d4f') or one of the string tags: 'latest' for the most recent block, 'earliest' for the genesis block, or 'pending' for pending state/transactions |
Return Object
The method returns a single field:
result - string: The RLP-encoded block header as a hexadecimal string. This encoded data contains the block header fields: parent hash (32 bytes), ommers hash (32 bytes), beneficiary address (20 bytes), state root (32 bytes), transactions root (32 bytes), receipts root (32 bytes), logs bloom (256 bytes), difficulty (variable), number (variable), gas limit (variable), gas used (variable), timestamp (variable), extra data (variable, max 32 bytes), mix hash (32 bytes), and nonce (8 bytes).
Request Example
Response Example