The Lightning Network (LN) is a "layer 2" payment protocol layered on top of Bitcoin (and other blockchains and cryptocurrencies).[1] It is intended to enable fast transactions among participating nodes and has been proposed as a solution to the bitcoin scalability problem.[2][3] It features a peer-to-peer system for making micropayments of cryptocurrency through a network of bidirectional payment channels without delegating custody of funds.[4]
Normal use of the Lightning Network consists of opening a payment channel by committing a funding transaction to the relevant base blockchain (layer 1), followed by making any number of Lightning Network transactions that update the tentative distribution of the channel's funds without broadcasting those to the blockchain, optionally followed by closing the payment channel by broadcasting the final version of the settlement transaction to distribute the channel's funds.[5]
To settle the payments the channel must be closed. To initiate this process one node broadcasts the most up to date settlement transaction to the network. The next events can broadly be thought of in two ways, a cooperative closure in which both parties confirm a distribution and funds are immediately settled and an uncooperative closure. Uncooperative closes may be legitimate for example if one node is no longer part of the network or fraudulent with one node broadcasting an outdated, incorrect distribution. In uncooperative closures the funds are not settled instantly but there is a dispute period within which nodes may contest the broadcast distribution. If the second node broadcasts a more up to date distribution then the funds are transferred entirely to them. This punitive act, known as the breach remedy transaction, prevents nodes from attempting to defraud the network by broadcasting out-of-date transactions.
Joseph Poon and Thaddeus Dryja published a draft of the Lightning Network white paper in February 2015.[6][non-primary source needed]
On January 19, 2019, pseudonymous Twitter user hodlonaut began a game-like promotional test of the Lightning Network by sending 100,000 satoshis (0.001 bitcoin) to a trusted recipient where each recipient added 10,000 satoshis ($0.34 at the time) to send to the next trusted recipient. The "lightning torch" payment reached notable personalities including Twitter CEO Jack Dorsey, Litecoin Creator Charlie Lee, Lightning Labs CEO Elizabeth Stark, and Binance CEO "CZ" Changpeng Zhao, among others.[7][8]
Andreas Antonopoulos has referred to the Lightning Network as a second layer routing network.[9] The payment channels allow participants to transfer money to each other without having to make all their transactions public on the blockchain.[10][11] This is done by penalizing uncooperative participants. When opening a channel, participants must commit an amount (in a funding transaction, which is on the blockchain).[12] Time-based script extensions like CheckSequenceVerify and CheckLockTimeVerify make the penalties possible.
Lightning operates under a unified specification called the BOLT (Basis of Lightning Technology) specification.[13] There are four major implementations of Lightning that implement the specification: Lightning Network Daemon, CoreLightning, Eclair, and Lightning Dev Kit.[14]
There are several claimed future benefits to using the Lightning Network compared to on-chain transactions:
The Lightning Network is made up of bidirectional payment channels between two nodes which combined create smart contracts. If at any time either party drops the channel, the channel will close and be settled on the blockchain.[16]
Due to the nature of the Lightning Network's dispute mechanism, which requires all users to watch the blockchain constantly for fraud, the concept of a "watchtower" has been developed, where trust can be outsourced to watchtower nodes to monitor for fraud.
A period of 24 hours is allotted to create a bidirectional channel after receiving a request.
In the event that a bi-directional payment channel is not open between the transacting parties, the payment must be routed through the network. This is done using an onion routing technique similar to Tor, and it requires that the sender and receiver of the payment have enough established peers in common to find a path for the payment.[17] In effect, a simple route would look like this:
The original whitepaper in reference to routing suggests that "eventually, with optimizations, the network will look a lot like Tier-1 ISPs".
Laszlo Hanyecz, who gained fame in the cryptocurrency community for paying 10,000 BTC for two pizzas in 2010, bought two more pizzas in 2018 using Lightning Network and paid 0.00649 BTC.[18]