Lightning Channel
A two-party payment channel funded by an on-chain Bitcoin transaction that enables unlimited off-chain transactions between participants.
Key Takeaways
- A Lightning channel is a two-party payment channel opened by locking Bitcoin in a multisig output on-chain, enabling the participants to exchange funds off-chain using signed commitment transactions without broadcasting to the blockchain.
- Security relies on a penalty mechanism: if one party broadcasts a revoked state, the other can claim the entire channel balance using a revocation key, enforced automatically by watchtowers or the counterparty's node.
- Channels can be closed cooperatively (both parties agree on final balances and publish one transaction) or unilaterally via a force close (one party broadcasts the latest commitment transaction, triggering a timelock delay before funds are spendable).
What Is a Lightning Channel?
A Lightning channel is a persistent, off-chain payment relationship between two Lightning nodes. It begins with a funding transaction that locks Bitcoin into a 2-of-2 multisig output on the Bitcoin blockchain. Once confirmed, the two parties can send payments back and forth by updating their shared balance without touching the blockchain again. Only when they want to close the channel do they settle on-chain.
Think of it like opening a bar tab: you put money down when you arrive (the funding transaction), order multiple drinks throughout the night (each off-chain update), and settle the final bill when you leave (the closing transaction). The bar only runs your card twice: once to open the tab and once to close it, regardless of how many drinks you ordered in between.
Lightning channels are the foundational building block of the Lightning Network. While a single channel only connects two nodes, the network of interconnected channels allows payments to route across multiple hops using HTLCs, enabling any node to pay any other node without a direct channel between them.
How It Works
The lifecycle of a Lightning channel has three phases: funding, operation, and closing. Each phase involves specific on-chain and off-chain interactions governed by the BOLT specifications.
Phase 1: Funding
Opening a channel begins with negotiation. One node (or both, in dual-funded channels) proposes a channel, and the parties exchange keys and parameters. The process:
- The initiator creates a funding transaction that sends Bitcoin to a 2-of-2 multisig output controlled by both parties
- Before broadcasting the funding transaction, both parties sign an initial commitment transaction that refunds the full balance to the funder: this ensures the funder can recover funds if the counterparty disappears
- The funding transaction is broadcast and must receive a minimum number of confirmations (typically 3 to 6) before the channel is considered active
- For speed-sensitive use cases, zero-conf channels skip the confirmation wait, accepting the risk of a double-spend on the funding transaction
At this point, the channel is open. The total amount locked in the funding transaction defines the channel's capacity: the maximum value that can exist in the channel at any time. This capacity is split between the two parties as their respective balances.
Phase 2: Operation
Once open, the channel operates through commitment transactions. A commitment transaction is a valid Bitcoin transaction that could be broadcast at any time to close the channel. Each party holds their own version of the latest commitment transaction, encoding the current balance split.
When Alice wants to send 10,000 sats to Bob through their shared channel:
- Both parties construct new commitment transactions reflecting the updated balances (Alice's balance decreases by 10,000 sats, Bob's increases by 10,000 sats)
- They exchange signatures for each other's new commitment transaction
- They exchange revocation keys for the previous commitment transaction, invalidating the old state
This update process takes milliseconds and requires no blockchain interaction. A channel can process thousands of updates per second in theory, making Lightning orders of magnitude faster than on-chain Bitcoin transactions.
Each commitment transaction also reserves a small amount called the channel reserve: a minimum balance that each party must maintain. This reserve ensures both parties always have something at stake, discouraging cheating attempts.
Commitment Transaction Structure
Commitment transactions have an asymmetric structure: Alice's version differs from Bob's version of the same state. In Alice's commitment transaction:
- Bob's output pays him immediately (no timelock)
- Alice's output is encumbered by a timelock (typically 144 to 2016 blocks): she must wait before spending her own funds
- Alice's output also includes a revocation path that Bob can use immediately if Alice broadcasts a revoked state
# Simplified commitment transaction (Alice's version)
# Input: 2-of-2 multisig funding output
# Output 0: Bob's balance (immediately spendable by Bob)
OP_CHECKSIG <bob_pubkey>
# Output 1: Alice's balance (timelocked OR revocable)
OP_IF
<revocation_pubkey> # Bob can spend immediately if revoked
OP_ELSE
<to_self_delay> # e.g., 144 blocks
OP_CHECKSEQUENCEVERIFY
<alice_pubkey> # Alice can spend after delay
OP_ENDIFThis asymmetry is critical for security. The timelock on your own output gives your counterparty time to detect and punish cheating. If you broadcast a revoked commitment transaction, the delay window allows the other party to claim your funds using the revocation key.
The Penalty Mechanism
Every time the channel state updates, both parties exchange revocation secrets for the previous state. These secrets allow the construction of revocation keys that can sweep the cheater's funds. The penalty mechanism works as follows:
- Alice broadcasts a revoked commitment transaction (an old state where she had a higher balance)
- Bob detects the revoked transaction on-chain (either directly or through a watchtower)
- Bob constructs a justice transaction using the revocation key for that state
- The justice transaction sweeps Alice's entire channel balance to Bob as punishment
This penalty is deliberately severe: you lose everything, not just what you tried to steal. This strong disincentive makes it economically irrational to broadcast old states. For the penalty to work, the honest party (or their watchtower) must act within the timelock period.
Phase 3: Closing
Lightning channels can be closed in two ways, each with different tradeoffs:
- Cooperative close: both parties agree on the final balance and sign a single closing transaction together. This is the cheapest option because it produces a simple transaction with no timelocks. Both parties receive their funds immediately upon confirmation.
- Force close (unilateral close): one party broadcasts their latest commitment transaction without the counterparty's cooperation. This is necessary when the other party is unresponsive or uncooperative. The broadcaster must wait out the timelock delay before claiming their funds, and the transaction is more expensive due to additional outputs and anchor outputs.
Force closes are significantly more expensive than cooperative closes. They produce larger transactions with anchor outputs for fee bumping, and any pending HTLCs must be resolved on-chain individually. A channel with 10 pending HTLCs at force-close time could generate a dozen on-chain transactions.
Channel Types
Public vs Private Channels
Lightning channels can be announced (public) or unannounced (private). Public channels are broadcast to the network gossip protocol, making them visible to all nodes and available for routing payments from third parties. Private channels are only known to the two participants and are not advertised for routing.
Private channels are useful for end-user wallets that want to receive payments without acting as routing nodes. A mobile wallet might open a private channel to a well-connected node: the wallet can send and receive payments through that node, but third-party payments won't be routed through the wallet's channel. The wallet can still receive payments via route hints embedded in invoices.
Channel Capacity vs Balance
Two concepts that are frequently confused:
- Capacity: the total amount of Bitcoin locked in the funding transaction. This is fixed for the lifetime of the channel (unless splicing is used to add or remove funds).
- Balance: each party's share of the capacity. Balances shift with every payment. If Alice and Bob have a 1,000,000 sat channel and Alice has sent 300,000 sats to Bob, Alice's balance is 700,000 sats and Bob's is 300,000 sats.
This distinction matters for liquidity. A channel with high capacity but all the balance on one side can only route payments in one direction. Effective routing requires balanced channels, which is why tools like circular rebalancing and Loop exist.
Use Cases
Lightning channels serve as the infrastructure for a variety of applications beyond simple payments:
- Instant payments: merchants and consumers transact in milliseconds with near-zero fees, making micropayments viable for the first time
- Streaming payments: content creators receive sats in real time as listeners stream podcasts or viewers watch videos, with each payment updating the channel state
- Point-of-sale: retail payments settle instantly and can handle high throughput without on-chain confirmation delays
- Machine-to-machine payments: IoT devices can pay for resources (API calls, bandwidth, compute) in real time through persistent channels
- Cross-layer bridges: channels connect on-chain Bitcoin to Layer 2 systems like Spark, enabling interoperability between different protocol layers
Risks and Considerations
Hot Wallet Requirement
Lightning channels require keys to be online and available for signing commitment transaction updates. This means channel funds are held in a hot wallet by definition. Unlike cold storage, hot wallets are vulnerable to server compromise, key theft, and software bugs. Operators must implement robust security practices: HSMs, multi-layer access controls, and regular security audits.
Liquidity Management
Channel liquidity is directional. A channel can only forward payments in the direction where balance exists. Over time, channels become depleted in one direction and must be rebalanced using techniques like circular rebalancing, Loop, or splicing. Poor liquidity management leads to failed payments and lost routing revenue.
Monitoring and Watchtowers
Nodes must remain online (or delegate to a watchtower) to detect and punish revoked state broadcasts. If a node goes offline for an extended period and its counterparty broadcasts an old commitment transaction, the offline node may not respond within the timelock window and could lose funds. This creates an operational burden: channel participants must either run reliable infrastructure or trust a watchtower service.
On-Chain Costs
Opening and closing channels requires on-chain transactions, which incur miner fees. During periods of high on-chain fee pressure, opening new channels or force-closing existing ones can be prohibitively expensive. Innovations like channel factories aim to amortize these costs across many channels, and eltoo proposes simplifying the closing process.
Privacy Tradeoffs
Public channels reveal on-chain funding transactions, channel capacity, and node identities. Even private channels can be discovered through probing techniques that infer channel existence and balances. Users concerned with privacy should consider using blinded paths and unannounced channels, though perfect privacy remains challenging on the Lightning Network.
This glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.