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 of value storage (SoV). The U.S. Commodity Futures Trading Commission (CFTC) classifies 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 problem of being "slow and expensive."
Over 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, which separates witness data from transaction data, and Taproot, which uses MAST to expand Bitcoin; others do not change Bitcoin itself but choose to operate off-chain, such as sidechain technology that moves assets to other blockchains, and payment channel networks that move most transactions off-chain for execution.
Today, we will introduce the Lightning Network, which is a type of payment channel network. In Bitcoin's payment scenarios, the Lightning Network can help users save costs and improve efficiency.
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 faced by 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 takes out a certain amount of cash (for example, 100 yuan) and places it in the center of the table, which is equivalent to making 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, which is like recharging the channel in the Lightning Network.
- At the end of the Mahjong game, each player counts the playing cards in their hand and then settles the final amount using the cash placed 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" (the Bitcoin blockchain), and all intermediate micropayments (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 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 (HTLCs) 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 Rollups execute transactions off-chain, there are significant differences between the two. Rollups execute transactions and computations off-chain, then bundle multiple transactions into a batch and periodically submit 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, Rollups need 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, Rollups mainly use fraud proofs, with a challenge period of about a week, or use zero-knowledge proofs to provide instant finality; while the Lightning Network relies on Watchtowers and timely responses to fraudulent behavior.
In terms of liquidity, Rollups do 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 long been regarded by the Bitcoin community as the orthodox Layer 2 solution for Bitcoin, with its legitimacy tied 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 were 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 were 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, parties and some witness nodes broadcast the highest sequence tx they have seen." This was the embryonic form of the Lightning Network and the birth of its legitimacy.
In the following years, several solutions related to payment channels emerged, but none had a significant impact. It wasn't until early 2015 that the draft white paper titled "The Bitcoin Lightning Network: Scalable Off-Chain Instant Payment" 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 trees" to invalidate outdated channel transactions, which became the technological prototype for the later Lightning Network.
In October 2016, the Scaling Bitcoin Milan conference saw the birth of the Lightning Network protocol specification (BOLT, Basis of Lightning Technology). In the summer of 2017, Segregated Witness (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, which supported early users, 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 the Fiber Network beta version.
The story of the Lightning Network continues, and its development will be an important direction worth watching 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 a more efficient and convenient solution for small, fast payments globally.