Today’s post discusses an important concept in the crypto world – Lightning Network.
Lightning Network is a “Layer 2” payment protocol that operates on top of a blockchain-based network(like Bitcoin).
It came about when the search for a solution to Bitcoin’s scalability issue was sought for.
This network designed has significantly facilitated the use of bitcoins in microtransaction.
At the end of this post, you would have gotten the full gist of what Lightning Network is and how it works.
Join me as I take you through this interesting learning experience.
In my usual way, here is the part where I let you know the focal points of the day’s discussion.
- What is Lightning Network?
- Top Cryptos Implementing the Lightning Network
- Pros and Cons of the Lightning Network
- Frequently Asked Questions(FAQs)
To view the details of any point, just click on it and it will be displayed.
Having prepared your mind on what is to be discussed, let’s get at doing that immediately.
1 What is Lightning Network?
Before I get to answering this question, I will start by explaining why it came about in the very first place.
After that, I will then explain what it is and how it works.
I. The Scalability Issues of Bitcoin
Bitcoin is the very first decentralized cryptocurrency founded by the unknown Satoshi Nakamoto in 2008.
Despite Bitcoin being the king of cryptos, it has one major flaw – Scalability!
Scalability can be defined as the ability of a system to continue to function optimally with increasing demand. A blockchain system is said to be scalable when it can process a high number of transactions per second by modifying its consensus mechanism or by adjusting some parameters.
BTC transactions are confirmed by miners just once every 10 minutes and have been capable of processing around 7 transactions per second.
Well, this was enough at the very beginning but not anymore causing the system to become congested for a few years now.
Because of this, transactions take a long time to process and transaction fees have become exorbitant especially small transactions.
It can even take days for a transaction to be confirmed if high fees are not attached (as was experienced in Dec 2017).
This, unfortunately, makes Bitcoin unscalable in its present state. It has also become the basis for one of the main arguments of why BTC cannot serve as a medium of exchange.
Owing to the above reason, some altcoin promoters argued that this is a good reason to leave BTC and move on to another coin.
Well, that sounded like a wonderful idea but hold up, let’s really look at it:
- What coin can ever become widely accepted as Bitcoin?
- And if there’s one, won’t it will still encounter the same scalability issues as Bitcoin(as is the case with Ethereum)?
Won’t it be a brilliant idea to have something that makes Bitcoin transactions faster and cheaper?
To make Bitcoin a means of exchange, it has to meet up to some existing standards e.g VISA processes up to 65000 transactions per second.
But the Lightning Network has the capability of processing up to 1M transactions per second.
That’s the point at which Lightning Network came into the limelight.
So what is this Lightning Network? Find out right below
II. Lightning Network Explained
Lightning Network is a payment protocol/set of rules that operates on top of the Bitcoin network.
It is considered a Layer 2 payment protocol. So if Bitcoin is Layer 1, the Lightning Network is considered a Layer 2 solution.
There are 3 teams collectively carrying out most of the work on the development of the Lightning Network with input from other members of the Bitcoin community:
- Lightning Labs
Each of the startups mentioned above is working on their own implementation of the Lightning Network Protocol written in different programming languages.
There are also other implementations currently in development. The full list is available here.
It is important to mention that recent tests proved that the 3 major implementations can work seamlessly with one another.
The reason behind the project is to design a payment protocol that can be used as an off-chain solution for the scalability problem faced by the Bitcoin blockchain and other cryptocurrencies as well.
To get an idea of what Lightning Network is, let’s consider this analogy:
Ken went down to the pub and orders drinks.
He can decide to pay for each drink as the order is filled and in this case, each order is settled separately with the attendant.
Likening this to a BTC transaction, each order is a transaction that has to be settled on the Bitcoin blockchain which will take lots of time.
But there’s another way Ken can pay; he can open a bar tab make a record of all his orders and settles the bill before leaving. Here, the attendant makes just a single record for the many orders placed.
This is what LN seeks to achieve – settling a number of transactions off-the-blockchain and recording them as a single transaction on the blockchain.
This allows for a dramatic increase in transaction speed and throughput.
It will also bring Bitcoin to the level of being recognized as a viable means of payment.
Having explained LN, learn how it works next.
III. How Does It Work?
The main idea behind the Lightning Network is off-chain payment channels.
Say that Liz and Ben are friends and frequently carry out microtransactions. Doing that on-chain requires waiting for long periods and spending a lot on fees.
So they decide to open an off-chain channel on the blockchain. This will enable them to send Bitcoin to and fro instantly and fee-free.
From then on, the payment channel remains open, and any number of transactions can directly occur between Liz and Ben without the payments being entered on the main blockchain.
Because of this, funds can be transferred as quickly as the users’ wallets can communicate over the net.
When it is time to conclude their business, Liz and Ben will conduct a ‘closing transaction’ on the main blockchain, and basically settle all of their previous transactions.
In other words, Liz and Ben write down how much each owes the other without ever exchanging the money until they choose to settle the bill.
The above analogy is basically how LN works and it’s all good because they are friends, right?
But what if I will be dealing with, not a friend, but a total stranger?
How can I trust that a total stranger will not disappear with my funds?
Well…LN has a solution to that. I will use another example to explain:
Assuming Mr. X and I are betting on the results of the UEFA Champions League with a total of 2BTC.
When you open a payment channel, each person deposits an amount of money(≥ to the value to be transacted) that acts as a security deposit.
So I will deposit 1BTC and Mr. X will deposit 1BTC into a multi-signature BTC address over the Layer 1 blockchain.
This allows BTC miners to process and confirm the Layer 1 transactions. It is only this deposit that reaches the Layer 1 blockchain.
From now on, the smaller payments will be settled between I and Mr.X over the lightning network’s payment channel.
Note: If at any point, one of us tries to back out of the transaction without consulting with the other person, the leaving side will wait for 1,000 blocks confirmations (~1 week) to get the deposited Bitcoins back. But the person left behind” will receive the Bitcoins back instantly. This serves as a security measure.
Now, assuming I lose the bet and need to pay Mr. X 0.2 BTC, we will both sign a transaction in our off-chain ledger (sort of a pocket diary). The transaction will state that I now have 0.8 BTC and Mr. X has 1.2 BTC.
If at any point Mr. X wants to leave with the winnings, he only needs to display the signed ledger to the network and the deposits will be returned according to the new balances.
This closing transaction happens on the Layer 1 network.
So in all, only 2 transactions are recorded on the Layer 1 network:
- the opening transaction
- the closing transaction
You can also watch the 5 mins video below explaining the lightning network basics.
Now that I’ve explained how LN works, I will be looking at some cryptos and wallets that have integrated the Lightning Network.
2. Top Cryptos Implementing the Lightning Network(LN)
The Lightning Network is still in its infant stage. Although it has gone live it’s still in active development.
Its Testnet, which is an alternative environment used for testing – not real-world transactions – has been live since December 2017.
Though still a work in progress, many blockchains have integrated the Lightning Network while others developed something similar to it.
They are all geared towards one goal – for improved scalability.
Apart from Bitcoin, other cryptocurrencies that are using LN include:
Lightning Labs’ implementation of the Lightning Network went live on both Bitcoin’s and Litecoin’s blockchains.
Later in 2017, Lightning Labs announced that their initial test of a cross-blockchain atomic swap of tokens was a success.
Simply put, an atomic swap is a way of instantly exchanging one token for another between their respective blockchains, without using cryptocurrency exchanges.
This initial testing was done using Bitcoin and Litecoin blockchains.
Litecoin has more than 100 active nodes on the Lightning Network.
Ripple does not really need an extra layer to scale. This is because it was originally made to handle lots of transactions.
From the project’s website, it already handles about 1,500 transactions per second and can be scaled to match VISA’s throughput.
But in August 2017, Ripple in partnership with Bitfury released a code that integrated Lightning Network into the Interledger.
Interledger is Ripple’s atomic swap technology, i.e. it is a protocol that enables transactions between different blockchains.
Ripple just needed LN’s scalability as they already have their own atomic swap technology that was developed by Interledger.
This tech would enable users to carry out transactions in both public and private blockchains.
Days after Lightning Labs unveiled the beta version of the Lightning Network, Stellar announced that they will be integrating it. This makes it one of the first platforms to publicly announce integration.
Stellar’s creator, Jed McCaleb, first explored Lightning back in 2015 but Jeremy Rubin, with the support of Nicolas Barry and David Mazières from SDF, has added the necessary improvements to make Lightning right for it
Even though Stellar might not need to extend it’s capabilities just yet, McCaleb outlines 3 major benefits to integrating the Lightning Network:
Ethereum is also developing a network similar to the Lightning Network so that it provides safe and free transactions.
The development of a separate network is because Ethereum requires a network that is specifically made for its use.
Their solution called Raiden works very similarly to Lightning Network.
The concept of Raiden is simple – providing an extra layer of security outside the blockchain to have safe and free transactions for two-way channels.
But it differs from Lightning Network because it is ERC20 compatible i.e. every token that is issued on this specific cryptocurrency will work with Raiden.
It launched Raiden on its Testnet in September 2017 and developed a lighter version of it in December 2017.
This lighter version called μRaiden(pronounced Micro Raiden) does the exact things as Raiden only that it works with only one-way transactions.
NEO (called the Chinese Ethereum) is a cryptocurrency very similar to Ethereum where the users can operate decentralized applications.
As Ethereum develops its own scaling solution, NEO also develops its own called Trinity.
Currently, Trinity is still in development and there’s no way of knowing when it will be released.
Either way, it is better for NEO as it is also another currency that handles 1,000 transactions per second which is quite a lot when compared to other currencies.
Raiden, Lightning, and Trinity are very similar in terms of their aim, but the underlying tech is very different when compared.
Monero is another cryptocurrency on which Lightning Network is being implemented.
Initially, the network would not fully work with the currency but with plans of adding another layer to the network, Lightning Network seems to be a viable option.
But the team will need to make some key improvements to the extra-layer in order to retain as much privacy as possible.
Zcash is another cryptocurrency that aims to achieve enhanced privacy and anonymity.
As ZCash is different from Bitcoin, it needs to develop a different solution in order to provide a solution that is similar to Lightning Network.
The answer to this is Basis of Lightning Technology(BOLT) which is highly inspired by Lightning Network.
It differs from LN in that it aims at making the transactions that are performed within the channel unlinkable.
This is done by using the 2 classic cryptography techniques which are Commitments and Signatures.
The former would hide the value of payment while the latter would allow the user to sign for the transactions without displaying what is being signed at the moment.
Asides cryptocurrencies, some wallets too such as Eclair, Lightning app, Zap, Bitcoin Lightning Network wallet(BLW), etc have the capability to open a Lightning Network payment channel on the first layer Bitcoin network.
I will go further now to list out the pros and cons of the LN.
3. Pros and Cons of the Lightning Network
- Rapid payments
- No third party trust
- Reduces blockchain load
- Multisignature enabled
- Onion style routing
- Indefinitely open channels
- Increased throughput, etc
- Does not support offline payments
- Not beginners friendly
- Vulnerable to hacks
I answered some questions that are always asked about Lightning Network in the next section.
Stay with me.
5. Frequently Asked Questions(FAQs)
Both the LN and DAG are digital ledger technologies developed to tackle the inefficiencies of the blockchain.
The LN tackles this issue by creating a second-tier payment network upon the blockchain. This enables BTC transactions to occur in a manner that is near-instant with negligible transaction fees.
But with DAG, transactions follow a special network. To make a transaction in the Tangle network, you have to validate 2 previous transactions.
For instance, transaction C confirms transactions A and B.
This way, the system ensures the network runs efficiently and at a lesser cost.
Read more about DAG in this review of IOTA(IOTA)
Yes, there are some fees incurred!
The combination of fees include:
a. Routing charges for routing payment information between lightning nodes
b. Bitcoin’s transaction fees to open and close channels
LN payments can be instant depending on the route. Each wallet tries to find the cheapest and the shortest route once you send your transaction.
You can open a channel directly to a person who you are going to often trade with.
Or you can depend on other channels that might route your payment for a small fee.
An LN transaction can be said to be a signed Bitcoin transaction with a special smart contract that has not yet been included in the blockchain.
On a normal day, any transaction that has not been included in a blockchain is considered insecure. This is because a miner has not attested to the validity of the transaction.
But the smart contract attached to an LN transaction is what differentiates it from a normal Bitcoin transaction.
This serves as an in-built fraud protection mechanism; just as I explained in the case of Mr. X and I above.
Network Channels are what enable users on the Lightning Network to actually transact with other users.
They can be likened to money tubes that are linked up to each other that allow payments to flow between users easily.
All channels are between 2 nodes on the Lightning Network. Once a Lightning channel is established, it’s owners can send and receive money through them.
But does this mean that I have to open a channel with every person I want to transact with?
No! Not all.
The good thing about the Lightning Network is that it is a network of channels stitched together.
Let say Pete and Gwen opened a channel. Later, Pete convinced his friend Jael to also join the LN.
Gwen has a channel with Pete, and Pete has a channel with Jael.
Gwen and Jael can then pay each other by routing through Pete.
And through some very clever cryptographic tricks, Pete cannot steal the money while it is passing through him.
When making a payment on the Lightning Network, your node searches for a path of channels between you and your destination.
This is what is referred to as Routing.
Yes! To open a network channel, you have to make a deposit on the first layer as explained above but with third party services like Bitrefill, you can create free Network Channels linking to several other channels around the world.
Read more on Bitfrefill here.
You can check out the video above for more details of the Lightning Network.
The Lightning Network is one of the most exciting projects that have the chance of bringing a secure and scalable second layer solution to Bitcoin.
But it is not like a catholicon to Bitcoin’s current problems as even its introduction may lead to other problems within the crypto-verse.
A whole lot depends on how LN’s technology develops in the future.
With that, I draw the curtains on today’s discussion.
I know you now understand fully how Lightning Network works.
So tell me: After reading through, do you have questions for me?
Looking at the concept of the LN critically, do you see it as something that will really improve scalability in the crypto-verse?
Which blockchain do you think will integrate the Lightning Network next?
Let me know all your thoughts(and your questions) at once by leaving me a message in the comment section below.
And help me educate others by sharing this post with them. The share buttons are located right below.