This article was translated from Japanese with AI. Read the original (日本語) · Report a translation issue

This article takes a deep dive into how Spark works, building up from its underlying technologies, including statechains and threshold signatures (FROST).

I presented Spark at the "Bitcoin L2 Technology Trends Study Session" held on March 12, 2026.

【3/12開催】ビットコインL2技術最新トレンド勉強会:Ark、Spark、Lightning、Liquid
2026/3/12(木)開催。ビットコインL2の最新動向を概観する勉強会。Ark/Sparkプロトコル、LNルーティング、LiquidでのRWAトークン設計やSimplicity言語など、技術的な論点を中心に解説・議論します。開発者・リサーチャー向けのオフラインイベントです。

The slides from the event are available here.

In this article, I want to cover the parts of the Spark specification that I couldn't fully explain at the event. I also explain it in a video.

1. Spark in a Nutshell

Figure 1: Overview of the Spark service

In Spark, an operator called a Spark Service Provider (SSP) runs the service infrastructure for fast payments. By moving their bitcoin off-chain onto Spark, users can make fast payments without generating an on-chain transaction each time.

In addition, by routing through a Lightning Network (LN) node operated by the SSP, users can also send payments to ordinary LN users who don't use Spark. In other words, Spark is its own off-chain payment system, yet it is also interoperable with LN.

Spark also has a mechanism called unilateral exit. Even if the SSP shuts down its service or misbehaves, users can bring their funds back on-chain by publishing pre-prepared exit transactions. This gives users a last resort for protecting their own funds without depending too heavily on the SSP.

In short, users can send payments over LN without running their own LN node, simply by holding their Spark private keys and the means to exit.

2. Structure of Spark's Transaction Tree

Although Spark is an off-chain protocol, it is designed in line with Bitcoin's on-chain protocol and mechanisms. This is so that users can exit unilaterally by publishing transactions, and so that transfers are atomic.

For this reason, the Spark service manages user funds in the form of a transaction tree.

2-1. Tree Structure and the Role of Each Transaction

In Spark, a root transaction (TX) is published on-chain, and a transaction tree is built off-chain on top of it.

Using a tree structure limits how much any one transaction at the leaves of the tree affects the other leaf transactions.

Figure 2: Conceptual diagram of a Spark transaction tree

Root transaction (root TX)
This is the TX that Spark operators publish on-chain, and it serves as the collateral backing off-chain transfers on the Spark service. It is a Taproot transaction locked with an aggregate key combining the keys of all Spark participants and the SSP. (I explain how keys are combined later.)
Unlike Ark, Spark has no concept of rounds, because funds can be sent at any time as long as the Spark operators approve, and only one transaction per Spark tree needs to be published on-chain.

Branch transaction (branch TX)
An intermediate transaction connecting the root TX to the leaf TXs.
Figure 2 has only four leaf TXs, so there are few branch TXs, but a Spark deployment in actual operation has an enormous number of leaves, and the number of branch TXs grows in proportion.
Like the root TX, each branch TX is locked with an aggregate key of the SSP and the owners of the leaf TXs beneath that branch.

Leaf transaction (leaf TX)
What gets allocated to each user as funds on the Spark service are the leaf TX and the exit TX. A leaf TX is allocated as user funds on the Spark service and is managed by the SSP. Transfers on Spark happen by passing leaf TXs from one user to another. A leaf TX is locked by the keys of its owner and the Spark operators.

Exit transaction (exit TX)
The exit TX is what allows its owner to unilaterally exit the Spark service. It is a child transaction of the leaf TX. It is created jointly by the owner and the Spark operators, and the user keeps it for exiting.
It is locked by a Bitcoin script whose spending condition is "after the relative timelock expires, pay the user who owns the leaf TX."

3. The Technologies Behind Spark: Statechains and Elliptic Curve Cryptography

This section explains two background technologies that are key to understanding Spark: how statechains work, and how keys are combined and split in elliptic curve cryptography.

Spark makes transfers using a mechanism called a statechain. Statechains are a Layer 2 technology that was being discussed well before Spark appeared, but they had problems with the security and flexibility of transfers. Spark addresses those problems by applying properties of elliptic curve cryptography to statechains.

In this section, I skip over the finer details of elliptic curve cryptography and pull out only the important parts that relate to Spark.

3-1. (Background Technology 1) What Is a Statechain?

A statechain is a way of making off-chain transfers by handing over the right to spend a particular UTXO to another user. The simplest way to "hand over the right to spend a UTXO" is to hand over the private key.

✏️
When I first heard the name "statechain," it gave me the impression of some new kind of blockchain technology. In fact, the name comes from a "chain of transitions in ownership state."

