What is the Lightning Network?
By now you may have heard a thing or two about Bitcoin’s Lightning Network, and how it promises to usher in a new level of scalability that is unachievable in its current form. But what actually is the Lightning Network and how does it plan to help bitcoin process more transactions? We’ll go into a bit of detail about it here without making things overly complicated and explain the basics of it for you and how it’s beneficial to the future of bitcoin.
What Exactly is the Lightning Network?
The idea for the Lightning Network has been around since 2015 when its original white paper was published by Joseph Poon and Thaddeus Dryja. Even back then, three and a half years ago, it was apparent that the Bitcoin Network could only handle so many transactions per second (roughly 7) and with this limitation it would never truly be able to scale to a global user base. For example, Visa processes approximately 4,000 transactions per second and PayPal processes 193.
As was witnessed in the last couple months of 2017 and in early 2018, bitcoin transaction fees have the capability of skyrocketing, making it unrealistic to use as a currency when making small purchases. The most commonly used example is the purchase of a cup of coffee. At a modest price of $1 per coffee, an average transaction fee as high as 10 cents still renders bitcoin rather unusable as a payment option, as this equates to a 10% fee — likely higher than it would be to use a credit card for the same purchase, and infinitely higher than a cash fee of 0%.
So, how can bitcoin become competitive in the area of “micropayments” given that transaction fees will likely surpass 10 cents in the future? The answer is the Lightning Network (LN), which is an off-chain solution that allows participants to transact in bitcoin without actually having to broadcast their transactions to the bitcoin blockchain. This allows bitcoin users to save both time and money as transactions are instant and far cheaper than they would normally be.
Buying a beer on lightning!
— BitMEX Research (@BitMEXResearch) December 31, 2018
How does the Lightning Network function? Put most simply, LN is a network of payment channels which allow bitcoin to be sent from party to party without having to be connected to the blockchain. At its most basic premise it operates like this:
- Say Alice and Bob are two bitcoin users who regularly send BTC back and forth to one another. They both agree to create a payment channel between them and each secures 1 BTC in a LN smart contract, for a total of 2 BTC.
- If Alice wants to pay Bob 0.25 BTC, she signs a transaction to the LN, which Bob is notified of, and he also signs the transaction. This information is kept in an off-blockchain ledger which then reflects that Alice has 0.75 BTC and Bob has 1.25
- If Bob wants to pay Alice 0.5 BTC, he signs a transaction to the LN, which Alice is notified of, and she also signs the transaction. The ledger is updated to reflect that Bob now has 0.75 BTC and Alice has 1.25 BTC.
- Let’s say both Alice and Bob want to pull out their bitcoin from the LN. Either or both of them can then choose to close the payment channel, which broadcasts a transaction to the bitcoin blockchain, releasing 0.75 of the 2 BTC held by the smart contract to Bob and the remaining 1.25 BTC to Alice.
This means that people can transact BTC among those they have a payment channel with for weeks, months, or even years without having to interact with the bitcoin blockchain. Payments from parties connected by payment channels are extremely fast (hence the name “lightning”) and incur very little to no fees. Furthermore, each party of the payment channel has the ability to act as an LN node by connecting themselves with other parties. Therefore, participants don’t need to have direct channels with one another in order to transact bitcoin; rather the information is relayed through the different nodes and their ledger balances individually updated to reflect movement of the BTC through the nodes.
The LN accomplishes all this through the use of smart contracts, which cannot be modified or corrupted. The LN smart contracts serve to ensure that all parties of the network are operating their channels in good faith and punishes “bad actors” that attempt to manipulate the network or refuse to verify transactions with their signatures by causing them to forfeit their allotment of BTC held by LN smart contracts.
Though it has been a slow, laborious process, with its first attempts riddled with software bugs and errors that needed a large degree of ironing out, the Lightning Network grew by leaps and bounds in 2018. There are now over 5,120 active nodes in operation, creating over 18,000 channels between them, with a combined capacity to transact 550 BTC (or $2.13 million). This may not sound like a huge number, but it is a step in the right direction, meaning LN is slowly preparing itself for the next bitcoin bull run.
For pretty much all of last year, setting up a LN node was costly and required a great deal of technical expertise. However, LN-friendly bitcoin wallets are currently being launched around the globe, automating many of the processes required to begin transacting on the network. This means that anybody can now set up their own node and payment channel with the click of a few buttons, designating a portion of their BTC to be locked in a LN smart contract to be used to LN payments.
Those who choose to act as nodes and intermediaries between users can be rewarded in fees they set for their services, but because the network automatically the cheapest path to route a payment, the network encourages competition by rewarding those who set the cheapest fees with the most traffic. This sort of competition helps keep LN transaction costs to a minimum — far cheaper than miner fees typically associated with the blockchain.
Lightning Network: January 2018 vs December 2018 pic.twitter.com/P6LWP1RRzr
— Jameson Lopp (@lopp) December 24, 2018
Because the LN is designed to scale at a near infinite level, this means that it could potentially allow for millions of transactions in BTC per second, making it faster than even the fastest payment processor currently available. It is important to bear in mind a few considerations, however; chiefly LN is not actually a part of the Bitcoin Network but a layer that runs on top of the network. As such, it should not be inferred that it is part of bitcoin itself, as it only interacts with the blockchain periodically. It is also still highly under development, meaning that things will probably not run perfectly until more testing can be performed to discover bugs and their corresponding solutions.
Nevertheless, LN is something of a magnificent tool that can help bitcoin achieve Satoshi Nakamoto’s vision of acting as a universal form of currency, capable of instantly processing modest transaction for use in everyday situations. Below is a short FAQ on the Lightning Network inspired by a post on the Bitcointalk forum where a member articulately described some more advanced questions one might have about how the network functions.
Lightning Network Q&A
How are the bitcoins stored on the Lightning Network different from regular bitcoins?
They are exactly the same type of coin. LN does not use tokens or its own cryptocurrency. The only real difference is that LN bitcoins are kept in multi-signature addresses governed by smart contracts and transactions are settled between two parties without having to broadcast anything to the blockchain other than when the channel opens and closes.
Will online stores eventually accept Lightning Network payments?
Yes, they already have in some cases. Initially, BTC-friendly merchants were largely hesitant about accepting bitcoin because of high transaction fees. However, some of them (like Coingate) use third party services which are slowly developing LN support. Here is an ever-expanding list of merchants that currently accept LN-based payments.
How many times can a payment channel be used?
Since every channel has a minimum amount of coins which are required to remain unspent, channels can continue to be used so long as both parties keep their payment channel open.
Exactly how fast and reliable are LN payments?
Depending on the route used to process the payment, LN payments can be instant. Each LN wallet will always try to find the cheapest and the quickest route between parties when sending a transaction. Participants have the option of opening a channel directly to a or depending on other channels to route the payment for a small fee. Since the LN is still in its early stages, payments still fail on occasion.
What are some of LN’s upcoming features?
One of the main additions will be Watchtowers, which are responsible for overseeing user attempts to cheat the system while the other party is offline. Another is Multi-Path Payments which allows payments to be divided into smaller ones to avoid failed payments that are due to their being not enough funds in the channels along the payment path.
Which is the best LN wallet?
Currently, there are several implementations of the Lightning Network and most wallets have comparable features. However, mobile wallets are still particularly lacking. Eclair is the most popular wallet for Android and is also available on Windows. The most popular implementations are: c-lightning, LND and eclair mentioned earlier.
How much money can one make from running a LN node?
There honestly isn’t a whole lot of money to be made from running an LN node since the point is to make the cost of transacting in BTC lower. It all depends on the number of connections a node has and its individualized fee policy. The less a node charges, the higher their chances to route passing payments.
Is it demanding to run a LN node?
Lightning Network nodes can be run on both Linux and Windows. One of the main drawbacks is that this requires the running of a Bitcoin full node, blockchain and all, which can be quite taxing on system resources. In order to start collecting money by running a node, more than one payment channel must be kept open.
Are there risks involved in running a LN node?
Yes. Because Lightning Network implementations are still in beta they might contain critical bugs which could be somehow used to steal funds locked up by smart contracts. If a node isn’t kept online 24/7, it is possible that someone may attempt to cheat by broadcasting an old state of their channel. Keeping a node online is the only way to prevent this possibility.
Can a node increase their earnings by opening new channels?
No, they can’t. The main things to be kept in consideration are the node’s fee policy, the BTC capacity of the channel, and its connection to different-sized nodes.
How do I set up a LN node?
As nodes can be created on both Windows and Linux machines, the setup process varies for each implementation. There are a number of tutorials available online to help novice users create their own Lightning Network node.
Is LN centralized, and does it make bitcoin more centralized?
Since LN is a second layer scaling solution, it is not actually part of the Bitcoin Network, and has no impact on it. LN functions independently from the Bitcoin Network itself and no one is required to use it. While it’s true that large nodes currently exist, it should be remembered that this technology is still in its infancy and should therefore resolve itself as more nodes are added and the LN continues to grow.
Will average BTC users be able to accept payments via the LN without having to run their own LN node 24/7?
Unfortunately, this is not currently possible. However, new wallet solutions that automate the node creation process are under development and expected to be ready for use before the end of the year.
Are there new limitations of scalability after the LN becomes is fully functional?
To open and close a channel, an on-chain transaction must be broadcast to the Bitcoin Network, which takes as long as it does to confirm any other bitcoin transaction. Ultimately, the speed and scalability of the LN is only confined by this obstacle.
What would happen if a large node were to suddenly disappear from the network?
After closure of a large node, it is possible that some people would experience routing problems and payment failures. However, once the Lightning Network grows to a considerable size and enough channels are present, this problem should be minimized as an abundance of re-routing options would be present.
Are LN BTC transactions more or less anonymous than regular, on-chain BTC transactions?
Because payments can be routed through dozens or theoretically hundreds of channels, the Lightning Network actually increases the level of privacy, as nodes don’t carry information about whether or not the node previous to it initiated a transaction. Therefore, LN nodes routing payments never know the sender or the final destination of each transaction, making its transactions more anonymous than on-chain transactions.
What will happen if some nodes go temporarily offline?
In previous iterations of LN, offline nodes were still considered capable of routing payments caused payments to fail because its channels were actually unavailable. A new release of LN has insured that when a channel is closed, or a node has gone offline, the rest of the network is instantly made aware that they are no longer capable of routing payments, effectively removing the node from the network. In the case where somebody knows their node will be offline, they can create unadvertised channels which will be excluded from the overall network and won’t route payments not specifically sent by the person running the node.