Bitcoin works, but it is slow and expensive when used as a payment system. A base-layer transaction takes minutes to confirm and costs whatever the fee market demands, which makes it impractical for buying a cup of coffee or settling micro-payments in real time. The Lightning Network was proposed in 2015 as a "second layer" protocol: instead of settling every transaction on the Bitcoin blockchain, two parties open a private, off-chain payment channel backed by a single on-chain funding transaction, and then transact with each other instantly and for fractions of a cent. When the channel is no longer needed, they close it on-chain with a single settlement transaction. Payments between strangers who have no direct channel are routed through a network of intermediaries, creating a peer-to-peer payment mesh on top of Bitcoin.
This article is a technical and practical guide to how Lightning actually works: the mechanics of payment channels, hash time-locked contracts (HTLCs), onion-routed multi-hop payments, channel liquidity, routing node economics, and, critically, what Lightning does and does not protect when it comes to privacy. It is written for technically curious users, developers, and anyone deciding whether Lightning fits their use case.
What Lightning Network is, and what it is not
Lightning is not a blockchain and not a cryptocurrency. It is a network of bilateral payment channels whose states are anchored to Bitcoin. Think of it the way the TCP/IP stack sits on top of Ethernet: Lightning does not replace Bitcoin's consensus or ledger; it reuses them only for channel funding and settlement, and performs everything else off-chain.
Two properties matter most. First, Lightning payments are instant: because they only require exchanging signed commitment transactions between channel participants rather than waiting for block confirmations, payments settle in under a second on a healthy route. Second, they are cheap: a payment might cost a few satoshis in routing fees instead of a base-layer transaction fee that can exceed the payment itself. What Lightning is not: it is not a place to store large amounts for long periods. Funds live in channels, which are live bilateral relationships. If your counterparty's node goes offline, recovering funds can require a force-close on the base layer, which is why serious Lightning wallets split funds across multiple channels with different peers.
Payment channels: the building block
A Lightning payment channel is, at its core, a 2-of-2 multisignature Bitcoin output. Two parties, let's call them Alice and Bob, jointly fund a channel by broadcasting a single on-chain transaction to a multisig address. The channel's "capacity" is the total amount locked in, and neither party can move the funds alone.
Instead of broadcasting every payment on-chain, Alice and Bob exchange commitment transactions that they each sign and keep privately. A commitment transaction reflects the current balance split, for example, 60,000 satoshis to Alice and 40,000 to Bob. If Alice pays Bob 5,000 satoshis, they exchange a new pair of commitments showing 55,000/45,000 and invalidate the old ones using revocation keys. Each party can always broadcast their latest commitment to the blockchain, which guarantees that a cheating party cannot broadcast a stale balance, the old state simply becomes unspendable. The critical detail: none of these intermediate states ever appear on the blockchain. The blockchain only ever sees the funding transaction when the channel opens and the closing transaction when it ends.
This structure has three consequences worth internalizing. Channel capacity is fixed by the initial funding amount and only changes via on-chain transactions, so growing a channel requires topping it up on-chain. Each channel has a balance direction: if Alice has 55k and Bob has 45k of a 100k channel, Alice can send at most 55k before needing incoming liquidity. And channel state is bilateral, a channel between Alice and Bob carries no automatic ability to pay anyone else. That is what routing solves.
How a multi-hop payment actually works: HTLCs
Suppose Alice wants to pay Carol, but Alice has a channel with Bob and Bob has a channel with Carol, a classic three-node route. Direct bilateral transfers cannot span Bob, so Lightning uses Hash Time-Locked Contracts (HTLCs), which chain conditional payments together.
The mechanics: Carol's payment request (invoice) contains a cryptographic preimage secret, actually, the invoice contains the hash of it, and the preimage is revealed only when Carol claims payment. Alice constructs a route and asks Bob to forward the payment. Alice offers Bob an HTLC: Bob can claim the funds if he can produce the preimage matching the hash, or Alice can reclaim them after a time-lock expires. Bob in turn offers Carol an HTLC under the same hash, with a slightly shorter time-lock. When Carol claims her payment by revealing the preimage, Bob can now claim his HTLC from Alice using the same preimage, and so on back down the route. Every hop resolves atomically and depends on the same secret.
This design has two elegant properties. Payments are atomic: either the whole route succeeds and everyone gets paid, or the preimages never get revealed and every HTLC times out and unwinds back to the sender. And routing nodes never need to trust each other, Bob cannot steal the payment because the HTLC only pays out if he delivers the preimage downstream, and if Carol never claims, everyone is refunded. If a routing node becomes unresponsive or attempts to misbehave, the HTLC can be settled on-chain: each party's latest commitment can be broadcast and the contract resolved by the base layer, though at a higher fee and slower pace.
Invoices themselves are part of the protocol. A Lightning invoice (BOLT 11) encodes the amount, a timestamp, a payment hash, routing hints, and metadata, signed so only the payee's node can settle it. BOLT 12 "offers" enable reusable payment requests without the amount being fixed in advance.
The gossip network and pathfinding
For routing to work, nodes must know the network's topology. Lightning nodes run a gossip protocol: they announce channels (identified by a 2-of-2 funding outpoint), their node public keys, and fee policies to their peers, who relay announcements onward. The result is a public map of who is connected to whom, with channel capacities, fee rates, and timelock parameters. This is how a sender can construct candidate routes to a payee.
Pathfinding in practice is probabilistic. The gossip map tells you which channels exist, but not whether a node is online right now or whether it currently has enough outbound liquidity in the right direction, a node might have a channel with capacity, but if its balance is on the wrong side, it cannot forward in that direction. Senders therefore build multiple candidate routes, typically using algorithms like Dijkstra or more recent approaches (such as probability-based routing and trampoline payments where the final hop is hidden) and attempt them in sequence. Failed attempts cost little because failed HTLCs are never charged routing fees, fees are only earned on successful forwards.
Each routing node earns a base fee (fixed per HTLC, often in milli-satoshis) plus a proportional fee (a small percentage of the payment). Node operators tune these to price their capital: fees too high and payments route around them; fees too low and liquidity gets consumed by cheap forwards that aren't worth the capital cost or the risk of on-chain resolution. This is a real economic market, liquidity providers compete on price and reliability.
Privacy on Lightning: what is and isn't protected
Lightning's privacy story is nuanced, and honest assessment matters more than marketing claims.
What is protected. Lightning uses source routing with onion encryption (the Sphinx packet construction, BOLT 4). The sender constructs the entire route, encrypts the payment instruction in layers, one per hop, so each intermediate node learns only its immediate predecessor and successor. Routing nodes do not know the sender or the final recipient, the total route length, or their position within it. Ephemeral keys are blinded at each hop so packets cannot be correlated along a route by an observer. Because HTLCs settle off-chain, Lightning payments do not create permanent public records of amounts, counterparties, or timing in the way base-layer transactions do. Amounts are not visible to intermediaries beyond what their own hop requires.
What leaks. Several caveats deserve emphasis. First, the gossip network publicly reveals channel topology: which nodes exist, which channels connect them, capacities, and, critically for many nodes, their IP addresses, since routing requires reachability. Nodes that want to hide their location must run behind Tor or use routing hints carefully. Second, an active network observer (an ISP, a malicious peer, or a global passive adversary) can perform traffic analysis: correlating payment timing, packet sizes, and flow patterns across the network can sometimes deanonymize routes even though content is encrypted. Payment amounts are also constrained: the set of possible payment sizes is bounded by channel balances, which can narrow the candidate set. Third, if you reuse a node identity across channels and payments, patterns in your activity can be clustered, Lightning privacy depends on operational discipline, not just protocol defaults. Fourth, channel open and close transactions are fully public on the base layer, linking the two parties' Bitcoin addresses at channel boundaries.
Compared to Bitcoin's base layer, where amounts and counterparties are permanently and publicly recorded, Lightning is meaningfully more private for payment content. Compared to Monero, where every transaction is private by default, Lightning is weaker: it protects payment contents but not network topology, and it relies on the operational behavior of users and node operators. For darknet-adjacent use cases, Lightning's privacy is best understood as "better than raw Bitcoin, worse than Monero," with the additional caveat that Lightning's security model assumes the routing network is honest-but-curious in ways Monero's does not.
Implementations and how to use Lightning
Lightning is an open protocol with several production implementations. The three dominant ones are LND (Lightning Labs Daemon, written in Go, the most widely deployed and the basis of most consumer wallets), Core Lightning (formerly c-lightning, from Blockstream, written in C with plugins), and Eclair (from ACINQ, written in Scala, popular in the French/Eclair ecosystem). All implement the BOLT specifications and are interoperable, a node running LND can route payments through channels run by Core Lightning nodes.
For end users, the practical path is a wallet: mobile wallets like Phoenix and Breez, desktop options like Alby or Zeus, and hardware-integrated solutions increasingly available. Most wallets are lightning nodes themselves or connect to one, "custodial-light" wallets like Cash App or Strike route through a service provider's node, trading some self-custody for simplicity, while non-custodial options keep channel keys under your control. For node operators and developers, LND's lncli and gRPC APIs, and Core Lightning's JSON-RPC plugin interface, provide full control over channels, fees, and routing.
A realistic workflow: acquire bitcoin, open a channel with a well-connected peer (or use a service that opens channels for you), receive an invoice or create one to pay others, and let the wallet handle pathfinding. Channel liquidity, the trickiest operational issue, is usually solved by connecting to large routing hubs or using submarine swaps (on-chain to off-chain atomic swaps via HTLCs) to rebalance without closing channels.
Limitations and honest trade-offs
Lightning's strengths come with real costs that prospective users should understand before committing funds.
Liquidity constraints. Total channel capacity across the network is a hard ceiling on how much can move through it. Individual channels can be one-directional in practice, if Alice's balance is mostly on her side, she cannot receive large payments through that channel until it rebalances. "Inbound liquidity" is a persistent problem for merchants and receivers. Channel management overhead. Channels are live relationships that need online peers, backup procedures, and eventually closing on-chain. Force-closes are slow (timelock delays on the base layer) and can be expensive. Routing reliability. Payment success depends on finding a live, liquid path; complex or large payments may require multiple attempts or fail outright. Watchtower and liveness assumptions. Lightning's security model assumes parties stay online to monitor for cheating; if both parties go offline simultaneously, a dishonest counterparty could attempt to broadcast a stale commitment. Watchtowers mitigate this but are not universal. Fees can be unpredictable. While typically cheaper than on-chain, multi-hop payments through expensive hubs can cost more than a base-layer transaction during low-fee periods. Ecosystem maturity. Despite years of development, Lightning remains a niche layer of the Bitcoin ecosystem with node counts and capacity far below what mass adoption would require.
Who uses Lightning and why
Real-world Lightning usage clusters around payments too small or too frequent for the base layer: micro-tips, pay-per-article content, machine-to-machine payments, remittances in corridors where fees matter disproportionately, and merchant point-of-sale. El Salvador's Bitcoin experiment included Lightning integration specifically to enable small retail transactions. Some exchanges and custodians support Lightning deposits and withdrawals, letting users move small amounts without paying full base-layer fees. In the privacy-conscious community, including darknet-adjacent users, Lightning is valued for instant settlement and reduced on-chain footprint, though serious privacy seekers often prefer Monero or combine techniques rather than relying on Lightning alone.
The technology also remains genuinely experimental at the edges: Taproot channels (BOLT 3 / "Taro"-inspired work) enable more complex scripting, PTLCs (pointed HTLCs) improve privacy and support features like spontaneous payments, and research continues on channel factories, splicing, and other scalability improvements. Lightning is a living protocol, not a finished product.
Legal and safety notes
Lightning Network usage is legal in most jurisdictions, it is a Bitcoin settlement layer, and the funds are bitcoin. However, the same caveats that apply to any cryptocurrency apply here with extra emphasis: Lightning's speed and low fees can make it attractive to illicit actors, which means regulatory scrutiny of the layer is increasing. Users should understand that Lightning payments are harder to trace than base-layer transactions but not untraceable, law enforcement and blockchain analysis firms have developed Lightning-specific deanonymization techniques, and payment processors are subject to the same AML/KYC obligations as exchanges. If you are using Lightning for privacy-sensitive purposes, understand that channel opens/closes are public and that your node's IP and channel graph position are visible unless you take steps to hide them. As with all cryptocurrency, secure your channel keys and backup seeds as carefully as a bank account, a compromised Lightning node loses all channel funds instantly.
Bottom line
Lightning Network is Bitcoin's answer to the scalability problem: a network of off-chain payment channels that enables instant, low-cost, programmable-value transfers while keeping Bitcoin's security guarantees via on-chain anchoring. It is technically elegant, commitment transactions, HTLCs, and onion routing combine to create atomic multi-hop payments that require no trust in intermediaries, and practically useful for payments too small for the base layer. Its weaknesses are equally real: liquidity management is hard, routing is probabilistic, privacy is partial, and the ecosystem remains small. Whether Lightning fulfills its promise as "the Internet of money" depends on whether the liquidity, tooling, and privacy gaps close faster than competing approaches. For now, it is a powerful tool with sharp edges, powerful enough to be worth understanding deeply, sharp enough to demand care.
External references
- Lightning Network Builder's Guide, Overview (Lightning Labs engineering docs)
- Making Payments, HTLCs and multi-hop routing (Lightning Labs)
- BOLT #4: Onion Routing Protocol (Lightning Network RFC)
- Exploring Lightning Network Routing (Lightning Labs)
- Managing Liquidity on the Lightning Network (Lightning Labs)
- Channel Fees, base and proportional fees (LND docs)
- Core Lightning FAQ, receiving payments and inbound liquidity
- Lightning Network official site
Comments 0