Before verifying the state, you need to fetch the event proof from Sepolia using the correct block number that has already been propagated to Hashi. This block number ensures that Hashi can verify the proof against the block header stored on Chiado .
Fetching the Proof
Use the following curl
command to fetch the account and storage proof for the USDC total supply on Optimism :
Curl Javascript
Copy curl -- location -- request POST 'https://jsonrpc.hashi-explorer.xyz/v1' \
-- header 'Content-Type: application/json' \
-- data - raw '{
"id" : 1 ,
"jsonrpc" : "2.0" ,
"method" : "hashi_getReceiptProof" ,
"params" : {
"logIndex" : 397 ,
"blockNumber" : 7016999 ,
"chainId" : 11155111 ,
transactionHash : "0x25a6a5c138f3b5a434a3a2b5d6bf7bdf97cb700bd7515f801ecfb71f1d965e7b" ,
}
} '
Copy import axios from "axios" ;
const main = async () => {
// fetch event proof from Hashi Prover
console . log ( "Fetching event proof from Hashi prover..." ) ;
const result = await axios . post (
`http: // jsonrpc.hashi - explorer.xyz: 3000 / v1`,
{
jsonrpc: "2.0" ,
method: "hashi_getReceiptProof" ,
params: {
logIndex: 397 ,
blockNumber: 7016999 ,
chainId: 11155111 ,
transactionHash: "0x25a6a5c138f3b5a434a3a2b5d6bf7bdf97cb700bd7515f801ecfb71f1d965e7b" ,
},
id : 1 ,
},
{
headers: {
"Content-Type" : "application/json" ,
},
}
) ;
console . log ( "Event proof result" , result.data.result.proof) ;
} ;
main () ;
chainId : 11155111 (Sepolia).
txHash : The tx hash that emitted the Transfer event on Sepolia: .
logIndex : The log index for the event.
blockNumber : The block number on Sepolia, 7016999, which must have already been propagated to Chiado via Hashi for the proof to be valid.
This curl
command / script returns the event proof for the Transfer event on Sepolia, which will be used for verification on Chiado .
References