archive_v1_header - Bittensor RPC Method
Fetch a block header by hash from the archive RPC on Bittensor using the new JSON-RPC v2 spec.
Returns the header of a block identified by its hash via the new JSON-RPC v2 archive API. The header contains the parent hash, block number, state root, extrinsics root, and digest (which includes consensus-related log items such as BABE slot info and GRANDPA authority changes). This is a lightweight way to inspect block metadata without fetching the full body.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
hash | string | Yes | Hex-encoded block hash to retrieve the header for. |
Response
| Field | Type | Description |
|---|---|---|
result | string | null | Hex-encoded SCALE-encoded Substrate header for the requested block. null if the block hash cannot be resolved. |
The returned header includes the parent hash, block number, state root, extrinsics root, and digest logs once decoded with the matching runtime types.
Code Examples
Use Cases
- Chain traversal -- Walk the chain backwards by following
parentHashlinks from header to header. - Light client verification -- Verify block headers and state roots without downloading the full block body.
- Indexer metadata -- Extract block numbers, timestamps (from digest), and state roots for indexed block records.
Notes
- This method is part of the new JSON-RPC v2 specification and may not be enabled on all Bittensor nodes.
- The header is significantly smaller than a full block, making it ideal for lightweight monitoring.
- On public shared RPC endpoints the archive namespace may be disabled or rate-limited.
Related Methods
archive_v1_body-- Get the block body (extrinsics) for the same hasharchive_v1_hashByHeight-- Resolve a block height to a hasharchive_v1_call-- Execute a runtime call at the same block's statechain_getHeader-- Legacy method to fetch a block headerchainHead_v1_header-- Get header within a follow subscription