- Bitcoin is too costly to use for day to day transactions!
- Do you know, it cost more in transaction fees when we buy Coffee using Bitcoin?
Most of us are familiar with the problems facing bitcoin today.
Bitcoin, the new age currency, as they say, was supposed to be the fastest and cheapest mode of transaction. But what we see today is that bitcoin is only able to handle up to 7 transactions per second while its counterpart Visa/Mastercard are able to handle thousands of transactions per second.
Even though the fees price has been fluctuating, it reached 55 USD in January 2018 and now have fallen under a dollar but can rise again.
With such abrupt fees, how can an average user even think of adopting this decentralized marvel in his/her daily life?
Imagine visiting a cafe for a coffee where you are paying a fee in bitcoins that is more than the actual price of coffee itself, insane!! And of course, don’t forget the number of minutes or even an hour that might be required to get the transaction through.
And this is where a new technology called Lightning Networks comes to rescue.
What is Bitcoin Lightning network?
To understand lightning network let’s first have a brief recap of how the bitcoin transactions work today:
Every bitcoin wallet holder has two keys, one public key, and one private key. Now let’s take a case where I want to send 1 BTC to a friend Harsh.
I log in to my wallet with my private key, enter the Harsh’s public Bitcoin address and the amount of BTC to be sent from my wallet, then I click send.
After this, I wait for few minutes to a few hours depending upon the confirmation time till 1 BTC appears in Harsh’s wallet.
Now, let’s break up this transaction and understand what is happening here step by step.
The Anatomy of a Bitcoin Transaction:
Step 1: I create a transaction (taking inputs from the previous transaction) which essentially says ‘send one bitcoin from my wallet to Harsh’ and then I sign the transaction details with my private key which is like giving approval for this transaction to take place. All this is happening off-chain that is without the involvement of blockchain.
Step 2: Now when I click ‘send’ I am broadcasting this transaction on-chain where a miner will pick up this transaction to be placed in a block which is then mined. Once mined the transaction is successful and gets registered on the immutable blockchain.
Here, the time required for the miner to pick up your transaction depends upon the fees you offer to pay the miner. More the fee you offer more is the chance of your transaction to be picked up first. Also, read: How Much Bitcoin Transaction Fees Should You Pay For Confirmed Transaction?
All this process take a lot of time and money which makes micropayments for (like buying a coffee) very inefficient.
Here comes our savior Lightning Network:
The lightning network is essentially a payment channel layer which operates as a second layer on top of the Bitcoin network. With lightning, thousands of transactions per second with zero to minimal fees are possible, that too without compromising the decentralized nature of Bitcoin.
And by this, we can certainly rebuke the claims of Bitcoin Cash and become even better than it for payments as mentioned in this funny but much relevant tweet.
So, yes, by onboarding on this technology, we can go to a coffee shop and pay for our coffee instantly within seconds. Lightning Network is already live right now on mainnet but currently in the testing phase but one can always use the lightning implementations and wallets to host on the mainnet and start using lightning. (I will be leaving all the important links at the end of the article)
Let’s Understand How Lightning Network Works:
Unlike traditional Bitcoin transaction, for the Bitcoin lightning network to work one has to create a payment channel with a person we want to transact with.
This transaction takes place off-chain, without burdening the blockchain. That is to say, there is no need for ‘Step 2’, that I explained previously to take place every time I’m transacting with my friend Harsh.
It is only for the opening and closing of the payment channel that we require on-chain activity for which traditional transaction steps apply.
For such bidirectional payment channel, a multisig wallet is necessary, whereas, in traditional wallet transactions, only the sender has to sign the transactions with their private key, but in multisig wallet transactions, both the sender and receiver need to sign the transactions.
To properly understand this concept let’s take a few examples:
Example 1: Direct Payment Channel
Suppose Harsh and I are business partners and we regularly need to send and receive money from each other.
Step 1: First we will open a payment channel between our wallets and put in (commit) let’s say 1 BTC each in the channel. Now the total amount in the channel is 2 BTC. This complete step takes place on-chain.
Step 2: Now with 2 BTC in the channel we can carry out any number of to-and-fro transactions within the limit of 2 BTC. This will be done off-chain, that is, without broadcasting to the blockchain. Therefore, here there is no need for paying fees or wait for confirmations and transactions can take place instantaneously.
Step 3: Suppose now we have finished our business and now we no longer need to transact with each other. In such a case we will close down the created payment channel by broadcasting the current status of the payment channel and the final settlement of 2 BTC will be redeemed in our respective wallets. This step too takes place on-chain.
Therefore, we see that, only for opening and closing of a channel, broadcasting to the blockchain is necessary and not while transacting within a channel.
If you like to learn watching videos, here is a video that explains Lightning network in a simple to understand language:
Example 2: Routed Payment Channel
Now suppose Harsh is a local car dealer and I need to transact with him just once. In such a scenario, opening and closing of the channel just for one transaction will be expensive. In such cases, the routing of Bitcoin payments with indirect channels can be done.
Let’s suppose we both have an open channel with a local pizza store. Here I can still pay Harsh with this indirect channel via pizza store node, provided all channels have sufficient funds in it.
Similarly, I can transact with anyone anywhere in the world via this indirect channel routing where there can be multiple nodes and channels in between and I just need to a route or network of nodes that let me connect/reach to the recipient.
In both examples, if the counterparty is malicious or even if the in-between a channel is malicious then your funds are refunded back to your wallet within a time limit. This is done via a technology called Hash Timelock Contract.
Although as revolutionary as it sounds it also has some concerns:
There are concerns regarding how this model might work with large transaction amounts since for such transactions the intermediate channels should also have a large number of funds committed in them.
There are fears that such huge capital requirements can lead to the formation of centralized hubs whose sole purpose will be to provide lightning node as service.
Such a hub-and-spoke model can bring some degree of centralization to the network. That’s why how these concerns are addressed remains to be seen once we practically start using the lightning network at large scale.
And when we will see large scale adoption, well the adoption will increase slowly because it is not a definitive change rather it is an iterative change and its adoption will also be iterative. That’s why there is be no point in time where we will say that Lightning Networks is completely deployed. And the same thing Jameson Lopp, a cypherpunk has mentioned in his tweet in early January 2018.
But, anyways do watch this short video on misconceptions about Lightning network as it will definitely address some of the obvious questions.
Update: The Lightning network is bigger than ever as it has now grown into a total capacity of 100 BTC with 12 K live channels. And also BTC payment processors like CoinGate is adding all of its 4000 merchants on the off-chain solution of Bitcoin Lightning network.
Do let me know your views on Bitcoin Lightning network and how do you think it will change the whole landscape of decentralized currencies?
Official Lightning Resources:
Further Suggested Readings: