Contract 34a9e1ab926db3c942a4b1bbb7ded90d75115a2d7f3afc9ac8fa00c7db20b09b

← Back to Index 📥 Download WASM

Meta

rssdkver 23.4.0#de498c4c4b1d99f2cc8a87b8a9993c1ecc51d8ad
rsver 1.92.0

Instances

  • CBYWKDEDGC6LWQBHZZUN6C5SO7YQRZ64MPWXMVWQAYYUBGZF4YRNFBSA

Interface

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:

  • SHA256 hash of preimage (legacy, zk_version=0)
  • Poseidon/Pedersen commitment (ZK, zk_version=1)
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:

  • Private data (email/TG/SMS) that corresponds to the commitment
  • Without revealing the actual data

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

fn __constructor(env: soroban_sdk::Env, owner: soroban_sdk::Address)

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,
)

Imports

WebAssembly Text (WAT) ▶