Docs

state_getStorageAt - Bittensor RPC Method

Read a storage value at a specific block hash on Bittensor.

Returns the SCALE-encoded storage value for a given key at a specific block hash. This is equivalent to state_getStorage with an explicit block hash parameter. Use it to read historical on-chain state at any past block on Bittensor, enabling time-travel queries for analytics, auditing, and debugging.

Parameters

ParameterTypeRequiredDescription
keystringYesHex-encoded storage key to read.
blockHashstringYesHex-encoded block hash to read the storage at.

Response

FieldTypeDescription
resultstring or nullHex-encoded SCALE-encoded value, or null if the key does not exist at the given block.

Code Examples

Use Cases

  • Historical balance queries -- Read account balances, staking positions, or subnet parameters as they existed at a specific block.
  • Analytics and reporting -- Build time-series data by reading the same storage key across a range of block hashes.
  • Debugging -- Verify what on-chain state looked like at the block where an issue occurred.
  • Audit trails -- Prove that a specific value existed on-chain at a given point in time.

Notes

  • Requires an archive node. Non-archive nodes only keep recent state (typically the last 256 blocks).
  • The returned value is SCALE-encoded. Decode it using the type information from the runtime metadata at the same block.
  • The example above uses the well-known :code key (0x3a636f6465) at a real Bittensor block hash. Replace it with the storage key you actually want to inspect.
  • To determine the correct storage key for pallet state, use state_getMetadata and the Substrate storage key hashing scheme.