Docs

chainHead_v1_header - Bittensor RPC Method

Get the block header for a block within a chain head follow subscription on Bittensor using the new JSON-RPC v2 spec.

Returns the SCALE-encoded header of a block that is pinned by an active chainHead_v1_follow subscription. Unlike chainHead_v1_body and chainHead_v1_call, this method returns the result directly (not as a streamed operation), making it the fastest way to inspect block metadata within the follow API.

Parameters

ParameterTypeRequiredDescription
followSubscriptionstringYesThe subscription ID from chainHead_v1_follow.
hashstringYesHex-encoded block hash. Must be pinned by the follow subscription.

Response

FieldTypeDescription
resultstringHex-encoded SCALE-encoded block header for the requested pinned block.

The decoded header contains:

FieldDescription
parentHashHash of the parent block.
numberBlock number.
stateRootState trie root after this block.
extrinsicsRootRoot of the extrinsics trie.
digestConsensus digest logs (BABE slots, GRANDPA data, etc.).

Code Examples

Use Cases

  • Block number tracking -- Decode the header to get the block number for display or indexing as each new block arrives.
  • State root verification -- Verify the state root for light-client proofs or cross-chain bridges.
  • Parent chain traversal -- Follow parentHash links to walk back through recent blocks within the follow window.

Notes

  • This is a synchronous response (not an operation-based flow), so results are returned immediately.
  • The block hash must be pinned by the follow subscription. Querying an unpinned or unknown hash returns an error.
  • This method is experimental and may not be enabled on public shared RPC endpoints.