Legacy claim with preimage (for backwards compatibility)
fn claim(
env: soroban_sdk::Env,
preimage: soroban_sdk::Bytes,
commitment: soroban_sdk::BytesN<32>,
recipient: soroban_sdk::Address,
)
fn get_vk(env: soroban_sdk::Env) -> Option
Deposit funds with a commitment (ZK-compatible) The commitment can be:
fn deposit(
env: soroban_sdk::Env,
from: soroban_sdk::Address,
asset: soroban_sdk::Address,
amount: i128,
commitment: soroban_sdk::BytesN<32>,
timeout_ledger: u32,
zk_version: u32,
)
ZK claim with Groth16-style proof verification Uses BN254 pairing check for verification (Ethereum-compatible)
The proof demonstrates knowledge of:
Circuit should use Poseidon hash for ZK-friendly commitments
fn claim_zk(
env: soroban_sdk::Env,
commitment: soroban_sdk::BytesN<32>,
proof: ZkProof,
recipient: soroban_sdk::Address,
)
fn get_pending(
env: soroban_sdk::Env,
commitment: soroban_sdk::BytesN<32>,
) -> Option
fn is_deployed(env: soroban_sdk::Env) -> bool
Constructor called once at deployment
Args:
fn __constructor(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
vk: VerificationKey,
)
Public reclaim after timeout
fn reclaim_expired(env: soroban_sdk::Env, commitment: soroban_sdk::BytesN<32>)
Set the verification key for ZK proofs (admin only) This should be called once with the circuit's verification key
fn set_verification_key(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
vk: VerificationKey,
)