debug_getRawHeader
Last updated:
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
This method takes no parameters.
Returns
| Field | Type |
|---|---|
| result | object |
Examples
curl https://triport.io/sol \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"id":1,"method":"debug_getRawHeader","params":[],"jsonrpc":"2.0"}'const res = await fetch("https://triport.io/sol", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
body: JSON.stringify({
"id": 1,
"method": "debug_getRawHeader",
"params": [],
"jsonrpc": "2.0"
}),
});
const data = await res.json();import requests
resp = requests.post(
"https://triport.io/sol",
headers={"Authorization": "Bearer <api-key>"},
json={"id":1,"method":"debug_getRawHeader","params":[],"jsonrpc":"2.0"},
)
print(resp.json()){
"id": 1,
"result": "0xf90289a0145a1256141139aa00e51ce93244ac6feeda4588804bf552b7ad5ea80a86df2ea01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794396343362be2a4da1ce0c1c210945346fb82aa49a004907f95301e93926c8ba904eb61bac01c60206bf2223f8c79b473a597aba352a0b07077abbc014e05d0c06e293d71a51f51bea976fdb69ff8eb26c20186df5918a0c4507c9b31371ec0f6ad700aa6e327c1583869796cf7100a2623157c93f524c6b90100e7b5ff86f261e9d93096f16da248d447bdd2846815bcb984dfb1df8bd9bfc4e1893e6525a76c4ab5ef93f34f8663cf2d63cbac6d1f1ebcf734b964759a3ca020fbec4933edf9753b2ea3058eadc7bfbac3ee72d2e477d0a7a8dfbf76ba9ddac054db3306123f1addf74fead47a08abc9f64e297335af32cb74a18efb701e43ff247d8fbf724d01a227cebd3b66ce77cad8bafc55dd7db61e563113f7f49f7ed34f4d7fc38595abae726ad5fd75b4abe346116c65e18ca5d7d47fdf6e5ec036fa793559ff664dbe3fe2475dd392500dff1ede8f63caf47a54dff27e3ef88ffe8a4176ac591f77dd572feb3a8fadf13e93cd6b4ec1cbbde0d7beabae62b64afe4680840182eeb0840393870084013cf13f846a3661cf9be29ca82051756173617220287175617361722e77696e2920e29ca8a07bfc83c126c334693c43e17b7088058ad2c2b32a66e0a221e714470da3b93bf28800000000000000008415218e96a00598594ce07ae22dc56c890aa1d544fc3e1edd6afb7df98b6f842e3ee3c319cc83020000840b97df27a06cebe35b8f3df97716d74b3558da4177abb52bd3bc70dcce8d52bef8281417a1a0e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"jsonrpc": "2.0"
}Usage
- Transport: HTTP (JSON-RPC).
- Networks: mainnet.
- Credit cost: 5 per call.
FAQ
- What does debug_getRawHeader do?
- Returns the RLP-encoded bytes of a block header, as a single hex string.
- How many credits does debug_getRawHeader cost?
- debug_getRawHeader costs 5 credit(s) per call on Triport by default.
- Is debug_getRawHeader available over WebSocket?
- debug_getRawHeader is an HTTP JSON-RPC method.