Prerequisites

  • A Spark wallet with funds Wallet with pre-minted tokens
  • The recipient’s Spark Address

Get your token public key

The token public key is your token’s identity on Spark. It links your Bitcoin announcement, powers minting, and is used to derive your Spark address. Your token public key is like your ID — it’s what will show up in the block explorer and be used to look up your token on Spark.

You can retrieve it from your issuer wallet like this:

const tokenPublicKey = await issuerWallet.getIdentityPublicKey();

Transfering tokens

Once you have the recipient’s Spark address (e.g. from user input) and the issuer’s token public key, you can transfer tokens.

For now, you can only send one token per transaction — sending multiple different tokens (e.g. token_a, token_b, token_c in a single transfer) is not supported.

const transactionId = await wallet.transferTokens({
    tokenPublicKey: "03d59b7b65c6ff6c73cb7d04e82ea3dc095b482a604452592210f253897d6b0aer",
    tokenAmount: 100000n,
    receiverSparkAddress: "sp1pgssyuuuhnrrdjswal5c3s3rafw9w3y5dd4cjy3duxlf7hjzkp0rqx6dj6mrhu",
  });

console.log("Spark Transaction ID:", transactionId);

Receiving tokens

Receiving tokens on Spark requires no action — if someone sends tokens to your Spark address, they’ll appear automatically.

You can check your wallet’s balance at any time using:

const balance = await wallet.getBalance();
console.log(`Token balances:`, balance.tokenBalance);

This returns both your sats balance and a map of token balances, keyed by token public key.

Next Steps

You’re all set to mint, send, and receive tokens on Spark. If you want to go further, you can: