Polygon
هل أنت مستعد لاستدعاء هذا في الإنتاج؟
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
Polygon
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
eth_getProof (EIP-1186) returns an account's core fields — balance in MATIC wei, nonce, codeHash, and storageHash — together with the Merkle-Patricia trie proofs that tie those fields, and any requested storage slots, back to the state root of a chosen Polygon PoS block (chain ID 137). Because Polygon is EVM-equivalent and checkpoints its Bor state to Ethereum L1 through Heimdall, these proofs let a verifier confirm account or storage state without trusting the responding node. Call https://polygon.therpc.io/YOUR_API_KEY with an address, a list of storage keys, and a block tag, and the response carries the account proof plus a proof for each storage slot you asked for.
| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 1 | address | string (hex) | نعم | The account to generate proofs for. |
| 2 | storageKeys | array of string (hex) | نعم | Storage slots to include in the storage proof. |
| 3 | blockTag | string | لا | Block at which to generate the proof.الافتراضي: latest |
| النوع | الوصف |
|---|---|
| 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 Polygon playground.
| الكود | الرسالة | السبب |
|---|---|---|
-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 or eth_getBalance is far simpler.stateRoot from that block's header — skipping that step defeats the purpose of the proof.المعاملات
0x-prefixed 20-byte address
array of 32-byte hex slot indices, may be empty []
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"