Skip to content

XSC-0004: Wrapped Token

XSC-0004 is the wrapped-token standard for representing assets from another chain on Xian. It extends the fungible token model with controlled minting and burning so a bridge or custody system can issue Xian-side balances for locked external assets and destroy them when users unwrap.

Required Concepts

  • standard fungible-token transfers, approvals, and balances
  • collection-level token metadata such as name, symbol, logo, website, and operator
  • a minter role that can issue wrapped supply
  • a burn function that destroys caller-owned supply for unwrapping and declares the external-chain destination

Core Functions

python
@export
def change_metadata(key: str, value: Any):
    ...

@export
def transfer(amount: float, to: str):
    ...

@export
def approve(amount: float, to: str):
    ...

@export
def transfer_from(amount: float, to: str, main_account: str):
    ...

@export
def balance_of(address: str):
    ...

@export
def change_minter(new_minter: str):
    ...

@export
def mint(amount: float, to: str):
    ...

@export
def burn(
    amount: float,
    destination_chain: str,
    destination_address: str,
    memo: str = "",
):
    ...

Expected Semantics

  • only the current minter can call mint
  • mint increases both recipient balance and total supply
  • burn validates a non-empty destination_chain and destination_address, reduces caller balance and total supply, increments a contract-local withdrawal nonce, and returns a generated withdrawal_id
  • transfer_from relies on explicit allowances stored separately from balances
  • bridges should treat mint and burn events as the chain-local accounting signals for wrapping and unwrapping
  • burn events must include from, amount, destination_chain, destination_address, withdrawal_id, and memo
  • bridge watchers should process releases idempotently by (contract, withdrawal_id) and should use the event destination fields as the canonical external recipient

The reference contract limits destination_chain to 64 characters and destination_address and memo to 256 characters each.

The canonical proposal and reference implementation live in xian-xips/XSC004_wrapped_token.