Swap-in-Potentiam: How On-Chain Deposits Become Lightning Channels Instantly
Swap-in-potentiam lets wallets receive on-chain bitcoin that automatically becomes Lightning channel capacity, eliminating the funding delay.
Getting on-chain bitcoin into a Lightning channel has always required two separate steps: receive the funds, then open or fund a channel. For mobile wallets that are offline most of the time, this creates real friction. Swap-in-potentiam (SIP) is a protocol that collapses those two steps into one. Funds sent to a special on-chain address can be cooperatively swept into a Lightning channel the moment the wallet comes online, or reclaimed unilaterally by the user after a timeout. The result: on-chain deposits that are ready for Lightning from the first confirmation.
Why On-Chain to Lightning Is Still Painful
Opening a Lightning channel is an interactive process. Both the user and their channel partner (typically an LSP) must be online to exchange signatures for the funding and refund transactions before any bitcoin is committed. This works for always-on routing nodes, but mobile wallets are a different story: they wake briefly, do what they need, and go back to sleep.
The traditional workaround is a two-transaction flow. First, the user receives bitcoin to a regular on-chain address. Then, once the wallet is open and online, it initiates a channel open or a splice-in to move those funds into Lightning. Each step requires confirmation time and on-chain fees. The user experience is clunky: receive bitcoin, wait, tap a button, wait again.
Worse, if someone sends bitcoin to the wallet while it is offline, the wallet cannot coordinate a channel open until the user comes back. The funds sit in a plain on-chain address, earning no Lightning utility. This gap between receiving on-chain and being Lightning-ready is what swap-in-potentiam was designed to close.
What Is Swap-in-Potentiam?
Swap-in-potentiam was proposed in January 2023 by ZmnSCPxj and Jesse Posner on the Lightning-dev mailing list. The core idea: instead of sending on-chain bitcoin to a plain single-key address, the wallet generates a special address that is co-owned by the user and an LSP. This address has two spending paths, one cooperative and one unilateral, encoded directly in the Bitcoin script.
The name captures the design philosophy. The funds are “in potentiam” (in potential): they sit on-chain in a state that is ready to become a Lightning channel but have not committed to one yet. The wallet does not need to be online when the deposit arrives. It does not need to pre-negotiate channel parameters. It just needs to share the address.
Non-interactive by design: The sender does not need to know anything about Lightning. They send a normal on-chain transaction to what looks like a standard Bitcoin address. The swap-in-potentiam logic is entirely between the wallet and the LSP.
The Two Spend Paths
A swap-in-potentiam address encodes a contract between the user (Alice) and the LSP (Bob). There are exactly two ways to spend from it:
- Cooperative path: Alice and Bob both sign, moving the funds into a Lightning channel, a new on-chain address, or any other destination they agree on.
- Refund path: after a timeout measured in blocks (using OP_CHECKSEQUENCEVERIFY), Alice can spend the funds unilaterally with only her own key. This is the safety valve if the LSP goes offline or refuses to cooperate.
This structure is conceptually similar to a Spilman-style payment channel, but adapted for the specific purpose of channel funding rather than bidirectional payments.
The Cooperative Path
In the happy case, the wallet comes online and finds confirmed funds sitting in a swap-in-potentiam address. It contacts the LSP, and together they sign a transaction that moves the funds into a Lightning channel (either opening a new channel or splicing into an existing one). Because the LSP co-signed the deposit address, it can trust that the user cannot double-spend the funds during the confirmation window. This lets the LSP treat the channel funding as safe even before the spending transaction confirms, enabling zero-conf channel opens from the LSP's perspective.
The Unilateral (Refund) Path
If the LSP disappears or refuses to cooperate, the user is not stuck. After the CSV timeout expires, the user can broadcast a transaction spending the funds to any address they control, using only their own key. No LSP cooperation required. The timeout is typically set to a period of several weeks, giving ample time for the cooperative path to execute while still guaranteeing the user retains sovereignty over their funds.
How the Protocol Flow Works
Here is the step-by-step flow, from deposit to Lightning-ready funds:
- The wallet generates a swap-in-potentiam address using its own public key and the LSP's public key, with an agreed-upon refund timeout.
- The user (or any sender) pays to this address with a standard on-chain transaction. The wallet does not need to be online for this step.
- The transaction confirms on-chain. The funds are now locked in the two-path contract.
- When the wallet comes online, it detects the confirmed deposit and contacts the LSP to initiate a cooperative spend.
- The LSP and wallet jointly sign a transaction that opens a Lightning channel (or splices into an existing one) using the deposited funds.
- The channel is immediately usable. Because the LSP co-signed the original address, it knows the funds cannot be double-spent, so it can safely treat the channel as funded.
Fallback guarantee: If steps 4 through 6 never happen (the LSP vanishes, the user loses connectivity to the LSP), the user simply waits for the CSV timeout and reclaims the funds on-chain. The worst case is delay, never loss.
From Script to Swaproot: Phoenix's Implementation
ACINQ's Phoenix wallet was the first major Lightning wallet to ship swap-in-potentiam, making it the primary real-world reference implementation. Phoenix has gone through two generations of the design, each improving on cost and privacy.
The Original Design (2023)
Phoenix's initial implementation used a pay-to-witness-script-hash (P2WSH) construction. The script explicitly contained the user's public key, the LSP's public key, and the CSV delay. This worked correctly but had two drawbacks:
- The script was visible on-chain when spent, making swap-in-potentiam transactions easily identifiable via chain analysis.
- The witness data was larger than necessary, increasing transaction fees.
Phoenix also used a single static swap-in address per wallet, which made it trivial to link all deposits to the same user.
The Swaproot Upgrade (2024)
In February 2024, ACINQ introduced Swaproot, a redesigned swap-in-potentiam implementation using Taproot and MuSig2. The key changes:
- The cooperative path uses a MuSig2 key-path spend, aggregating the user and LSP keys into a single public key. On-chain, this looks identical to any other single-signature Taproot transaction.
- The refund path is hidden in a tapscript leaf, only revealed if the user needs to claim funds unilaterally.
- Phoenix now generates a fresh swap-in address for each deposit, breaking the linkability between transactions.
| Aspect | Original SIP (P2WSH) | Swaproot (Taproot + MuSig2) |
|---|---|---|
| Address type | P2WSH (static) | P2TR (fresh per deposit) |
| Cooperative spend | Script-path, two separate signatures | Key-path, single aggregated signature |
| On-chain fingerprint | Identifiable as swap-in | Indistinguishable from normal Taproot spend |
| Witness size | Larger (script + two sigs) | Smaller (single aggregated sig) |
| Fee savings vs original | Baseline | 16% (1 input) to 27% (3 inputs) |
| Address reuse | Single static address | New address per deposit |
The Swaproot upgrade shipped in Phoenix v2.2.0, alongside quiescence support that allows splicing to happen even while payments are in flight. Users can still fall back to the legacy static address if needed.
The Trust Model
Swap-in-potentiam occupies a carefully chosen point in the trust spectrum. The LSP co-signs the address, which means the user trusts the LSP with liveness (availability) but not with custody.
What the LSP Can Do
- Delay channel creation by going offline or refusing to cooperate.
- See deposit amounts and timing (though Swaproot makes deposits harder to identify on-chain).
What the LSP Cannot Do
- Steal funds: the LSP cannot spend from the address without the user's signature (the cooperative path requires both keys).
- Lock funds permanently: after the CSV timeout, the user can claim unilaterally.
- Double-spend the deposit: the funds are in a shared address, so neither party alone can redirect them.
This trust profile is strictly better than zero-conf channel opens where the LSP bears double-spend risk, and comparable to self-custodial Lightning in general: the user always retains an exit path.
SIP Compared to Other Channel Funding Approaches
Swap-in-potentiam is not the only way to get funds into Lightning. It is useful to compare it with JIT (just-in-time) channels, dual-funded channels, and submarine swaps to understand where each approach fits.
| Approach | How it works | Requires wallet online? | On-chain transactions | Trust assumption |
|---|---|---|---|---|
| Swap-in-potentiam | Funds deposited to shared address, cooperatively moved into channel | No (at deposit time) | 1 (deposit) + 1 (channel open/splice) | LSP cannot steal, can delay |
| JIT channel (LSPS2) | LSP opens channel at the moment a Lightning payment arrives | Yes (to receive) | 1 (channel open) | LSP bears zero-conf risk |
| Dual-funded channel | Both sides contribute to the funding transaction | Yes (both sides) | 1 (funding tx) | Trustless (standard channel open) |
| Submarine swap | Atomic swap between on-chain BTC and Lightning payment via HTLC | Yes (for the swap) | 1 (swap tx) | Trustless (hash-locked) |
The key distinction: SIP is the only approach that handles the case where a wallet is offline when funds arrive on-chain. JIT channels solve a different problem (receiving Lightning payments without a pre-existing channel), while dual-funded channels address inbound liquidity at open. Submarine swaps require the user to be online to coordinate the atomic exchange.
In practice, modern mobile Lightning wallets combine several of these techniques. Phoenix, for example, uses SIP for on-chain deposits, splicing for channel capacity adjustments, and its own variant of JIT channel opening for incoming Lightning payments.
Limitations and Tradeoffs
Two On-Chain Transactions
SIP always requires at least two on-chain transactions: the deposit to the swap-in-potentiam address and the spending transaction that moves funds into a channel. This is one more than a direct channel open or a submarine swap. The payjoin-in-potentiam proposal aims to reduce this to a single transaction by having the external sender fund the channel open directly, but it requires sender cooperation and has not been widely deployed.
Timeout Window Risk
The refund timeout creates a window during which the user cannot unilaterally move their funds. If the user needs immediate access and the LSP is unavailable, they must wait. Setting the timeout too short reduces the window for cooperative spending; setting it too long extends the period of reduced flexibility. Implementations typically choose timeouts on the order of several weeks to balance these concerns.
LSP Dependency
While the protocol ensures the LSP cannot steal funds, the user is still dependent on the LSP for the cooperative path. Switching LSPs means waiting for existing swap-in-potentiam addresses to expire (via the timeout) or coordinating a cooperative spend to a new address. This is a form of soft lock-in that does not exist with plain on-chain addresses.
Fee Overhead
The two-transaction requirement means the user pays on-chain fees twice: once for the deposit and once for the channel open or splice. During periods of high fee market activity, this overhead can be significant. Swaproot's fee savings (16 to 27%) help but do not eliminate the fundamental cost of an extra transaction.
Beyond Channels: How Spark Sidesteps the Problem
Swap-in-potentiam is a clever engineering solution to a problem that is inherent to channel-based architectures: getting funds into channels. Every Lightning wallet must solve some version of this problem, whether through SIP, JIT channels, submarine swaps, or manual channel management.
Spark takes a fundamentally different approach. Statechains transfer ownership of bitcoin by rotating key shares rather than routing payments through channels. There are no channels to fund, no inbound liquidity to manage, and no two-step deposit process. When a user receives bitcoin on Spark, it is immediately spendable: no channel open, no splice, no waiting for confirmations beyond the initial deposit.
This does not make SIP irrelevant. For users who are committed to Lightning's channel-based model, swap-in-potentiam represents a meaningful improvement in onboarding UX. But for wallets and applications that prioritize simplicity, Spark's channel-free architecture eliminates the category of problem that SIP was built to solve.
Looking Ahead
Swap-in-potentiam reflects a broader trend in Lightning development: abstracting away the complexity of channel management so that users never have to think about funding transactions, inbound capacity, or splice operations. Phoenix's Swaproot upgrade shows how Taproot and MuSig2 can make these abstractions cheaper and more private.
Future improvements may further reduce the on-chain footprint. The payjoin-in-potentiam variant could cut the transaction count in half for cooperative senders. New covenant proposals could enable even more flexible funding constructions. And the ongoing LSPS standardization effort may formalize swap-in-potentiam as part of the LSP specification suite, making it available across wallet implementations rather than just Phoenix.
For developers building on Bitcoin's Layer 2 ecosystem, the choice between channel-based and channel-free architectures depends on the use case. To explore Spark's approach to instant, self-custodial Bitcoin transfers, check the Spark documentation and SDK. For a hands-on experience with a wallet built on Spark, try General Bread. And for more on how Lightning wallets handle these challenges today, see our deep dive on Lightning mobile wallet architecture.
This article is for educational purposes only. It does not constitute financial or investment advice. Bitcoin and Layer 2 protocols involve technical and financial risk. Always do your own research and understand the tradeoffs before using any protocol.

