Getting the Storage Proof

First we need to fetch the storage proof from Optimism using the block number of a Optimism block which header that has already been propagated to Hashi. This block number ensures that Hashi can verify the proof against the just mentioned block header propagated to Gnosis Chain.

Fetching the Proof

Use the following curl command or javascript script to fetch the account and storage proof for the USDC total supply on Optimism:

curl --location --request POST 'https://jsonrpc.hashi-explorer.xyz/v1' \
--header 'Content-Type: application/json' \
--data-raw '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "hashi_getAccountAndStorageProof",
  "params": {
      "chainId": 10,
      "address": "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
      "storageKeys": ["0x00000000000000000000000000000000000000000000000000000000000000b"],
      "blockNumber": 126086800
  }
}'
  • chainId: 10 (Optimism).

  • address: The address of the USDC contract on Optimism: 0x0b2c639c533813f4aa9d7837caf62653d097ff85.

  • storageKeys: The storage key for the USDC total supply: 0xb.

  • blockNumber: The block number on Optimism, 126086800, which must have already been propagated to Gnosis Chain via Hashi for the proof to be valid.

This curl command returns the account and storage proof for the USDC total supply, which will be used for verification on Gnosis Chain.

Use the SP1 storage proof generator

Hashi support SP1 zkVM to generate storage proofs.

RUST_LOG=info cargo run --release -- --execute \
    --rpc-url https://mainnet.infura.io/v3/YOUR-PROJECT-ID \
    --reference-block-number 0x7B60EA3 \
    --proof-block-number 0x783EE90 \
    --account 0x0b2c639c533813f4aa9d7837caf62653d097ff85 \
    --storage-key 0x000000000000000000000000000000000000000000000000000000000000000b

Last updated