Skip to main content

Spark Runes Bridge

Spark Runes bridges BTC Runes into Spark as wRunes (BTKN/LRC20) and lets users exit back to BTC.

What it supports

  • Runes -> Spark: mint wRunes after a BTC deposit is confirmed.
  • Spark -> Runes: burn wRunes and build a BTC payout.
  • Unique deposit addresses per user + rune + nonce.
  • FROST threshold signing across verifiers (M=3).
  • 1 BTC confirmation before minting.
  • Amounts are strings (u64) to preserve precision.

Key components

  • Gateway: Orchestrates both directions, derives deposit/exit addresses, and builds payout transactions.
  • Verifiers: Validate deposits and co-sign mint/burn via threshold signatures.
  • BTC indexer: Watches deposits until 1 confirmation.
  • Spark balance checker: Confirms wRune funding on Spark deposits.
  • Spark entity: Executes Spark-side transactions.

How it works (high level)

Runes -> Spark
  1. Gateway derives a multisig for (user_pubkey, rune_id), tweaks it with a random nonce, and returns a unique deposit_btc_address.
  2. User deposits runes and reports { txid, vout }.
  3. Verifiers confirm via the BTC indexer, then the gateway mints wRunes using the issuer multisig; tokens land on the Spark address tied to the user.
Spark -> Runes
  1. Gateway returns a unique exit_spark_address derived/tweaked from the same key pair.
  2. User deposits wRunes; verifiers confirm Spark balance and the gateway signs a burn with the issuer multisig.
  3. Gateway assembles a BTC rune payout to the user; any change goes to a fresh deposit address derived from the same key.

SDK entry point

const runes = bridge.spark.runes;

Next steps

  • Quickstart: bridge/spark-runes/quickstart
  • Architecture: bridge/spark-runes/architecture
  • API reference: bridge/spark-runes/api