debug_getRawHeader — Ethereum JSON-RPC

Status: Available

Returns the RLP-encoded bytes of a block header, as a single hex string.

POSThttps://triport.io/eth
Network
Ethereum
Scope
eth_debug
Auth
x-token: $TRIPORT_API_KEY (or Authorization: Bearer)
Rate limit
pro + 5 rps, business + 15 rps

Endpoint and plans: Ethereum RPC endpoint.

debug_getRawHeader returns the consensus-layer RLP encoding of a single block header as a 0x-prefixed hex string. This is the exact byte sequence that is hashed to produce the block hash, so it is the canonical input for verifying a header or re-deriving its hash off-chain.

Use it when you need the raw header bytes rather than the decoded JSON object that eth_getBlockByNumber / eth_getBlockByHash return — for example to feed a light-client verifier, to recompute and check a block hash, or to relay a header to another system that expects RLP.

This is a pro-tier method in the eth_debug category. It is rate-limited to 5 requests per second on the pro tier and 15 requests per second on the business tier, with burst.

Parameters

The method takes a single positional parameter: the block to encode.

blockstringrequired
The block to encode, given as a hex block number (e.g. "0x10d4f"), a 32-byte block hash, or a tag ("latest", "earliest", "pending", "safe", "finalized").

Response

Response fields

FieldTypeDescription
resultstringThe RLP-encoded block header as a 0x-prefixed hex string.

Errors

CodeMeaningWhen it happens
403tier_insufficientYour plan is below the pro tier required for eth_debug methods.
429rate_limitedYou exceeded the per-second limit for your tier (5 rps pro / 15 rps business).

See the shared errors page for the full error envelope and retry guidance.

Examples

JavaScript (fetch)

const res = await fetch("https://triport.io/eth", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "debug_getRawHeader",
    params: ["latest"],
  }),
});


const { result } = await res.json();
console.log(result); // "0xf90222..."

Notes

  • The block argument accepts the same forms as the standard block selectors: a hex block number, a 32-byte block hash, or a tag such as "latest" or "finalized".
  • The Keccak-256 hash of the returned bytes equals the block hash, which lets you verify a header without trusting the decoded JSON fields.
  • For the decoded, human-readable header and its transactions, use eth_getBlockByNumber or eth_getBlockByHash instead. To fetch the raw RLP of a full block (header plus body), see the companion eth_debug methods.