Lightning is usually explained as a second layer where transactions are fast and cheap. That describes the result and skips the mechanism, which is a shame, because the mechanism is a genuinely clever answer to a question with no obvious solution: how do two people change their minds about who owns what, repeatedly, without a referee, when either might lie?
This article assumes you want the machinery. For the shape of the idea without the commitment transactions, start at what is the Lightning Network? and come back.
What is a Lightning channel actually?
Two parties put bitcoin into a single output requiring both of their signatures to spend. That funding transaction is published on chain and is, for most of the channel’s life, the only trace of it that exists publicly.
Neither party can move those coins alone. What they do instead is exchange signed transactions that spend the funding output and pay each side its current share. Those are commitment transactions. Each party holds one reflecting the latest agreed balance, and either could publish theirs at any moment to close the channel and settle on chain.
So the channel is not a container. It is one unspent output plus a private, continuously replaced agreement about how it would be divided if either party walked away.
Updating a balance without touching the chain
To move value from one side to the other, the parties sign a new pair of commitment transactions reflecting the new split, and then make the old pair unusable.
That second step is the hard part. The old commitment is a perfectly valid transaction, already signed. Nothing in Bitcoin prevents someone from broadcasting a state from last week when their balance was higher. The chain has no idea the state was superseded, because it never saw either version.
Lightning solves this by making the old state dangerous to publish rather than impossible to publish.
What stops someone publishing an old state?
The two commitments are deliberately asymmetric. In the version you hold, your own output is encumbered with a relative timelock: if you broadcast, you must wait a defined number of blocks before you can claim your share. Your counterparty’s output is immediately spendable.
Alongside that delayed output sits a second spending path, usable by your counterparty if they know a revocation secret. Each time the balance is updated, both sides hand over the revocation secret for the state they are abandoning.
The result is a trap. If you publish an old commitment, your own funds are frozen by the timelock while your counterparty — who now holds the revocation secret for that exact state — can sweep the entire channel balance during the delay. Cheating does not merely fail; it costs you everything in the channel. This is why Lightning is often described as a penalty-based system, and why the thing being enforced is not honesty but the irrationality of dishonesty.
It also creates an obligation. The punishment only happens if someone is watching within the timelock window. A node that is offline for longer than its channels’ delays cannot defend itself, which is why watchtowers — third parties paid to watch for revoked states on your behalf — exist as a category.
How does a payment reach someone you have no channel with?
You do not need a channel with the recipient. You need a path of channels, and a way to make every hop along it either happen together or not at all.
The recipient generates a random secret and sends you an invoice containing its hash. You then set up a conditional payment with your first hop: it can claim the amount if it reveals the preimage of that hash within a deadline; otherwise the funds return to you. That hop sets up the same condition with the next, and so on to the recipient.
The recipient knows the secret, so they claim from the final hop by revealing it. That reveals the secret to the final hop, which uses it to claim from the one before, and the preimage propagates backwards along the route until you have paid your first hop. Either the secret travels the whole way and every hop settles, or it does not and every hop expires. No intermediary can take the money and stop.
Two details matter. The deadlines decrease along the route, so each hop has more time to claim than the one after it — otherwise an intermediary could be left having paid out downstream with its own incoming leg already expired. And the route is wrapped in layers of encryption so that each hop learns only who it received from and who to forward to, not the origin, the destination, or its own position in the path.
Why is liquidity the hard part?
A channel’s capacity is fixed when it is opened, and it is divided. You can only send as much as sits on your side of it.
This is the problem no amount of protocol work removes. Open a channel by funding it yourself and you have outbound capacity and zero inbound — you can spend but not receive. Receiving requires someone else’s funds to be on their side of a channel with you, which is why services sell inbound liquidity and why “my payment failed” is usually a liquidity failure rather than a technical one.
Routing inherits it. The sender chooses the path from a public view of the network graph, but that graph publishes each channel’s total capacity and not how it is currently split, because the split changes with every payment and broadcasting it would destroy privacy. So the sender is guessing, attempts fail, and the software retries along other paths. Large payments are routinely split across several routes for the same reason.
Every one of these constraints traces back to the base layer. Channels are opened and closed with on-chain transactions, so the cost of entering and leaving is set by the fee market. When fees are high, small channels become uneconomic to open and, worse, uneconomic to close — which means the guarantee that you can always exit is a guarantee with a price attached.
The two ways a channel ends
A cooperative close is the ordinary case. Both parties agree on the final balance, sign one transaction paying each side directly, and publish it. No timelocks, no penalty paths, two plain outputs, and a fee both agreed to at current rates.
A force close is what happens when one side stops responding. The other publishes its latest commitment, which carries all the machinery described above: its own output delayed by the timelock, any in-flight conditional payments resolving separately as their deadlines pass. It is larger, more expensive, and slower — funds can be locked for days.
The uncomfortable detail is the fee. A commitment transaction is signed in advance, sometimes months before it is needed, so its fee reflects conditions at signing rather than at broadcast. If fees have risen since, the transaction may not confirm when it matters most. Modern channels attach a small anchor output for exactly this reason, so either party can drag the commitment into a block by spending that anchor at a higher rate.
What do you give up?
Lightning asks for things the base layer does not.
Liveness. Base-layer coins sit safely while you are away for a year. Channel funds require you, or someone acting for you, to be watching.
Interaction. A payment needs the recipient to be online to produce the preimage. Static offers and async schemes improve this and do not eliminate it.
Simplicity of backup. A seed phrase does not restore channel state. Restoring from an old backup can look exactly like attempted cheating, with the corresponding penalty, which is why channel backup is its own discipline.
And, very often, custody. Many of the most pleasant Lightning wallets hold your funds. That is a reasonable trade for small amounts and a different product from the one described above — none of the mechanism in this article protects you in that case, because you have no channel.
Check it yourself
The on-chain half is inspectable with a node and nothing else, which is the best way to see how little Lightning publishes.
# A channel open is an ordinary payment to a 2-of-2 output.
# A cooperative close is an ordinary spend of it, with two outputs.
bitcoin-cli getrawtransaction <funding_txid> true
Find a channel funding transaction and its eventual close, then compare. Everything that happened between them — possibly thousands of payments — left no record at all. That absence is the entire product.
What remains uncertain
Whether the economics survive a sustained high-fee base layer. Channel management is only viable while opens and closes are affordable. Every projection of Lightning at scale assumes base-layer fees that the same projections of adoption would make unlikely.
How much of the network is meaningfully non-custodial. Usage statistics largely cannot distinguish a self-run node from a custodial wallet’s users, so claims about Lightning adoption are claims about a mixture whose composition is not measured.
Whether routing reliability improves enough for general use. Payment failure rates have fallen and remain far above what people tolerate in other payment systems. Whether the remaining gap is an engineering problem or a structural property of source routing over hidden balances is unsettled.
What covenants would change. Several proposals would allow channel constructions that are cheaper to open and that let many users share one on-chain output. They are plausible and they are not deployed, and the history of this protocol suggests the gap between plausible and deployed is measured in years.