Skip to main content

childstate_getKeysPaged - JSON-RPC Method

Description#

Returns child storage keys in deterministic batches. This method is preferable when the child trie contains many entries and you need to iterate safely without overloading the RPC server.

Parameters#

ParameterTypeRequiredDescription
childStorageKeystringYesHex-encoded child trie identifier
prefixstringYesHex-encoded key prefix
countnumberYesMaximum number of keys to return
startKeystring | nullNoKey to start from (exclusive), use null for the first page
blockHashstring | nullNoOptional block hash for historical reads

Request Example#

{
"jsonrpc": "2.0",
"method": "childstate_getKeysPaged",
"params": [
"0x3a6368696c645f73746f726167653a5f6578616d706c65",
"0x",
64,
null,
null
],
"id": 1
}

Response Example#

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

Usage Notes#

  • Repeat the call with startKey set to the last key returned until an empty array is received.
  • Combine with childstate_getStorage to fetch the values belonging to each key.
  • Some public RPC endpoints may restrict access to child storage for security reasons; in that case the call returns an empty list.