Skip to content
buybitcoinsmart

Glossary / Lightning & layer 2

Payment channel

Also known as Micropayment channel, Lightning channel.

Definition
A payment channel is a two-party bitcoin contract funded by one on-chain transaction, inside which the two sides can rewrite the split of that money thousands of times without touching the chain.

Think of it as a bar tab that both drinkers sign after every round. The funding output is a 2-of-2 address, so neither peer can move the money alone, and every update is a fully valid bitcoin transaction that either side could publish. If you hold coins in a channel, you are relying on software to notice bad behavior, not on a company to behave.

How it works

A payment channel replaces trust with two pieces of bitcoin script: a shared output and a punishment.

Opening the channel takes one on-chain transaction that pays into an address requiring both signatures. Before that transaction is broadcast, the peers exchange signed commitment transactions that spend it back to them in the agreed proportions. Paying inside the channel just means signing a new pair of commitments with a new split and then handing over the secret that revokes the old one.

Revocation is what makes it safe. Each side holds a slightly different commitment transaction, and the version you hold pays your own balance to a script that you can only claim after a delay, commonly 144 blocks, about a day. Your peer's copy has the same delay on their side. If either of you broadcasts an old, more favorable state, the other has that delay to notice and use the revocation secret to sweep the entire channel balance as a penalty. Cheating is not blocked; it is made unprofitable.

None of this was possible before relative timelocks existed. CHECKSEQUENCEVERIFY and the sequence-based locks defined in BIP68, BIP112 and BIP113 have been active since block 419,328 in 2016, and they are what lets a script say "spendable, but only 144 blocks after this transaction confirms".

Several small numbers in the spec exist purely to keep the punishment enforceable. Each peer normally keeps a reserve it can never spend, suggested at 1 percent of the channel total, so a cheater always has something to lose. Outputs below the dust threshold, 330 satoshis for the pay-to-witness-script-hash outputs channels use, are dropped and paid to fees instead of being written into the commitment. Modern channels also carry two 330 satoshi anchor outputs, which exist so either side can attach a fee-bumping child transaction if the chain is busy when they need to close. And the commitment number itself is hidden: 48 bits of it are obscured and scattered across the locktime and sequence fields, so an observer who sees a unilateral close cannot count how many payments the channel carried.

Why this matters when you buy bitcoin

Channels are the reason a Lightning balance and a cold storage balance are not interchangeable, even though both are bitcoin.

Money in a channel needs a key that is online and a node that is watching. That is fine for a spending wallet. It is the wrong home for a stack you plan to hold for years, because the security model asks something of you continuously rather than once. Our hardware wallet reviews cover the opposite trade: keys that never touch a network and never need to react to anything.

Two practical consequences follow for anyone buying. First, opening and closing channels are on-chain transactions, so a wallet that opens a channel for you is spending real fees on your behalf, sometimes silently. Check what a mobile Lightning wallet charges for its first channel before you fund it with 30 dollars and discover that a third of it went to setup. Second, if a Lightning app never mentions channels, keys, or backups, it almost certainly holds the channel itself. That is a custodial account with a Lightning veneer, and it belongs in the same risk bucket as leaving coins on an exchange.

The last one is dull but expensive: channel state is not recoverable from a seed phrase. A twelve word backup restores an on-chain wallet perfectly and restores nothing about which commitment was current. Non-custodial Lightning wallets back up channel state separately, and losing that backup can cost you the channel balance even though you still hold the seed.

Anatomy of one channel close

Watch a single channel end and the pieces stop being abstract.

Two peers open a channel with 1,000,000 satoshis, funded entirely by one of them. After a month of payments the split is 400,000 and 600,000. A cooperative close is the happy path: both sign one closing transaction that pays each side directly, it confirms like any normal spend, and there is no delay on either output.

A unilateral close is the fallback. One peer disappears, so the other broadcasts their latest commitment. Their own balance lands in a script they cannot touch for the agreed delay, the departed peer's balance is immediately spendable by them, and the anchor outputs sit there in case the fee needs raising. If the peer who vanished later broadcasts a stale commitment showing themselves with 900,000 satoshis, the honest side has the delay window to publish the revocation and take all 1,000,000.

Payment channel vs statechain

A payment channel keeps a live two-party contract on chain; a statechain passes around the right to spend a fixed output. In a channel, the balance can be any number and changes with every payment, and enforcement is unilateral. In a statechain, an entire UTXO of a fixed size is transferred from one owner to the next with the help of a server that is asked to delete its old key share, so the model leans on that server actually deleting it. Channels cost you an on-chain transaction to open and give you a spendable balance; statechains cost you a trust assumption and give you a whole coin.

Not to be confused with

Frequently asked questions

Does my seed phrase back up my Lightning channels?

No. A seed restores on-chain keys, but it cannot tell your wallet which channel state was the most recent one. Non-custodial Lightning wallets keep a separate channel backup, and losing it can cost you the channel balance.

What happens if my channel partner goes offline forever?

You broadcast your latest commitment transaction to close the channel unilaterally. Your own balance becomes spendable after the agreed delay, commonly around 144 blocks, and your peer's share is paid out immediately.

Can my channel partner steal my money?

Only by publishing an old channel state, and only if nobody catches it. The revocation secret you already hold lets you claim the entire channel balance as a penalty during the delay window, which is why cheating is rare.

Read next

Related terms

More in Lightning & layer 2