If you simply hand over a private key, there is no guarantee that the previous owner has deleted it, so they can still spend the funds after the handover. So let's consider a statechain that uses a 2-of-2 multisig.

Example of a statechain using a 2-of-2 multisig

Figure 3: A statechain using a 2-of-2 multisig

In this statechain-based off-chain payment service, the operator (O) running the service acts as an intermediary for transfers.

  1. The operator and User B create a 2-of-2 multisig and lock funds in it.
  2. User B makes a transfer by handing over their multisig private key to another user, User C.
  3. User C can in turn transfer the funds by handing the private key to yet another user, or, with the operator's cooperation, unlock the multisig and send the funds on-chain.

With the operator's cooperation, we have built a simple statechain, but this approach has the following two problems.

Problem 1: Risk of collusion between the previous key holder and the operator
Using a 2-of-2 multisig statechain means the previous key holder can no longer make an illegitimate transfer on their own. However, as shown at the bottom right of Figure 3, if the previous key holder colludes with the operator, the previous key holder can make an illegitimate on-chain withdrawal. If that happens, User C, the current key holder, loses their off-chain funds.

In other words, this statechain assumes that the operator won't cheat, which means you have to trust the operator.

Problem 2: No flexibility in transfer amounts
Because ownership of the multisig transaction is handed over as is, you can only send the exact amount locked in the multisig. You cannot send an arbitrary amount.

A statechain implementation: Mercury Layer

Spark makes transfers using this statechain mechanism, but Mercury Layer implemented statechains before Spark did. Kishin Kato has written about Mercury Layer before.

Statechainsを実装したMercury Layerはどのようなレイヤー2なのか?
BRC-20トークンブームの再来によりビットコインの送金手数料が再び高騰している今月、ライトニングネットワークでは送金トラブルなどによるチャネルの強制閉鎖によって大きな出費を強いられるノード運用者が目立ちました。 背景としては送金手数料の高騰以外にもライトニングウォレットのZeusがHodl Invoiceというテクニックを使ったオフライン受け取りを実装したところ、Mutinyというブラウザウォレットとの相性が悪く強制閉鎖を招きやすかったという事情があります。また、Phoenixなど必要に応じてオンチェーントランザクションでライトニングチャネルの容量を拡張するウォレットは当然手数料高騰のあおりを受けてしまいます。いずれにせよ、手数料高騰時の強制閉鎖は金額的なインパクトも大きく、話題になりやすいものです。 Just one FC. 250k+ sats for one sweeped expired HTLC. One of seven. There are no words. I’m thinking. pic.twitter.com/EUqABPV3k0 — SunnySar

Mercury Layer reduced the collusion risk by using a type of Trusted Execution Environment (TEE), a program execution environment isolated from the rest of the system. However, it could not send arbitrary amounts. For that reason, as mentioned in the article, it was being considered for transferring LN channels.

Unfortunately, as of April 2026, Mercury Layer has shut down. Still, what Mercury Layer attempted, and where it fell short, has been carried forward into Spark.

3-2. (Background Technology 2) The Addition Property of Elliptic Curve Cryptography

I'd rather not get into highly technical math, but because "adding and subtracting keys" is central to understanding Spark, I'll explain the relevant properties of elliptic curves as simply as I can. To summarize up front: in elliptic curve cryptography, points on the elliptic curve are public keys and signatures, and "the number of times you step along points" is the private key. By adding and subtracting "the number of times you step along points," you can combine private keys or split one into several.

✏️
If your head starts spinning as you read, or if you just don't like this kind of math, feel free to skip ahead.
Also, to keep things simple, I've heavily simplified and abstracted the material, so some of the wording is not strictly correct mathematically. Please bear with me.

Addition on an elliptic curve

Figure 4: How addition works on an elliptic curve

Suppose, as in Figure 4, we want to find point R, the sum of points P and Q. Draw a straight line through P and Q, and call the point where it hits the elliptic curve again -R. The point R, which is the reflection of -R across the x-axis, is the sum of P and Q.

Next, let's look at what happens when you repeat the addition several times.

Each elliptic curve has a fixed starting point for cryptographic operations, point G, called the base point. Performing the "addition on an elliptic curve" described above once takes you to point 2G. Likewise, adding twice gets you to point 3G, and three times gets you to 4G.

Figure 5: Repeated addition on an elliptic curve

First, trace the path from point G to point 4G in Figure 5 above. In elliptic curve cryptography, the number of additions starting from base point G is the private key, and the point you arrive at is the public key. So in the figure above, "3 times" is the private key and "point 4G" is the public key.

