Docs

archive_v1_storageDiff - Bittensor RPC Method

Stream storage key changes between two blocks via the archive RPC on Bittensor using the new JSON-RPC v2 spec.

Streams the differences in storage between two blocks via the new JSON-RPC v2 archive API. This method reports which storage keys were added, modified, or deleted between a previous block and a target block. It is designed for efficient state synchronization and change tracking without downloading full storage snapshots.

Parameters

ParameterTypeRequiredDescription
hashstringYesHex-encoded hash of the target block (the newer block).
itemsarrayYesArray of storage query items specifying which keys or prefixes to watch for changes.
previousHashstringNoHex-encoded hash of the previous block to diff against. Defaults to the parent block if omitted.

Each item in the items array specifies a key or prefix to track:

FieldTypeDescription
keystringHex-encoded storage key or prefix.
returnTypestringType of payload to return for each matching key: "value" or "hash".

Response

The direct RPC response is a subscription/operation ID string. Results then arrive as archive_v1_storageDiffEvent notifications over the same WebSocket connection:

EventDescription
storageDiffA batch of changed keys and returned values or hashes
storageDiffErrorAn error was encountered while streaming diff results
storageDiffDoneThe diff stream has completed

Code Examples

Use Cases

  • Incremental indexing -- Detect only the storage keys that changed between blocks, dramatically reducing the amount of data an indexer needs to process.
  • State sync -- Efficiently synchronize a local state mirror by applying only the diffs instead of re-reading entire storage.
  • Change auditing -- Track changes to specific storage maps (e.g. Bittensor subnet parameters, staking ledgers) between two points in time.

Notes

  • This method is part of the new JSON-RPC v2 specification and requires a WebSocket connection for streaming results.
  • Use archive_v1_storageDiff_stopStorageDiff to cancel an in-progress diff operation.
  • On public shared RPC endpoints the archive namespace may be disabled or rate-limited.