⚠️Blast API (blastapi.io) ends Oct 31. Migrate to Dwellir and skip Alchemy's expensive compute units.
Switch Today →
Skip to main content

childstate_getKeys - JSON-RPC Method

Description

Returns the keys for a child storage trie. Child tries are commonly used by pallets such as pallet_child_bounties or contracts pallets that maintain per-account state. You must provide the child storage key (obtained from runtime APIs or events) and an optional prefix to narrow the scan.

Parameters

ParameterTypeRequiredDescription
childStorageKeystringYesHex-encoded child trie identifier
prefixstringYesHex-encoded key prefix to filter child storage keys
blockHashstring | nullNoOptional block hash for historical queries

Request Example

{
"jsonrpc": "2.0",
"method": "childstate_getKeys",
"params": [
"0x3a6368696c645f73746f726167653a5f6578616d706c65", // child storage key
"0x", // prefix (empty)
null
],
"id": 1
}

Response Example

{
"jsonrpc": "2.0",
"result": [],
"id": 1
}

A non-empty response contains hex-encoded keys that can be passed to childstate_getStorage or childstate_getStorageEntries to fetch the associated values.

Notes

  • Child storage access is typically restricted to trusted infrastructure. Public endpoints may return an empty array if no child trie is present or if the pallet does not expose one.
  • Acquire the child storage key from pallet events, runtime APIs, or by decoding storage metadata for the pallet in question.
  • Extensive scans should be paginated using childstate_getKeysPaged.