Combining and splitting keys
If you treat points on the elliptic curve and numbers of additions as keys, you can add those keys together or split them into several.

For example, on the elliptic curve in Figure 5, besides the private key "3 additions" and the public key "point 4G," the point reached after "1" addition, "point 2G," and the point for "2" additions, "point 3G," can also form key pairs.

Figure 6: Combining keys through repeated addition of points on an elliptic curve

In other words,

point after 1 addition + 2 more additions = point 4G after 3 additions

so you can add up numbers of additions to find a new point.

By the same mechanism, you can also subtract to split one point from another:

point 4G after 3 additions − undoing 1 addition = point 3G after 2 additions

Spark uses this property of elliptic curves to combine and split keys, and that is how it makes transfers possible.

4. How Transfers Work in Spark

This section explains how transfers are carried out in Spark.

I'll explain how Spark uses statechains and the key addition and splitting of elliptic curve cryptography to mitigate collusion and to allow transfers of arbitrary amounts.

4-1. Collusion Risk Mitigation in Transfers

In the statechain section, I described "Problem 1: Risk of collusion between the previous key holder and the operator." Spark makes transfers by handing over the private key of a leaf TX. In doing so, it uses the key addition and splitting of elliptic curve cryptography described above to reduce this collusion risk.

Figure 7: Statechain transfers using key combination and key splitting to mitigate collusion

Using Figure 7, I'll walk through the steps for sending a leaf TX (the safe icon labeled TX in the figure) from User A to User B. Figure 7 shows key icons numbered "50," "100" and "150." The number N on each key icon means "add N times starting from base point G," in other words, the value of the private key. (Note that these key values have nothing to do with the amount of BTC being sent; they are private key values.)

Step 1. The user and operator generate an aggregate private key
A leaf TX in a Spark tree is locked by an aggregate private key that the TX's owner and the operator create together. To generate the aggregate private key, User A and the operator each create their own private key.

For example, suppose User A creates the private key "50" and the operator creates the private key "100." Through the key combination mechanism described above, "50 + 100 = 150" produces a new private key, "150." This is the aggregate private key generated by User A and the operator. The user's leaf TX has its funds locked by the aggregate private key "150."

Step 2. Starting a transfer from User A to User B
Let's walk through the process for a transfer from User A to User B. User A gives User B the private key "50." The recipient, User B, generates a new private key of their own for receiving, "10." User B calculates the difference from User A's private key and finds that it is "40."

Step 3. The operator adjusts its key and discards the old one
User B tells the operator the difference, "40," and the operator adjusts its key based on that value, computing "100 + 40 = 140" to create a new private key, "140." At the same time, the operator deletes its old private key, "100."

Step 4. Mitigating collusion after the key adjustment
Even if, after the transfer to User B is complete, User A colludes with the operator to try to withdraw or send the funds, the aggregate private key User A and the operator can produce is "50 + 140 = 190," which cannot unlock funds locked by the private key "150." Meanwhile, User B and the operator can produce the aggregate private key "150" via "10 + 140 = 150," so they can spend the locked funds.

✏️
For all the complex steps involved, such as key combination and key adjustment, in the end you still have to trust that the operator actually deleted its key. If it didn't, User A and the operator can still collude.

4-2. Sending Arbitrary Amounts with a Statechain

Figure 8: TX exchange between user and operator to send an arbitrary amount

Mercury Layer, a statechain, could not send arbitrary amounts, but Spark makes this possible with the SSP's cooperation.

A Spark user hands the SSP a leaf TX worth more than the amount they want to send, and the SSP generates two TXs, "a leaf TX for the payment amount + a change leaf TX," and gives them to the Spark user.

During this exchange, the Spark user and the SSP use adaptor signatures to swap the leaf TXs atomically. I'll skip the details of adaptor signatures, but in short, the leaf TX the Spark user hands to the SSP and the two leaf TXs the SSP hands to the user are locked with a secret value, and none of the three transactions' signatures can be completed until that secret value is revealed.

Once the Spark user has the "leaf TX for the payment amount," they send it using the Spark transfer method described above.

4-3. The Spark Tree After Sending and Receiving

Some readers may wonder how the Spark tree changes after funds are sent and received. In Ark, each transfer adds TXs onto the leaves, so the tree's structure changes. Spark, however, is a statechain: users are only handing ownership of the tree's leaf TXs back and forth. So the tree's structure does not change. (Exit TXs are the exception. More on that later.)

The swap for sending arbitrary amounts described above is also just a simultaneous exchange of ownership: the SSP's "leaf TX for the payment amount + change leaf TX" for the Spark user's leaf TX.

5. How Exits Work

