The Lightning Network or “Lightning” is basically a payment protocol that runs atop a blockchain (primarily for Bitcoin network), and is added as a kind of the second layer in order to process more transactions and eliminate mining fees. It does so by settling a transaction before it’s published on the blockchain.
The reason for Bitcoin Lightning Network to exist
In 2015 it was realised that Bitcoin and other blockchains had a scalability issue and would need to perform faster transactions at rates that were more economical in order to grow. The bitcoin blockchain enforces a minimum send and a fixed fee which makes micro-payments impractical.
That led to a long 2-year debate by the community until finally, in August 2017, individual users running nodes on the network launched a soft fork which initiated the process of implementing Segregated Witness, exactly what was needed for the Bitcoin Lightning Network to be built.
How does the Lightning Network actually work?
The idea is that using established payment channels you can process transactions between users without having to broadcast them on the blockchain network, and removing the risk of delegating custody of funds to trusted third parties.
The way it does this is by using Hash-Locked Contracts which are also time-locked, so only once these are confirmed are funds released. A third party can then be involved without the risk of it being assigned control of funds.
Franklyn from Litecoin explains how does the Lightning Network works
For the detailed technical explanation please refer to the official Lightning Network Whitepaper (.pdf)
Pros of Lightning Network in Bitcoin Blockchain
The 15th of March 2018 marked a big day for Bitcoin as Lightning Network went Live on Mainnet.
According to some sources, there have been three major breakthroughs in the scaling of Bitcoin since the implementation of Lightning, the first two made the price of the Bitcoin rise drastically while the last one greatly decreased the cost of transactions in the network.
The Lightning Network boasts atomic payments, which will mean you can use your crypto to pay at shops using terminals much like you do with a plastic or credit card.
It also enables sending of funds as low as 0.00000001 bitcoin without custodial risk and allows minimal payments denominated in bitcoin, using actual bitcoin transactions.
Bitcoin Lightning Network Weaknesses
One Bitcoin Core developer, Peter Todd, hinted that the scaling solution “could be vulnerable to DoS attacks”, as well as pointing out a few other kinks.
In a recent interview with Lightning Labs, CEO Elizabeth Stark estimated the total amount of Lightning developers to be as little as ten. An official statement by Lightning Labs appeals to users to stop sending money over the system as “It has become an unnecessary distraction for our devs.”
“A lot of people want to get on mainnet and it’s hard to tell them that it’s not quite ready and that they should test on testnet,” said Alex Bosworth, a Lightning developer. “I wouldn’t recommend using mainnet unless you are explicitly testing and fully know what you are doing.”
According to Bosworth, one of the biggest problems Lightning developers could face as they release a mainnet implementation is remaining backwards-compatible so upcoming releases inter-operate with prototypes currently being developed.
There are also several limitations in Lightning Transactions. A major one is that because the Lightning Network is made up of bi-directional payment channels between two nodes if either party drops their payment channel, the channel will be closed and be settled on the blockchain as normal.
Bitcoin Lightning Network Perspectives
Bitcoin’s overlay payment network is projected to improve over the next few years in areas ranging from network architecture to security and usability, and more.
Here are some of the more important Lightning projects currently being developed:
Dual-funded channels will let both users partly fund a payment channel by each depositing some bitcoin. This will give more flexibility to the user as they can then immediately send as well as receive payment after having opened a channel.
Submarine Swaps let users send Lightning payments to a middleman on the Lightning Network; that middleman will send a corresponding amount of bitcoin to a regular (on-chain) Bitcoin address. It also works the other way around. The Lightning payment and the on-chain payment can effectively be linked to each other. This makes it impossible for the middleman to steal funds by not forwarding the payment. (In agreement with the users, he could charge a small fee for the service.)
Splicing would let a user “top up” funds in an existing Lightning channel, or “drain” funds from it while keeping the channel open.
Eltoo updates a channel by building a chain of time-locked transactions, where each transaction spends funds from the previous one to reflect the latest channel balance.
Compact Client-Side Block Filtering
Compact client-side block filtering essentially inverts the trick that current SPV wallets use. Instead of wallets requesting transactions relevant to them by creating and sending out a Bloom filter to full nodes, full nodes create a filter for all Neutrino wallets. The Neutrino wallet then uses this filter to establish that the relevant transaction did not happen.
Because of the nature of the Lightning Network’s dispute mechanism the concept of a “watchtower” has been developed, where trust can be given to watchtower nodes to monitor for fraud. Whenever users update a channel, they send a small data package to a Watchtower. The first part of this package is a “hint” of a transaction they should look out for as if it were a piece of a puzzle. This hint alone doesn’t reveal anything about the content of the transaction that the Watchtower must look out for, so users don’t actually give up any privacy in this sense.
Atomic Multi-Path Payments
At the moment, a single payment must be routed over a single route. Atomic Multi-Path Payments (AMPs) will mean that larger payments can be “cut up” into smaller pieces, all of which have their own route from the payer to the payee, through different middlemen.
Using a fundamental building block of the Lightning Network called “atomic swaps”, payment channels can be linked across different blockchains. In other words, a user can send bitcoin, and as long as a node on the network is willing to make the exchange, another user can receive the payment as Litecoin.
Channel Factories are a type of payment channel that can exist among many users and only ever requires two on-chain transactions. Channel Factories can act like “sub-channels” for the Lightning Network. Participants within a Channel Factory can open and close an unlimited number of Lightning channels with each other, without requiring any additional on-chain transactions. In theory, this could bring the number of required on-chain transactions for the Lightning Network down by a magnitude.
Some still speculate as to whether Lightning is a good way to go and it seems Lightning is still in its early days when it comes to actual adoption. Indeed, only 2,519 nodes are active which compared with Bitcoin Core Nodes amounts to an insignificant number.
It’s worth waiting to see how it develops before jumping into it and start using it on your blockchain as it is still in testing, and who knows, something better might come along.
P. S. You may find some juicy stats for the Lightning Network here – https://1ml.com/statistics/
Official Lightning Network project website: https://lightning.network
Good luck and happy mining!