BNB Smart Chain

BNB Smart Chain

eth_getProof

Every account on BNB Smart Chain lives inside a Merkle-Patricia trie rooted in each block header: its BNB balance, nonce, code hash, and storage. eth_getProof returns an account's core fields together with cryptographic trie proofs for that account and any storage slots you request, so a verifier can confirm the values against a known state root rather than trusting the node. Issue the request to https://bsc.therpc.io/YOUR_API_KEY on chain ID 56 and you receive accountProof plus a storageProof array, the raw material for trustless reads from a fast-finality PoSA chain.

Use cases

  • Let a light client or a cross-chain bridge contract confirm a BSC account or slot value without re-executing the chain.
  • Assemble the fraud proofs or validity proofs that an L2 dispute mechanism needs when settling onto BNB Smart Chain.
  • Hand state-witness blobs to a stateless-client prototype so it can execute blocks without holding the full trie.
  • Audit a BEP-20 token's circulating supply by proving its totalSupply storage slot against a trusted block header.

Parameters

#NameTypeRequiredDescription
1addressstring (hex)YesThe account to generate proofs for.
2storageKeysarray of string (hex)YesStorage slots to include in the storage proof.
3blockTagstringNoBlock at which to generate the proof.Default: latest

Response

TypeDescription
objectObject containing: address, balance (hex wei), codeHash (hex), nonce (hex), storageHash (hex), accountProof (array of hex-encoded RLP trie nodes), storageProof (array of {key, value, proof} objects).

Example request

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getProof",
"params": [
"0x8894E0a0c962CB723c1976a4421c95949bE2D4E3",
[],
"latest"
],
"id": 1
}'

Try it live in the BNB Smart Chain playground.

Errors & troubleshooting

CodeMessageCause
-32602Invalid paramsAddress malformed or a storage key is not 32 bytes.
-32000Missing trie nodeBlock is too old and the node has pruned state (non-archive node).

Common pitfalls

  • Checking a proof means coding Merkle-Patricia trie traversal yourself. If you only need the number and trust the node, plain eth_getStorageAt is far less work.
  • The node must still hold state for the block you target, so historical proofs demand an archive node or at least one that retains the relevant trie.
  • A proof is only meaningful once you hash accountProof up to its root and match it against the stateRoot in that block's header. Skip that step and the data proves nothing.

Supported networks

  • Mainnet — Chain ID: 56
  • Testnet — Chain ID: 97

See also

Parameters

0x-prefixed 20-byte address

array of 32-byte hex slot indices, may be empty []

hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getProof","params":["0x8894E0a0c962CB723c1976a4421c95949bE2D4E3",[],""]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.