Bringing user funds on the Spark service back on-chain is called exiting. There are two ways to exit: a cooperative exit, done with the SSP's cooperation, and a unilateral exit, which a Spark user performs on their own initiative alone, for example to escape from the Spark service.

5-1. How a Cooperative Exit Works

In a cooperative exit, the user works with the SSP and exits without using exit TXs. This converts funds on Spark into on-chain funds faster than a unilateral exit.

The user sends the SSP the leaf TXs to withdraw and the on-chain address to withdraw to. Based on that information, the SSP creates a TX to publish on-chain and exchanges it for the leaf TXs the user owns on Spark, which lets the user bring their Spark funds back on-chain.

There is a mechanism that prevents the user from ending up with both the leaf TXs and the on-chain BTC during a cooperative exit, but I'll skip the details.

5-2. How a Unilateral Exit Works

Figure 9: A user's unilateral exit from the Spark service

A unilateral exit is the last resort for moving user funds on Spark to safety on-chain when the Spark user can no longer trust the SSP, for example because the SSP has stopped functioning or is misbehaving. It is a key feature underpinning Spark's minimal degree of self-custody.

Each time a Spark user receives ownership of a leaf TX through a transfer, they create an exit TX descending from that leaf TX, to be published on-chain. The SSP then adds its signature to this exit TX, which makes it a valid transaction. The user stores this signed exit TX themselves.

To exit unilaterally, the user publishes the exit TX on-chain. However, for the exit TX to be valid, its parent leaf TX and branch TXs must also be published on-chain. Unlike in Ark, a Spark user may hold multiple leaf TXs on separate branches, so the number of transactions that must be published in a unilateral exit tends to be large.

In addition, exit TXs carry a timelock as a safeguard against the cheating risk described below. So even after publishing the exit TX on-chain, the user cannot freely use their funds until the timelock expires.

The fees for publishing these transactions on-chain are, as a rule, expected to be paid by the user. That makes a unilateral exit expensive in fees, and it also takes time to get your funds back. A unilateral exit is therefore not something you would use day to day; it is a final safety mechanism in case the SSP can no longer be trusted.

5-3. Decreasing Relative Timelocks to Prevent Cheating by Users

Figure 10: The exit TX's timelock decreases with each transfer

So far I've explained that Spark transfers ownership of leaf TXs and that exit TXs are used for unilateral exits. The problem here is that, even after ownership of a leaf TX has been transferred, the previous user can keep holding their exit TX. In other words, the previous owner of a leaf TX could try to steal the funds by publishing their exit TX on-chain.

To counter this, Spark generates a new exit TX with each transfer and lowers the relative timelock assigned to it. In other words, the latest exit TX always has the shortest relative timelock, so only the latest exit TX can make it into a block first.

🤔
For this mechanism to work, someone has to constantly watch whether an old exit TX has been published on-chain. Since Spark users are assumed not to run nodes, Spark handles this too with a feature called Spark Watchtower: Spark continuously monitors the chain, and if it spots an old exit TX, it publishes the latest exit TX on the user's behalf.

In Spark's reference implementation, the relative timelock is set to 2,000 blocks and decreases by 100 blocks with each transfer. However, after at most 19 transfers there is no room left to decrease it, so with the SSP's cooperation a new intermediate TX is inserted between the leaf TX and the exit TX, and the timelock is reset. The intermediate TX has no relative timelock wait, so it always gets into a block before any old exit TX, which invalidates the old exit TXs. Inserting this intermediate TX is done jointly by the owner and the Spark operators.

6. Approval of Transfers and TX Creation by Multiple Spark Operators

In "Collusion Risk Mitigation in Transfers" and "Sending Arbitrary Amounts with a Statechain," I explained that transfers and TX creation happen when the SSP generates signatures. That work is not performed by a single Spark operator; it is carried out only when approved by multiple operators.

6-1. (Background Technology 3) What Is the FROST Threshold Signature Scheme?

Figure 11: Spark operators deciding whether to allow a transfer on Spark with a flag-raising game

Spark operators use a threshold signature technique called FROST to impose a cryptographic constraint: a signature can be produced only when approvals exceed the threshold. I won't go into FROST in detail in this article, but in short, the operators run a cryptographically enforced vote on whether to allow a transfer, using their approval keys, and a signature can be produced only if a certain number of operators approve.

For FROST, I recommend the clear explanation in a GBEC YouTube video by Shigeyuki Azuchi, who has previously contributed an article to Bitcoin Research Lab.

6-2. Why Use Multiple Spark Operators: Avoiding Custody

The purpose of using such a complex mechanism to require approval from multiple Spark operators presumably includes security, but the main reason is thought to be avoiding being classed as custody.

