Skip to content
The BTC World

The Lightning Network explained

Lightning is a payment network built on top of Bitcoin for fast, low-cost payments. Learn how channels and routing work, and where Lightning falls short.

Spending bitcoin 6 min read Updated November 22, 2026

980,00020,000 sats

Bitcoin's blockchain can only process a limited number of transactions, and each one waits for a block, about 10 minutes on average. That is fine for saving and for larger payments, but awkward for buying a coffee. The Lightning Network is a second layer built on top of Bitcoin that makes payments nearly instant and usually very cheap, while still settling in real bitcoin. This guide explains how it works and what its trade-offs are.

The idea in one sentence

Instead of recording every payment on the blockchain, two parties lock some bitcoin into a shared account on-chain, then pay each other as many times as they like off-chain, and only record the final result on the blockchain when they are done.

The idea was first described in a 2015 paper by Joseph Poon and Thaddeus Dryja, and the first implementations reached Bitcoin's main network in 2018.

Payment channels

The building block of Lightning is the payment channel.

On the blockchain Between Aliceand Bob Open Alice locks 1,000,000 sats Close The final balances are paid out 980k / 20k payment 1 950k / 50k payment 2 900k / 100k payment 3 Only opening and closing touch the blockchain; every payment in between is instant.
A channel is opened and closed on the blockchain; the payments in between only move the balance from one side to the other.

Opening a channel

Alice wants to transact often with Bob. She creates an on-chain transaction that sends, say, 1,000,000 sats to a special multisig address that requires both Alice's and Bob's signatures to spend. This is the funding transaction. Once it is confirmed, the channel is open.

Paying inside the channel

At the start, the channel's balance is 1,000,000 sats on Alice's side and 0 on Bob's. When Alice pays Bob 20,000 sats, they do not touch the blockchain. Instead, they both sign a new commitment transaction that would pay out 980,000 sats to Alice and 20,000 sats to Bob if it were broadcast. Each new payment replaces the previous commitment with an updated one.

These updates happen in milliseconds and cost nothing on-chain. Alice and Bob can exchange thousands of payments this way.

Keeping each other honest

What stops Alice from broadcasting an old commitment where she still had all 1,000,000 sats? Every time the channel is updated, each side hands the other a secret that "revokes" the old state. If Alice publishes an outdated commitment, Bob has a window of time to use that secret and claim the entire channel balance as a penalty. Cheating is therefore a losing bet, as long as Bob (or a service watching on his behalf, called a watchtower) is checking the blockchain.

Closing a channel

When they are done, Alice and Bob sign a final transaction that pays each of them their current balance on-chain. This is a cooperative close. If one side disappears, the other can broadcast the latest commitment on their own (a force close), but the side that closes must wait a set number of blocks before its own funds are released, giving the other side time to dispute an old state.

Only two transactions ever touch the blockchain: the opening and the closing. Everything in between happens off-chain.

Routing: paying people you have no channel with

Opening a channel with every merchant would be impractical. Lightning solves this by routing payments through a network of channels. If Alice has a channel with Bob, and Bob has one with Carol, Alice can pay Carol through Bob.

no channel between Alice and Carol Alice Bob Carol pays 10,001 satsforwards 10,000keeps 1 sat as a fee
A payment can hop through other people's channels, each of them keeping a small fee.

The challenge is making sure Bob cannot pocket the money. Lightning uses a contract called a hash time-locked contract (HTLC):

  1. Carol creates a random secret and gives Alice its hash, inside an invoice.
  2. Alice offers Bob a payment that Bob can only claim by revealing the secret, and that expires after a certain time.
  3. Bob offers Carol a similar payment, with the same hash and a shorter expiry.
  4. Carol reveals the secret to claim her payment from Bob, and Bob uses the same secret to claim his payment from Alice.

Either the whole chain of payments completes, or none of it does. No intermediary can steal the funds in transit. Payments can hop across several nodes this way, and they are wrapped in layers of encryption (onion routing), so intermediate nodes generally do not know who is paying whom.

