⚠️Blast API (blastapi.io) ends Oct 31. Migrate to Dwellir and skip Alchemy's expensive compute units.
Switch Today →
Skip to main content

state_getStorage

Reads a storage key from the latest state (or a given block) on Manta Atlantic.

Parameters

ParameterTypeRequiredDescription
keystringYesHex-encoded SCALE storage key.
atstringNoBlock hash to query a historical state.

Returns

  • result: Hex-encoded SCALE bytes representing the stored value.

Storage Targets

Use CaseDescription
Credential registriesFetch zkSBT schema metadata and issuer records for compliance audits.
Note commitment rootsKeep zkAddress wallets synchronized with the shielded UTXO tree.
Revocation listsMonitor 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_getStorage at finalized block hashes when generating compliance reports to ensure deterministic proofs.
  • Combine with state_getStorageHash to detect state changes before re-processing large registries.

Errors

CodeMeaning
-32602Invalid params (missing key)
-32000Storage entry not found

Retry with backoff and confirm the key exists in the current runtime metadata.