In a statechain the operator has a lot of power, and with only a single operator, you can't rule out the operator acting maliciously, for example by colluding. That could fall foul of custody regulations, under which a party must not be able to move other people's funds. So by setting a cryptographic threshold on approval by multiple operators, Spark makes cheating harder and avoids being classed as custody.

That said, you need to consider how decentralized the multiple operators actually are. If the Spark operators are tied together by shared interests, for example, the setup effectively becomes close to a single-operator configuration.

7. Spark and the Lightning Network

Spark is a Layer 2 protocol like the Lightning Network, but it is not a replacement for LN. Rather, it is a protocol that assumes LN exists and complements it.

7-1. The Burden of Liquidity Management on the SSP

If the recipient is not a Spark user, a Spark user can pay them over LN.

Figure 12: Steps for an LN payment via Spark

An LN payment by a Spark user proceeds as follows.

  1. The LN user creates a secret value, the preimage, and issues an invoice containing the payment_hash, the hash of that secret value.
  2. The Spark user receives the invoice from the recipient on LN.
  3. The Spark user gives the SSP a leaf TX locked with the payment_hash, along with the invoice.
  4. The SSP pays the invoice from its own LN node and obtains the secret value, the preimage.
  5. The SSP uses the preimage to unlock the locked leaf TX, which becomes the SSP's funds.

Conversely, Spark users can also receive funds via LN from users outside Spark.

Because the logic for payments between Spark and LN is designed to be atomic, it is impossible for just one side, either the Spark user or the operator, to receive the funds. However, the user still has to trust the liquidity on LN that the SSP manages.

8. Spark's Source Code and Protocol Standards

Spark's server implementation is published openly on GitHub. This serves as the reference implementation. Spark can be used by parties other than Lightspark, and you can run it yourself, either locally or as a service.

GitHub - buildonspark/spark: The Spark Bitcoin layer 2 protocol
The Spark Bitcoin layer 2 protocol. Contribute to buildonspark/spark development by creating an account on GitHub.

Spark takes the "stance" of being an open protocol, like Bitcoin with its BIPs, through SIPs (Spark Improvement Proposals).

GitHub - buildonspark/sip: Spark Improvement Proposals
Spark Improvement Proposals. Contribute to buildonspark/sip development by creating an account on GitHub.

So far, though, there is only SIP-1, and in practice the new SIPs proposed in issues and pull requests have seen almost no discussion.

9. Similarities and Differences with Ark

Spark has a lot in common with Ark, as listed below.

  • There is a service provider.
  • Users deposit funds with the service.
  • The service manages users' funds (transactions) in a tree structure.
  • Users can unilaterally exit the service by publishing transactions on-chain.
  • Users can make LN payments through the service provider.

With this much in common, it seems that Ark and Spark share the same vision. But while what they can do is similar, the technologies they are built on are very different. Spark also requires users to place more trust in the service provider than Ark does.

I explain Ark in the article below.

Arkは何を変えるのか: Lightning Networkと比較した利点
本記事ではArkが日常的なビットコイン決済においてどのように優れ、Lightning Network送金と比較したメリット・デメリットを、なるべく簡単にユーザー目線で整理します。

10. Summary

Spark manages to deliver, using only existing technology, the kind of non-custodial Layer 2 payments that Ark is aiming for. On the other hand, its specification is more complex than Ark's, and it cannot avoid requiring trust in the service provider for transfers, or the SSP being able to see the details of transfers between users.

The Spark service offered by Lightspark in particular is often criticized for its heavy trust assumptions. I'll cover the problems with Lightspark's Spark payment service in a separate article.

References

1. Spark. TL;DR: Spark Overview. https://docs.spark.money/learn/tldr
2. Lightspark. Spark Protocol Source Code. GitHub. https://github.com/buildonspark/spark
3. Spark. Spark: Bitcoin Layer-2 Payments Infrastructure. https://www.spark.money/
4. Spark. Spark Network Status. https://www.spark.money/status
5. Lightspark. Lightspark Official Website. https://www.lightspark.com/
6. Kishin Kato. "Spark: A New Layer 2 Invented by Lightspark," Bitcoin Research Lab. https://bitcoin-research.jp/spark-statechains-evolution/
7. Kishin Kato. "A New Kind of Bitcoin Ecosystem Emerging from the Spark–Xverse Partnership," Bitcoin Research Lab. https://bitcoin-research.jp/xverse-spark/
8. Bitcoin Magazine. Bitcoin Layer-2 Statechains. https://bitcoinmagazine.com/technical/bitcoin-layer-2-statechains