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
totalSupplystorage slot against a trusted block header.
Parameters
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | address | string (hex) | Yes | The account to generate proofs for. |
| 2 | storageKeys | array of string (hex) | Yes | Storage slots to include in the storage proof. |
| 3 | blockTag | string | No | Block at which to generate the proof.Default: latest |
Response
| Type | Description |
|---|---|
| object | Object 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
Try it live in the BNB Smart Chain playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32602 | Invalid params | Address malformed or a storage key is not 32 bytes. |
-32000 | Missing trie node | Block 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_getStorageAtis 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
accountProofup to its root and match it against thestateRootin 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"