This feature is currently under development and will be available in a future release of Spark.

Prerequisites

  • You have tokens you want to withdraw
  • Your L1 wallet has sufficient funds to cover the withdrawal bond (currently 10,000 sats)

Step 1: Get Your L1 Wallet Address

First, get your Bitcoin L1 wallet address that needs funding for withdrawal:

const l1Address = wallet.getL1Address();
console.log("L1 Wallet Address:", l1Address); // example: bc1p...

Step 2: Fund Your L1 Wallet Address

Before withdrawing, you need to fund this address with:

  • Withdrawal bond (currently 10,000 sats)
  • Network fees for the withdrawal transaction

If testing on Lightspark regtest you can use:

  • Our Faucet
    • username: hackathon
    • password: MakeBitcoinMoneyAgain

Step 3: Withdraw your tokens

Once your wallet has minted and/or received tokens, you can withdraw some or all of those tokens:

const withdrawalTx = await wallet!.withdrawTokens(
    tokenPublicKey: "03e9cd9c3077c97457d44b1eb8f88bb95186c855bfffa247a5404b5bd8cd46229a"
  );

Parameters

  • tokenPublicKey: string - The public key of the token to withdraw
  • tokenAmount?: bigint - (Optional) Amount of tokens to withdraw

Returns

Promise<{ txid: string } | undefined>;

Important Considerations

  • Always verify you have sufficient L1 funds (>10,000 sats) before withdrawing
  • The withdrawal bond is refundable after the locking period
  • Withdrawal requires Bitcoin network fees
  • Transfers to L1 require confirmation time (typically 1-2 Bitcoin blocks)
  • Keep track of your transaction IDs for status monitoring

Conclusion

Congratulations! You’ve completed the Quick Start guide for token issuance on Spark. For more information, check out the API Reference or FAQ.