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.
("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.
wallet - The wallet address that will own this identitycommitment - The ZK identity commitment (32 bytes)recovery_commitment - Recovery commitment for key rotationchannels - Bitmap of configured recovery channels (bit 0=passkey, 1=4word, 2=email, 3=telegram, 4=phone)("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:
wallet - The wallet addressnew_commitment - New ZK commitmentnew_recovery_commitment - New recovery commitmentnew_channels - Updated channel bitmap("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.
wallet - The wallet addressnew_channels - New channel bitmap("channels", wallet) -> (old_channels, new_channels, version)fn update_channels(
env: soroban_sdk::Env,
wallet: soroban_sdk::Address,
new_channels: u32,
)