— —
Follow on X
LESSONS

How Lightning works

Two parties lock bitcoin in a shared output and update who owns what by signing new balances. Payments hop across channels using HTLCs, so no hop can steal.

6 MIN READ
Open on-chain, update off-chain, route through others, close on-chain.
LEVEL · Intermediate
IN THIS LESSON · 2 OF 7
BY THE END YOU WILL BE ABLE TO ANSWER
  • What touches the blockchain in a channel's life?
  • What stops an intermediate node stealing a routed payment?

Then prove it: a 2-question quiz. The lesson marks itself complete at 100%.

A channel

Alice and Bob create a channel by funding a 2-of-2 multisig output on-chain. Say each puts in 0.5 BTC. They then hold a signed transaction that would pay out the current balances if broadcast. To pay Bob 0.1, Alice signs a new version: 0.4 to her, 0.6 to him. They can do this thousands of times, instantly, with no blockchain involvement. The chain only sees the open and, eventually, the close.

Keeping it honest

What stops Alice broadcasting an old state where she had more? Each new state comes with a secret that lets the other party claim all the funds if an old state is ever broadcast. Cheating costs everything, so nobody cheats. A watchtower can watch the chain on your behalf while you are offline.

Routing

Alice has no channel with Carol, but Bob has one with each. Alice pays Carol through Bob. A hashed timelock contract (HTLC) makes this safe: Carol creates a secret and gives Alice its hash; each hop forwards a conditional payment that can only be claimed by revealing the secret, within a time limit. When Carol reveals it to claim from Bob, Bob can claim from Alice. Either every hop completes or none does. Bob earns a tiny routing fee.

Invoices and addresses

To get paid you issue an invoice (lnbc...), a one-time request containing the amount and the payment hash. Lightning addresses (you@domain) and BOLT 12 offers let you publish something reusable.

The limits

A channel can only move what is in it; large payments may need several routes (multipath). To receive, you need inbound liquidity on your side. The receiver's node must be online. These are the practical frictions the next lessons address.

Bitcoin Lightning Network: Everything You Need to Know · ExplainerWatch on YouTube ↗
CHECK YOURSELF
1/2 What touches the blockchain in a channel's life?
2/2 What stops an intermediate node stealing a routed payment?
pick an answer for each question

SOURCES

  1. The Bitcoin Lightning Network (Poon and Dryja, 2016)
Progress is saved in this browser only.