Optimism
Bereit, das in der Produktion aufzurufen?
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
Optimism
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
eth_getProof returns the core account fields on OP Mainnet — balance (in ETH wei), nonce, codeHash, and storageHash — together with Merkle-Patricia trie proofs for the account and for any storage slots you request. The proofs let a verifier check those values against the block's state root without trusting the node. OP Mainnet is an OP Stack optimistic rollup (Bedrock) that settles to Ethereum L1, which makes trie proofs especially relevant for bridges and cross-chain state checks across the Superchain. Send the request to https://optimism.therpc.io/YOUR_API_KEY (chain ID 10, 0xa).
| # | Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
| 1 | address | string (hex) | Ja | The account to generate proofs for. |
| 2 | storageKeys | array of string (hex) | Ja | Storage slots to include in the storage proof. |
| 3 | blockTag | string | Nein | Block at which to generate the proof.Standard: latest |
| Typ | Beschreibung |
|---|---|
| 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 Optimism playground.
| Code | Meldung | Ursache |
|---|---|---|
-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 are far simpler on OP Mainnet.accountProof up to a root and check it equals the stateRoot in that OP Mainnet block's header.Parameter
0x-prefixed 20-byte address
array of 32-byte hex slot indices, may be empty []
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"