circuits_lib::bridge_circuit::storage_proof

Function verify_storage_proofs

Source
pub fn verify_storage_proofs(
    storage_proof: &StorageProof,
    state_root: [u8; 32],
) -> (WithdrawalOutpointTxid, u32, MoveTxid)
Expand description

Verifies Ethereum storage proofs related to deposit and withdrawal UTXOs.

§Parameters

  • storage_proof: A reference to StorageProof, containing UTXO, vout and deposit proofs.
  • state_root: A 32-byte array representing the Ethereum state root.

§Returns

A tuple containing:

  • A WithdrawalOutpointTxid representing the transaction ID (txid) of the withdrawal outpoint.
  • A u32 representing the output index (vout) of the withdrawal outpoint.
  • A MoveTxid array representing the move-to-vault transaction ID.

§Panics

  • If JSON deserialization fails.
  • If the computed deposit storage key does not match the proof.
  • If the computed UTXO storage key or deposit index is invalid.
  • If the proof verification via storage_verify fails.