state_getStorage
Reads a storage key from the latest state (or a given block) on Manta Atlantic.
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
key | string | Yes | Hex-encoded SCALE storage key. |
at | string | No | Block hash to query a historical state. |
Returns#
result: Hex-encoded SCALE bytes representing the stored value.
Storage Targets#
| Use Case | Description |
|---|---|
| Credential registries | Fetch zkSBT schema metadata and issuer records for compliance audits. |
| Note commitment roots | Keep zkAddress wallets synchronized with the shielded UTXO tree. |
| Revocation lists | Monitor nullifiers to invalidate expired credentials. |
Request Example#
{
"jsonrpc": "2.0",
"method": "state_getStorage",
"params": [
"0x26aa394eea5630e07c48ae0c9558cef702a5c1b19e4fce3d99a4c1796f6ce3ac",
"0x1f4c2a8f6815485a1a5e14f953fa6e533659d21a9b2d4399d5c66a1a1a1f9e3b"
],
"id": 1
}
Code Example (@polkadot/api)#
import { ApiPromise, WsProvider } from '@polkadot/api';
const provider = new WsProvider('wss://api-manta-atlantic-mainnet.n.dwellir.com/YOUR_API_KEY');
const api = await ApiPromise.create({ provider });
const storageKey = api.query.zksbt.schemas.key('IssuerId', 'CredentialId');
const value = await api.rpc.state.getStorage(storageKey.toHex());
console.log('Schema metadata bytes', value);
Tips#
- Use
state_getStorageat finalized block hashes when generating compliance reports to ensure deterministic proofs. - Combine with
state_getStorageHashto detect state changes before re-processing large registries.
Errors#
| Code | Meaning |
|---|---|
-32602 | Invalid params (missing key) |
-32000 | Storage entry not found |
Retry with backoff and confirm the key exists in the current runtime metadata.