debug_accountRange - Robinhood
debug_accountRange. Returns a list of accounts and their state at a given block, used for state inspection.
debug_accountRange - robinhood [Value: 20CU]
Enumerates accounts in the state trie at a given block, returning balances, nonces, code hashes, and optionally code and storage, with cursor-based paging
Use cases
- Walk the full state trie of a block for state-export or migration tooling
- Build a custom indexer that needs every account at a block
- Audit account balances across the chain at a fixed height
Constraints
- maxResults is capped (typically 256 accounts per page)
- Requires an archive node for blocks other than recent ones
Unlock Access to 100+ chains
Boost your app's speed and reliability with dRPC - get your access API key
Language
Request
Examples
curl https://lb.drpc.live/robinhood/{API-KEY} \
-X POST \
-H "Content-Type: application/json" \
-d '{"method":"debug_accountRange",
"params":["0xc3007d", "0x0", 5, true, true, true],
"id":1,
"jsonrpc":"2.0"}'
Response
200
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"root": "0x9f73691f6dabca4f0a99b05d0a701995506aa311dcaa9ce9833d6f4ca474c162",
"accounts": {
"0x0599d52c37544c07605f470e5e20c1b266de8588": {
"balance": "1000000000000000000",
"nonce": 4,
"root": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47"
}
},
"next": "0x290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e56"
}
}Request params
idinteger
jsonrpcstring
methodstring
array
blockNrOrHashstring
Block number in hex, a block tag, or a block hash to enumerate accounts at.
- latest [default] - The most recent block in the blockchain (default).
- earliest - The first block, also known as the genesis block.
- pending - Transactions that have been broadcast but not yet included in a block.
startstring
The paging start key (hashed address), as hex bytes. Use 0x00 to start from the beginning.
maxResultsinteger
The maximum number of accounts to return in this page (capped, typically at 256).
nocodeboolean
If true, excludes contract bytecode from the result.
nostorageboolean
If true, excludes storage data from the result.
incompletesboolean
If true, includes accounts whose address preimage is not known to the node.
Response
200
The account range dump for the requested pageResponse params
object
idinteger
jsonrpcstring
resultobject
The state dump for the requested page.
object
rootstring
The state root hash of the block.
accountsobject
A map of account address to account data.
object
balancestring
The account balance, in Wei.
nonceinteger
The account nonce.
rootstring
The account's storage root hash.
codeHashstring
The hash of the account's contract code.
codestring
The contract bytecode (omitted when nocode is true).
storageobject
The account's storage slots (omitted when nostorage is true).
nextstring
The next paging start key. Pass this as start on the following call to continue iterating.