This documentation provides a high-level overview of how the protocol works. While the core concepts and flows are accurate, certain implementation details and design choices may evolve over time as the system matures. Please treat this as a conceptual guide rather than a source of exact specifications.

UTXO Model

Token Transactions on Spark draw heavy inspiration from the Bitcoin UTXO model. An L1 token transaction takes a set of inputs and spends them to form a set of outputs which must match the value of the inputs (excluding fees).

Partially Signed Bitcoin Transactions (PSBTs)

PSBTs are widely used in Bitcoin L2s, enabling transactions to be signed, authorized, and distributed without immediate on-chain broadcast. Once issued, a valid PSBT cannot be ‘unsigned’ by the creating party if it has already been communicated.

Double Spend Prevention with HTLCs & Revocation Keys

Token Transactions on Spark leverage fundamental concepts to disincentivize cheating that are also used in the Lightning Network called ‘Hashed Timelock Contracts (HTLCs)’ and ‘Revocation Keys’ to manage the irreversible transfer of PSBTs from one party to another.

In Lightning, two parties agree on a shared channel state represented by dual unilaterally broadcastable PSBTs. When a payment is made changing the agreed upon channel balance, both parties cooperatively agree on a new version of those PSBTs. However, in order to finalize them- both parties have to agree on ‘revoking’ the old PSBTs. HTLCs and Revocation Keys are what enable the previous channel balance to be securely revoked.

An HTLC in both Lightning and Spark is a bitcoin output with two spending conditions:

  • Spend using a private Revocation Key immediately
  • Spend using the private key of the Owner in X blocks

By providing both of these spending conditions and ensuring the presence of an active Watchtower which checks for malicious parties attempting to broadcast a revoked PSBT on L1, a sender of funds can safely ‘update’ a PSBT by sharing the revocation key associated with an ‘input’ PSBT at the same time that they finalize the creation of an ‘output’ PSBT.

Distributed Key Generation

A method by which SOs can collectively generate distributed keyshares mapping to a shared Public Key without any SO having access to the full secret. This forces SOs to each release their keyshare to a single party to allow for resolution of the actual Private Key associated with the Public Key. Combined with FROST signatures this enables threshold signing on spent TTXOs.

Final Token Transaction

The full token transaction co-generated and co-signed by both the Issuer/Sender wallet AND the Spark Operator Group that will represent the fully confirmed operation to the LRC-20 Data Availability Network.

LRC-20 Node

A separate node responsible for registering authorized Spark and L1 token transactions and gossiping them to the wider LRC network. Each SO will run its own dedicated LRC-20 node.

LRC-20 Token Public Key

The Token Public key is the unique identifier of a token which maps to the L1 Announcement transaction declaring the metadata of a token (its name, ticker, and other settings like the smallest denomination of each token). It also allows the Issuer to uniquely authorize operations by signing using the associated Private Key that only it possesses.

LRC-20 Gossip Network

A public network of LRC-20 Nodes which are responsible for keeping track of all token transfers on both L1 and Spark. These nodes openly share information about transactions to ensure that any nodes not directly involved in a transfer reach eventual consistency in forming a full Directed Acyclic Graph of all LRC-20 Token Movements.

TTXO: Token Transaction Output

An output representing token holdings on spark. This data blob fundamentally maps to a unique Partially Signed Bitcoin Transaction that can be broadcasted to L1 to unilaterally exit from Spark.

Mint Input

A ‘quasi-input’ representing the token source and issuer metadata related to a mint.

Partial Token Transaction

The initial token transaction payload generated and signed solely by the wallet that specifies the details of the inputs and output the token transaction + the full Spark Operator group which will be authorizing and witnessing the movement of funds.

Threshold

The Spark Operator Threshold is some pre-defined majority of SOs which must sign off on a transaction to make it final. Spark supports threshold signing which allows for valid signature generation even if every SO is not available to sign off on a given transaction.

Revocation Key / Revocation Public Key

A keypair associated with an output. A revocation key is shared for an TTXO that is spent to prevent any attempted double spend of that output.

Spark Operator

A Spark Operator is a single node within Spark responsible for witnessing, co-signing, and enforcing the movement of funds on the Spark Network.

Spark Entity

A group of Spark Operators. For any operation a threshold of Spark Operators (Total number of Spark Operators - a pre-determined threshold) must cooperate to authorize and witness the movement of funds.

Transfer Input

An input referring to an output from a prior token transaction that will be spent as part of the operation.

Unilateral Exit Transaction

The ability for a Wallet to at any point in time broadcast an owned TTXO on-chain and recover the funds to protect against loss of funds in the event that the entire SO set becomes uncooperative or unavailable.

Withdraw Bond

A value defined by the SE and agreed and signed by the Wallet that specifies the Bond that must be provided to broadcast a valid Unilateral Exit transaction on-chain.

Withdraw Relative Block Locktime

A value defined by the SE and agreed and signed by the Wallet that specifies the lockup period of tokens after broadcasting a Unilateral Exit transaction on-chain.

Watchtowers

An L1 chain watcher responsible for storing and managing all prior spent TTXOs along with their released Revocation Keys to protect against Wallets cheating and broadcasting revoked TTXOs. Watchtowers can be run by any entity but at a minimum will be run individually by each SO.