Lightning Network 101: What is it all about?

0
4213

It is hard to pinpoint precisely when banks stopped innovating, but it has been a while since they brought any valuable innovation to their customers. Banks almost blew up the world economy a decade ago, yet most of them got bailed out. Why were they rescued with hundreds of billions of dollars of taxpayers’ money? Because they were too big to fail and posed a systemic risk if they hit the dust. At the time, there was no alternative to banks and fiat currencies. But then, on January 3, 2009, right in the middle of the financial crisis, a new, revolutionary currency was discreetly launched: Bitcoin. The first ever cryptocurrency was born.

Can you spot the industry that has not innovated in decades?

Isn’t it crazy that in 2018 it is faster to send a physical letter anywhere in the US or get groceries delivered to your doorstep than to send money electronically?! Even more absurd, you cannot send wire transfers on the weekend because … banks are closed! Why would you need banks to be open for a process that obviously does not involve any human action? This industry has been sleeping at the wheel for decades, and it is now ripe for disruption.

The current system keeps 2.5 bln people out

Until very recently, banks were dismissing the very idea of cryptocurrencies. “How could it work? Surely, it’s just a fad – cryptocurrencies are not backed by any central bank!”. It is precisely because they are not backed by any central bank that they have a shot at being successful. The track record of central banks around the world in the past century is abysmal, most fiat currencies fail within a generation or two and end up losing most, if not all, of their value. Even the US dollar has lost more than 80 percent of its purchasing power in the past 40 years.

The paradigm shift is so profound that it was, and still is unfathomable for banks to realize how disruptive Blockchain technology was going to be for them. Think of what Netflix did to video rental companies such as Blockbuster, or digital cameras to Kodak. The main problem with the banking system right now is that it keeps 2.5 bln people out. These people are too poor to be interesting for banks, so the financial system is not interested in providing them any service. They are effectively forced to rely exclusively on cash and as a result their savings are destroyed by inflation over time as they have no way to hedge themselves nor to have access to any financial services.

What banks do not realize yet is that these people are lost for them. They will never have a bank account and will leapfrog straight to cryptocurrencies. In developing countries around the world more and more people have smartphones, which is all you need to own cryptocurrencies. As banks realize that cryptos are a threat to their very existence, they are legally required to disclose this in their annual reports.

“Financial institutions and their non-banking competitors face the risk that payment processing and other services could be disrupted by technologies, such as cryptocurrencies, that require no intermediation”

JP Morgan 2017 Annual Report

Until recently, Bitcoin did not have a very strong value proposition for people in developing countries. Making a payment using Bitcoin these days is like making a wire transfer, it is relatively slow (one block every 10 minutes and your transaction may not be included in the next block) and still expensive (about $1 now, down from $20+ back in January).

If you earn $5 per day, you cannot afford to spend even a $1 fee on every single transaction to buy or sell goods or services. In developed countries, merchants have gotten used to paying 5 to 7 percent in processing fees to credit card companies just because so far there has not been any alternative available to accept electronic payments.

Enter the Lightning Network

While Ethereum is gunning for many of the services offered by Wall Street and basically any service that relies on a trusted third party in the middle to execute a contract, Bitcoin is gearing up to take on legacy payment systems. The upcoming launch of the the Lightning Network (LN) has just been announced. It will be the first ever Layer 2 solution that is built on top of the current Bitcoin Blockchain. The basic principle of the LN is that not every single transaction needs to be broadcast to the whole network, especially small ones.

In a way, it is replicating what is already happening with the current banking system. When you use a credit card, you settle dozens of transactions at once when pay your bill. Same thing when you use cash to make several small purchases, all the banking system sees is a withdrawal from an ATM. You would never even think of paying your coffee with a wire transfer, right? So why would you do it with Bitcoin?

Increasing linearly the capacity of the network – by eightfold in the case of Bitcoin Cash – does not solve anything for a network that needs to grow exponentially. It makes no sense to burden the distributed Bitcoin ledger with every single small transaction. It will never be able to record millions of transactions per week and remain light, efficient and decentralized. It only makes sense to record large transactions on the Blockchain, while the majority of small transactions can simply be processed off-chain.

Breakdown of non-cash payments in 2015-2018 in the US

Having a wallet on the LN that you will periodically reload with some Bitcoin will enable you to send payments to LN wallets through bilateral payment channels opened between users. You will send signed transactions to other parties, but these transactions will be kept in MultiSig wallets on the LN and will not be broadcast to the Bitcoin network. At any point in time, any party will have the ability to close a payment channel and settle hundreds or thousands of transactions that happened on the LN with just one transaction on the Bitcoin Blockchain (all transactions are netted out at this point). This is the proper way of scaling up, because with such a solution the capacity of the network increases exponentially, not linearly.

What is Lightning Network?

Hailed as one of the most potent solutions to cryptocurrency scaling currently under development, the lightning network effectively creates a layer on top of bitcoin, enabling fast and cheap transactions which can net settle to the bitcoin blockchain.

Proposed by Thaddeus Dryja and Joseph Poon in a 2015 white paper, the idea is based on a network that sits on top of the bitcoin blockchain, and eventually settles on it. The network is comprised of user-generated channels that send payments back and forth in a secure and trust-less fashion (trust-less means that you don’t need to trust or even know your counterparty).