Routing nodes charge small fees for forwarding payments, usually a tiny fixed amount plus a small percentage. For everyday amounts, the total is typically a fraction of what an on-chain transaction would cost.

Liquidity: the money has to be on the right side

Each channel has a fixed capacity, split between the two sides. This creates a constraint that on-chain Bitcoin does not have:

  • Outbound liquidity is the balance on your side of your channels: what you can send.
  • Inbound liquidity is the balance on the other side: what you can receive.

A brand-new channel that you funded yourself has plenty of outbound liquidity but none inbound, so you cannot receive payments through it until you have spent some. Routing a payment also requires enough liquidity in the right direction along every hop. Larger payments are therefore more likely to fail, although wallets can split a payment across several paths to improve the odds.

Invoices

To receive a Lightning payment, you normally create an invoice: a long string beginning with lnbc on the main network, often shown as a QR code. An invoice usually contains:

  • the amount, in satoshis or millisatoshis,
  • the hash of the payment secret,
  • a description,
  • an expiry time,
  • the information the sender needs to find a route to you.

Classic invoices are meant to be used once and expire. Several additions make Lightning friendlier:

  • Lightning addresses look like an email address and let a sender request a fresh invoice from your provider automatically.
  • Offers (sometimes called BOLT12) are reusable payment codes that can be paid many times, supported by a growing number of wallets.
  • LNURL is a set of conventions for things like scanning a QR code to withdraw or pay.

Amounts in Lightning are usually displayed in sats; our satoshi converter helps translate them into BTC.

Custodial and non-custodial Lightning wallets

As with ordinary Bitcoin wallets, the big question is who holds the keys.

Custodial Non-custodial
Who controls the funds The provider You
Setup Instant, no channels to manage Opens channels, often helped by a service provider
Receiving Always works May need inbound liquidity and the app to be online
Backups Account login Seed phrase plus channel backup data
Risks Provider failure, account freezes Mistakes, force closes, phone loss without backup

Custodial Lightning wallets are simple: the company runs the channels, and your balance is an entry in its database. They are convenient for small amounts but carry the same risks as leaving coins on an exchange.

Non-custodial Lightning wallets keep your keys on your device. Many now work with a Lightning service provider (LSP) that opens channels and supplies inbound liquidity automatically, sometimes for a fee, which hides most of the complexity. Opening a channel requires an on-chain transaction, so an on-chain fee applies at that moment.

Limits and trade-offs

Lightning is powerful, but it is not a replacement for on-chain Bitcoin in every case.

  • Hot wallet by design. Lightning keys have to be online to sign payments, so it is not the place for long-term savings.
  • Liquidity limits. Very large payments may fail or need to be split. On-chain transactions are better for big amounts.
  • Being online. To receive in a self-custodial wallet, your app or node usually needs to be reachable, or rely on a provider's help.
  • Channel costs. Opening and closing channels are on-chain transactions, which cost more when on-chain fees are high.
  • Monitoring. To be protected against an old state being broadcast, someone must watch the blockchain: your node or a watchtower.
  • Complexity and centralization concerns. Running a well-connected routing node takes skill and capital, and many users rely on a few large providers.
  • Privacy is different, not absolute. Lightning payments are not published on the blockchain, which helps, but channels and some routing information are visible.

When to use Lightning

Lightning shines for small and frequent payments: tips, purchases at shops that accept it, streaming payments, and sending money between apps that support it. A number of exchanges also offer Lightning deposits and withdrawals. For saving, large transfers and long-term storage, the base layer with a cold wallet remains the better tool.

Summary

  • Lightning uses payment channels funded on-chain, with payments updated off-chain.
  • HTLCs let payments route safely across several channels.
  • Payments are fast and usually very cheap, priced in sats.
  • Custodial wallets are easy; non-custodial wallets give you control but need more care.
  • Liquidity, online requirements and channel costs are the main trade-offs.