Crypto

The Lightning Network: How Bitcoin Got a Fast Payment Layer

The Lightning Network moves small Bitcoin payments off the main chain. See how payment channels work, the 2015 paper, the 2018 launch and the trade-offs.

By Zebra Hosting Cloud

Bitcoin's main chain adds a block roughly every ten minutes, which is fine for settling large payments and awkward for buying a coffee. The Lightning Network is a second layer built on top of Bitcoin that aims to make small, quick payments practical. It is also one of the clearest examples of the idea of scaling by building layers.

Where it came from

In February 2015, Joseph Poon and Thaddeus Dryja published a draft paper describing a network of payment channels for Bitcoin. A revised version appeared in January 2016. The work arrived in the middle of the blocksize debate and offered a way to handle more payments without making base-layer blocks bigger.

Several teams then wrote software to the same specification. These include Lightning Labs, Blockstream and ACINQ, each with its own implementation. The shared standards, called BOLTs, let different implementations talk to each other. Developers began making Lightning payments on the main Bitcoin network in late 2017, and the first beta software for mainnet use followed in March 2018.

How payment channels work

A payment channel is an arrangement between two parties. They lock funds into a shared address with an on-chain transaction, and then exchange signed updates that change how those funds would be split, without sending anything to the blockchain. Only when the channel is closed does the final balance get recorded on the main chain.

  1. Open. Alice and Bob create a channel by committing funds in a transaction on the Bitcoin blockchain.
  2. Transact. They pass signed balance updates back and forth. Each update replaces the previous one, and any number can happen quickly.
  3. Close. Either party can publish the latest agreed balance to the chain, or they can close the channel by mutual agreement.

If one side tries to cheat by publishing an old balance, the design lets the other side claim penalties, provided they notice in time.

Routing across a network

If Alice has a channel with Bob and Bob has a channel with Carol, Alice can pay Carol through Bob without a direct channel. This works through hash time-locked contracts, or HTLCs. The payment is conditional on a secret that Carol reveals when she receives it; the secret then lets each intermediate hop collect its funds. If the payment fails, the locks expire and the money returns.

Payments are sent over onion-routed paths, so each node on the route only knows the previous and next hop, not the sender and receiver.

Strengths

  • Speed. Payments are typically settled within seconds.
  • Low fees. Fees for small payments are generally a very small fraction of on-chain costs, depending on routing conditions.
  • Less blockchain load. Many payments are collapsed into just two on-chain transactions.

Limitations

IssueWhat it means
LiquidityA channel can carry a payment only up to the funds on the paying side; large payments may fail to route
UptimeNodes generally need to be online to receive and to monitor for cheating, though services can help
ComplexityChannel management and fee handling can confuse newcomers
Custodial shortcutsMany apps hold users' funds on their behalf to hide the complexity, which reintroduces counterparty risk

Invoices, cheating and closing channels

Payments on Lightning usually start with an invoice, an encoded request that contains the amount, an expiry time and a payment hash. The payer's wallet finds a route and sends the payment along it. When the recipient reveals the secret behind the hash, each hop settles its part.

Because a channel's latest state lives off-chain, someone must watch the blockchain in case the other side publishes an outdated one. Nodes that stay online do this themselves, and some services called watchtowers offer to do it on behalf of users who cannot. A channel can be closed cooperatively, which is quick and cheap, or by force if the other party is unresponsive, which involves waiting periods and higher on-chain fees. People who run routing nodes need a reliable, always-on machine, which is one reason some choose a VPS over a home computer.

Adoption

Lightning has seen real use for small payments, remittances and tipping, and several wallets and payment services have integrated it. The Chivo wallet in El Salvador supported Lightning payments. Its overall share of Bitcoin activity is hard to measure because many payments are private by design, and published capacity statistics have limits. This article does not give numbers for that reason.

Why it matters

Lightning illustrates a general principle in system design: keep the base layer simple and secure, and let applications build faster services above it. The same idea underlies the rollups used by Ethereum, and it echoes how the internet separates low-level protocols from application-level ones. It also reflects a cultural shift in the Bitcoin community, from changing the base protocol to building optional services around it. Similar channel designs have been tried on other networks, such as the Raiden Network for Ethereum, though much of the wider scaling effort moved to rollups.

A practical lesson for site owners

Small and fast payments are useful for tipping and micropayments, but a business selling hosting or services also needs invoices, confirmations and records. Payment processors can bundle those things for you. Zebra Hosting accepts crypto through Cryptomus, and you can see current products on our hosting page.