Contract af92485eb80d9c0fff2b2e73428aa463cfed12578c268d16c86c7b8040df7682

← Back to Index 📥 Download WASM

Meta

rssdkver 23.4.0#de498c4c4b1d99f2cc8a87b8a9993c1ecc51d8ad
rsver 1.92.0

Instances

  • CA236XAJSSRVPGADAAMFMHIUFCH3A2TQGJ4KK74OW44L37RYNJJFSPX5
  • CCKI7F7PS5J3VZDGQ4DV4UJDM4GZ4XMNB6AF6QPNQXEOIYGCGSRXGBRS
  • CD3INKZWO3OYA72B3ETTCBDAM7ORNKZZAITGXZ72H4H2UQQTBOGXTHDU

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

Args:

  • owner: The wallet C-address that owns this escrow satellite
  • vk: The BN254 Groth16 verification key for ZK claims (same for all users)
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,
)

Imports

WebAssembly Text (WAT) ▶