Satoshi Nakamoto positioned Bitcoin as "a peer-to-peer electronic cash system" in the Bitcoin white paper. However, after more than a decade of development, Bitcoin has not become "electronic cash" but rather "digital gold," with people viewing it as a medium for storing value (SoV), and the U.S. Commodity Futures Trading Commission (CFTC) classifying it as a commodity. Bitcoin produces a block approximately every 10 minutes, with a TPS of only 7, leading to long transaction confirmation times and frequent on-chain congestion, and transaction fees (miner fees) are not cheap. To become "electronic cash," Bitcoin must solve the "slow and expensive" problem.
In the past decade, many technical solutions have emerged within the Bitcoin community to help scale Bitcoin: some solutions achieve this through forks, such as SegWit separating witness data from transaction data, and Taproot using MAST to expand Bitcoin; others do not change Bitcoin itself but choose to operate off-chain, such as sidechain technology that transfers assets to other blockchains, and payment channel networks that move most transactions off-chain.
The Lightning Network we will introduce today is a type of payment channel network that can help users save costs and improve efficiency in Bitcoin payment scenarios.
What is the Lightning Network?#
The Bitcoin Lightning Network is a P2P network built on top of the Bitcoin blockchain, a Layer 2 solution for Bitcoin, aimed at addressing the limitations of scalability and transaction speed in the Bitcoin network. The Lightning Network enables instant, low-cost, and scalable micropayments, while maintaining decentralization and security. By using off-chain payment channels and smart contracts, users can transact directly without broadcasting each transaction to the main chain. This approach significantly reduces the load on the Bitcoin network, making transactions faster, cheaper, and more private.
We can simply understand the Bitcoin Lightning Network through the analogy of playing Mahjong:
- Before starting the Mahjong game, each player puts a certain amount of cash (e.g., 100 yuan) in the center of the table, which is equivalent to conducting a transaction on the Bitcoin main chain, opening a payment channel. At the same time, everyone uses playing cards as a temporary scoring tool, with each card representing 0.5 yuan.
- During the Mahjong game, the winner takes the corresponding number of playing cards from the loser, which is akin to off-chain transactions in the Lightning Network — fast, without confirmation, and does not affect the cash in the center of the table (the Bitcoin main chain).
- If a player runs out of playing cards, they can put more cash in the center of the table to exchange for more playing cards, similar to recharging the channel in the Lightning Network.
- At the end of the Mahjong game, each player counts the playing cards in hand and then settles the final amount using the cash in the center of the table, which corresponds to channel closing and on-chain settlement in the Lightning Network. Only the final result is recorded in the "official ledger" (i.e., the Bitcoin blockchain), and all intermediate small transactions (the wins and losses of each round of Mahjong) do not need to be recorded separately.
The Mahjong analogy helps us better understand the Lightning Network, but the actual Lightning Network is much more complex, and its engineering implementation is even more intricate. We will detail how the Lightning Network operates in future articles, so stay tuned.
What the Lightning Network is not?#
To better understand the concept of the Lightning Network, it is essential to know not only what it is but also what it is not.
1. The Lightning Network is not a blockchain#
The essence of a blockchain is a distributed ledger where all on-chain transactions are broadcast and recorded in this ledger, requiring a consensus mechanism for maintenance, often issuing its own tokens to incentivize miners/nodes to maintain the ledger.
The Lightning Network primarily relies on Hash Time-Locked Contracts (HTLC) to ensure the security of funds and does not have a so-called consensus mechanism. Transactions in the Lightning Network are not broadcast to the entire network; only the final settlement is broadcast to the Bitcoin main chain. Additionally, the Lightning Network does not issue its own tokens, nor does it need to.
2. The Lightning Network is not a Rollup#
Although both the Lightning Network and Rollup execute transactions off-chain, there are significant differences between the two. Rollup executes transactions and computations off-chain, then bundles multiple transactions into a batch, periodically submitting the transaction results and proofs to the main chain; whereas the Lightning Network opens payment channels off-chain and conducts multiple transactions through these channels, only interacting with the main chain when opening and closing channels.
In terms of data availability, Rollup needs to publish data on Layer 1; while the transaction data in the Lightning Network is primarily stored between participants and does not go on-chain.
In terms of security models, Rollup mainly uses fraud proofs, with a challenge period of about a week, or uses zero-knowledge proofs to provide instant finality; while the Lightning Network relies on Watchtowers and timely responses to fraudulent behavior.
In terms of liquidity, Rollup does not require pre-locked funds; while the Lightning Network requires funds to be locked in the channel.
The Development History of the Lightning Network#
The Lightning Network has always been regarded by the Bitcoin community as the orthodox Layer 2 solution for Bitcoin, with its orthodoxy related to Satoshi Nakamoto.
The earliest concept of the Lightning Network was called "payment channels," designed to update the state of unconfirmed transactions through transaction replacement until they are broadcast to the Bitcoin network. When Satoshi Nakamoto created Bitcoin in 2009, he had the idea of payment channels and included a draft of the payment channel code in Bitcoin 1.0, allowing users to update transactions before they are confirmed by the network.
Later, in a reply email to developer Mike Hearn, Satoshi further explained payment channels: "Intermediate transaction matters do not need to be broadcast; only the final result will be recorded by the network. Just before nLockTime, the parties and some witness nodes broadcast the highest sequence tx they see." This was the embryonic form of the Lightning Network and the birth of its orthodoxy.
In the following years, several solutions related to payment channels emerged, but none had a significant impact. Until early 2015, the draft white paper titled "The Bitcoin Lightning Network: Scalable Off-Chain Instant Payment" written by Joseph Poon and Thaddeus Dryja was released, clarifying the development of the Lightning Network. In the same year, a paper from ETH Zurich titled "A Fast and Scalable Payment Network with Bitcoin Duplex Micropayment Channels" proposed using time locks as a "countdown device" for channel validity and a cryptographic technique called "invalid tree" to invalidate outdated channel transactions, which became the technological prototype that the Lightning Network relies on.
In October 2016, at the Scaling Bitcoin Milan conference, the Lightning Network protocol specification (BOLT, Basis of Lightning Technology) was born. In the summer of 2017, SegWit was activated on the Bitcoin blockchain, paving the way for the implementation of the Lightning Network. In March 2018, Lightning Labs released the beta version of the Lightning Network implementation, enabling early users to utilize its features, marking a milestone in the development of the Lightning Network.
Source: https://cryptoyc.medium.com/ 闪电网络简史 - 4032bf4c8868
The Lightning Network is an open-source project, so anyone can contribute code. Currently, the more representative Bitcoin Lightning Network implementations (clients) include LND (Lightning Network Daemon) developed by Lightning Labs, Eclair developed by ACINQ, and CLN (Core Lightning) developed by Blockstream.
Source: https://www.btcstudy.org/2023/03/27/what-are-the-differences-between-lnd-and-cln/
In addition to the Bitcoin Lightning Network, other blockchains are also developing their own Lightning Network implementations, such as Cardano is developing Hydra, and Nervos CKB has launched Fiber Network in beta.
The story of the Lightning Network continues, and its development will be an important direction worth paying attention to in the Bitcoin ecosystem and the entire cryptocurrency field. We look forward to the Lightning Network helping us realize Satoshi Nakamoto's original P2P "electronic cash" vision, providing more efficient and convenient solutions for small, fast payments globally.