Ethereum
Pronto para usar isso em produção?
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
Ethereum
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
eth_getProof (EIP-1186) returns an account's core fields — balance in ETH wei, nonce, codeHash, storageHash — together with the Merkle-Patricia trie proof that ties them to the block's stateRoot, plus proofs for any storage slots you ask about. Ethereum stores all account and storage state in Merkle-Patricia tries, and this method gives you the chain of RLP-encoded trie nodes from the leaf up to the root. With that, anyone holding only a trusted block header can verify a balance or slot value without trusting the node that served it. Call it on mainnet (chain ID 1) at https://ethereum.therpc.io/YOUR_API_KEY. The accountProof and storageProof arrays it returns are the cryptographic witness; the bare values without the proof are what eth_getBalance or eth_getStorageAt give you.
stateRoot in the header, so a lying node can't forge it.| # | Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
| 1 | address | string (hex) | Sim | The account to generate proofs for. |
| 2 | storageKeys | array of string (hex) | Sim | Storage slots to include in the storage proof. |
| 3 | blockTag | string | Não | Block at which to generate the proof.Padrão: latest |
| Tipo | Descrição |
|---|---|
| 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). |
Try it live in the Ethereum playground.
| Código | Mensagem | Causa |
|---|---|---|
-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). |
eth_getStorageAt and eth_getBalance give you the raw values with none of that machinery.-32000 missing-trie-node error; you need an archive node to prove historical state.accountProof chain up to a root and check it equals the stateRoot from a block header you already trust. Skip that step and you've verified nothing.Parâmetros
0x-prefixed 20-byte address
array of 32-byte hex slot indices, may be empty []
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"