Say, for instance, that I wanted to pay you for each minute of video that I watched. We would open up a lightning channel, and as the minutes rolled by, periodic payments would be made from my wallet to yours. When I’m done watching, we would close the channel to settle the net amount on the bitcoin blockchain.

Because the transactions are just between me and you and don’t need to be broadcast to the whole network, they are almost instantaneous. And because there are no miners that need incentivizing, transaction fees are low or even non-existent.

How it works

First, two parties who wish to transact with each other set up a multisig wallet (which requires more than one signature to enact a transaction). This wallet holds some amount of bitcoin. The wallet address is then saved to the bitcoin blockchain. This sets up the payment channel.

The two parties can now conduct an unlimited number of transactions without ever touching the information stored on the blockchain. With each transaction, both parties sign an updated balance sheet to always reflect how much of the bitcoin stored in the wallet belongs to each.

When the two parties have done transacting, they close out the channel, and the resulting balance is registered on the blockchain. In the event of a dispute, both parties can use the most recently signed balance sheet to recover their share of the wallet.

It is useful to note that it is not necessary to set up a direct channel to transact on lightning – you can send payments to someone via channels with people that you are connected with. The network automatically finds the shortest route.

Development of the technology got a significant boost with the adoption of SegWit on the bitcoin and litecoin networks. Without the upgrade’s transaction malleability fix, transactions on the lightning network would have been too risky to be practical.

Without the security of the blockchain behind it, the lightning network will not be as secure, which implies that it will largely be used for small or even micro transactions which carry a lower risk. Larger transfers that require decentralized security are more likely to be done on the original layer.

Where are we now?

Although it was originally designed for bitcoin, the technology is currently being developed for a range of cryptocurrencies, such as litecoin, stellar, zcash, ether and ripple. Litecoin plans to launch its version at the same time as bitcoin’s.

In December 2017, startups behind the three most active lightning implementations (ACINQ, Blockstream and Lightning Labs) revealed test results, including live transactions, proving that their software is now interoperable.

Furthermore, version 1 of the lightning specifications, which set out the rules of the network, has been published. This will encourage the development of other implementations and applications.

However, the network is not yet ready for launch. Engineers have yet to release software with which real users can make transactions. Apps supporting lightning as a payment method are already cropping up, but so far they’re not easy to use.

That has not stopped some of those working on projects from testing lightning transactions on the bitcoin network. Lightning developers discourage this, however – not only does it act as a distraction to developers, but it also puts users’ funds at risk.

Given the complexity of the code, and the need for rigorous testing (we are talking about payments, after all), developers are urging patience. In addition, lightning can’t be implemented at scale until SegWit is more widely extended – so, while some believe that there is enough SegWit support to run the network on mainnet now, others predict that a usable lightning network could be at least a year away.

In March 2018, California startup Lightning Labs announced the launch of a beta version of its software, making available what investors and project leads say is the first thoroughly tested version of the tech to date. It is still early days, however – transaction sizes are limited, and the release is aimed at developers and “advanced users”.

The successful initiation of SegWit for the Litecoin network opens the door for implementing an off-chain scaling solution originally intended for bitcoin.

Litecoin is now testing adding the Lightning Network. The Lightning Network, if implemented could make the following changes.

Instant Payments

– Lightning-fast blockchain payments without worrying about block confirmation times. Security is enforced by blockchain smart-contracts without creating a on-blockchain transaction for individual payments. Payment speed measured in milliseconds to seconds.

Scalability

– Capable of millions to billions of transactions per second across the network. Capacity blows away legacy payment rails by many orders of magnitude. Attaching payment per action/click is now possible without custodians.

Low Cost

– By transacting and settling off-blockchain, the Lightning Network allows for exceptionally low fees, which allows for emerging use cases such as instant micropayments.

Cross Blockchains

– Cross-chain atomic swaps can occur off-chain instantly with heterogeneous blockchain consensus rules. So long as the chains can support the same cryptographic hash function, it is possible to make transactions across blockchains without trust in 3rd party custodians. Source

Atomic Swaps

Also known as atomic cross-chain swaps, the technology essentially allows two people holding tokens on two different blockchains to trade directly – and instantly – without the risk of one party running off with the other’s money before the trade is complete.

That is where the word ‘atomic’ comes in. It means that either the trade happens in its entirety, or it doesn’t happen at all. So, if a Lightning node goes offline or Bob reneges on his end of the deal, everyone gets their money back.

Before Atomic Swaps can be realized we need the following on two separate blockchains…SegWit and the Lightning Network.
“In order for atomic swaps to work, Lightning has to be up and running on at least two different blockchains. Right now, it is just starting on one: litecoin. But, the hope is, it will be running on multiple chains soon.”

“As it stands, several development teams are currently testing their implementations of Lightning on the litecoin blockchain. Further, SegWit (the protocol upgrade that is a prerequisite for Lightning) has been activated on a second blockchain, vertcoin, opening the doors to Lightning on that chain as well.”

“According to Charlie Lee, the founder of litecoin, who is committed to atomic swaps, all that is left is to get Lightning fully operational on litecoin, and then begin testing it on vertcoin. Once those steps are complete, we may see the the first atomic swaps as soon as this year.”

“Certainly, that is the idea Lee has been kicking around for some time. He wrote about his plans for atomic swaps in a blog post back in January. And, the 2017 litecoin roadmap clearly specifies a plan for atomic swaps between litecoin and vertcoin.” Source

This could be a huge step forward for all cryptocurrency, if you want to know more about Litecoin please read this post.