Contract 5da7cf0c75376bc8966dc664dbd40180d035b239e982652db31eaa7f4b3afe42

← Back to Index 📥 Download WASM

Meta

cliver 23.4.1#a152ec2488c25136808ad28277c24b3a0765ffd4
rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.92.0

Interface

Burn an identity NFT permanently

This removes the identity entirely. Use with caution. Typically you'd use rotate instead to update to a new commitment.

Events

  • ("burn", wallet) -> (commitment, version)
fn burn(env: soroban_sdk::Env, wallet: soroban_sdk::Address)

Mint a new soulbound identity NFT

The wallet mints its own identity - no admin required. Each wallet can only have ONE identity at a time.

Arguments

  • wallet - The wallet address that will own this identity
  • commitment - The ZK identity commitment (32 bytes)
  • recovery_commitment - Recovery commitment for key rotation
  • channels - Bitmap of configured recovery channels (bit 0=passkey, 1=4word, 2=email, 3=telegram, 4=phone)

Events

  • ("mint", wallet) -> (commitment, channels, version)
fn mint(
    env: soroban_sdk::Env,
    wallet: soroban_sdk::Address,
    commitment: soroban_sdk::BytesN<32>,
    recovery_commitment: soroban_sdk::BytesN<32>,
    channels: u32,
)

Get contract name

fn name(env: soroban_sdk::Env) -> soroban_sdk::Symbol

Rotate identity by burning the old NFT and minting a new version

This is the key mechanism for handling compromised keys:

  1. Burns the current NFT (preserving history in burn event)
  2. Mints new NFT with incremented version

Arguments

  • wallet - The wallet address
  • new_commitment - New ZK commitment
  • new_recovery_commitment - New recovery commitment
  • new_channels - Updated channel bitmap

Events

  • ("burn", wallet) -> (old_commitment, old_channels, old_version)
  • ("mint", wallet) -> (new_commitment, new_channels, new_version)
fn rotate(
    env: soroban_sdk::Env,
    wallet: soroban_sdk::Address,
    new_commitment: soroban_sdk::BytesN<32>,
    new_recovery_commitment: soroban_sdk::BytesN<32>,
    new_channels: u32,
)

Get contract symbol

fn symbol(env: soroban_sdk::Env) -> soroban_sdk::Symbol

Transfer is intentionally NOT implemented Calling this will always fail - NFTs are soulbound

fn transfer(
    env: soroban_sdk::Env,
    _from: soroban_sdk::Address,
    _to: soroban_sdk::Address,
)

Add a channel to the existing bitmap

fn add_channel(env: soroban_sdk::Env, wallet: soroban_sdk::Address, channel: u32)

Get the current version for a wallet's identity

fn get_version(env: soroban_sdk::Env, wallet: soroban_sdk::Address) -> u32

Check if a specific channel is configured Use channel constants: Channels::PASSKEY, Channels::EMAIL, etc.

fn has_channel(
    env: soroban_sdk::Env,
    wallet: soroban_sdk::Address,
    channel: u32,
) -> bool

Get the channel bitmap for a wallet Returns 0 if no identity minted

fn get_channels(env: soroban_sdk::Env, wallet: soroban_sdk::Address) -> u32

Get the identity for a wallet (returns None if not minted)

fn get_identity(
    env: soroban_sdk::Env,
    wallet: soroban_sdk::Address,
) -> Option

Check if a wallet has an identity minted

fn has_identity(env: soroban_sdk::Env, wallet: soroban_sdk::Address) -> bool

Get total number of active identities

fn total_supply(env: soroban_sdk::Env) -> u32

Initialize the contract with metadata

fn __constructor(env: soroban_sdk::Env)

Get just the commitment for a wallet

fn get_commitment(
    env: soroban_sdk::Env,
    wallet: soroban_sdk::Address,
) -> Option>

Remove a channel from the existing bitmap

fn remove_channel(env: soroban_sdk::Env, wallet: soroban_sdk::Address, channel: u32)

Update channels without rotating the identity

Use this to add/remove recovery methods without changing commitments. Increments version since it's still a state change.

Arguments

  • wallet - The wallet address
  • new_channels - New channel bitmap

Events

  • ("channels", wallet) -> (old_channels, new_channels, version)
fn update_channels(
    env: soroban_sdk::Env,
    wallet: soroban_sdk::Address,
    new_channels: u32,
)

Imports

WebAssembly Text (WAT) ▶