Welcome to my guide to the Lightning Network!
In this guide, I’m going to tell you what the Lightning network is, how it works and what it can be used for. You won’t need to go anywhere else to have the Lightning network explained to you.
By the end of this short guide, you’ll know what’s good, what’s bad and what’s important about the Bitcoin Lightning network. I’ll begin with a look at where it all started...
Bitcoin was created by 'Satoshi Nakamoto' in 2009. By 2011, they were gone, never to be heard from again! No one knows who Nakamoto is or exactly how they wanted the platform to be developed in the future.
This is a problem because Bitcoin is an amazing piece of technology but it isn’t perfect. If it’s going to remain the world’s biggest cryptocurrency then it will need to change and improve. This is where the Bitcoin community comes in...
The Bitcoin community is full of talented and enthusiastic developers, engineers and computer scientists. They all have ideas about how to improve the Bitcoin network. Some of these ideas are so small that they are barely noticed and some are so large that new cryptocurrencies are created by them!
The development I’m going to tell you about today is one of the most important so far. It’s called the Lightning network and it could change the way we use cryptocurrency forever.
Table of Contents
- 1. What is the Lightning Network?
- 1.1. Bitcoin Basics
- 2. The Scalability Problem
- 3. How does the Lightning Network work?
- 4. Payment Channels
- 5. Payment Networks
- 6. Lightning Network Security
- 7. Lightning Network Timeline
- 8. Lightning Network Issues: 2018
- 9. Lightning Network: Pros and Cons
- 10. Final thoughts
What is the Lightning Network?
For New Coinbase Users
Receive your $10 bonus when you sign up for a new Coinbase account & trade at least $100. Follow this Coinbase referral link to activate the deal.
Lightning Network works as a decentralized exchange
The Lightning Network was first proposed by Thaddeus Dryja and Joseph Poon in 2015. The problem it’s designed to solve is one of the biggest that cryptocurrencies face, scalability.
Scalability is how well a platform can deal with a huge increase in its number of users. To understand the problem let’s take a quick look at how Bitcoin works…
Bitcoin is a decentralized peer-to-peer payment platform. It’s decentralized because it isn’t run by a company like Visa and it doesn’t have a leader (Satoshi Nakamoto is long gone, remember?). Bitcoin is run by its users on a network of thousands of computers called nodes.
Nodes contain a full record of every Bitcoin transaction that has ever been made. This record is called a blockchain. More than half of all the nodes need to agree that each new transaction is valid before it can be added to the blockchain. This is called consensus.
One block of new transactions takes around ten minutes to be processed and added to the blockchain. The nodes that do most of the work of processing transactions are called miners and they’re paid fees for the work they do. This means that sending Bitcoin is not only slow, it can also be quite expensive.
You might be able to guess the rest from here! Let’s get back to scalability.
The Scalability Problem
As Bitcoin becomes more popular, its network of nodes grows. The more nodes there are, the longer it takes for them to reach a consensus on new transactions. The average transaction speed goes down as the network gets bigger.
At the moment, Bitcoin can process about 3-7 transactions per second (Tx/s). Now compare that with two of Bitcoin’s real-world competitors. PayPal can process 150 Tx/s and Visa processes around 2000 Tx/s but can go as high as 56,000 when it’s busy. When Bitcoin is busy, users have waited 6 days for transactions to be processed! Transaction fees also tend to go up during busy periods, so users have to pay more for less.
That’s the scalability problem Bitcoin and many other cryptocurrencies are struggling with. What is the Lightning network going to do about it? Let’s find out…
How does the Lightning Network work?
You might have heard the Lightning network explained as a 2nd layer solution. This means that the Lightning network is trying to solve the scalability problem by adding an extra layer to the Bitcoin network. Here’s how it works…
The Lightning Network allows users to set up their payment channels. This means that thousands of small and medium-sized transactions can take place away from the main blockchain.
Imagine Joe works for Thad. Thad pays Joe 1BTC per day for a contract that lasts for 30 days. The pair set up a payment channel on the Bitcoin Lightning network. This information is added to the main blockchain and is called the anchor transaction.
Every day, 1BTC is transferred from Thad to Joe in their new payment channel. These transactions are called micropayments and they happen instantly. The pair needs to agree on each transaction inside their payment channel.
At the end of 30 days, the contract ends and the pair close the payment channel. The final balance of the channel is sent to the network, processed and added to the main blockchain. This is called the settlement transaction. So, whilst 30 micropayments took place between Thad and Joe in their payment channel, only two transactions need to be added to the main blockchain.
By using the Lightning network, Thad was able to send Bitcoin to Joe quickly and the main blockchain was free to process more large transactions. Everyone’s a winner!
Next, I’m going to look more closely at how Thad and Joe set up their payment channel and how the system can grow to become a whole network…
To set up a payment channel on the Lightning network, Thad and Joe need a multi-signature wallet. This is a bit like a joint bank account. A multi-signature wallet is created by a deposit of funds. In our example, it would be a deposit of 1-30BTC by Thad. This is the anchor transaction that’s added to the main blockchain.
A multi-signature wallet requires each user to provide two kinds of information for transactions to take place. They are;
- Public address: This is the digital location of the Bitcoin. You can think of it as an email address, information can be sent to it and received from it.
- Private keys: These acts sort of like a password for the public address. Each user has their private lines of code that they use to “sign” transactions going to and from the public address.
If either user fails to provide these pieces of information, then transactions in the payment channel won’t happen. So, how does one payment channel become a super-fast payment network?
What’s special about Lightning network payment channels is that they can link up to become payment networks of thousands or even millions of users.
Joe and Thad don’t need to set up payment channels with every user on the Lightning network to make transactions with them. Let’s imagine Joe is married to Lou and they have their payment channel for household expenses. This payment channel links Thad and Lou through Joe, so Thad and Lou can now send each other Bitcoin without setting up another payment channel.
Now imagine Thad, Lou and Joe each have 10 unique payment channels with other users and each one of those users has set up 10 unique payment channels as well. Soon you’re looking at a network of millions of nodes capable of sending Bitcoin to each other instantly. A single payment could pass through thousands of nodes to get to its destination in less than a second!
I know what you’re thinking. If my payment goes through thousands of different nodes to get to where I want it to go, what’s stopping another user from stealing it? Read on to find out…
Lightning Network Security
Micropayments on the lightning network are guided by smart contracts. Smart contracts are sets of rules that must be followed for transactions to take place. For example, users can attach fees to transactions that are paid to each node it passes through. A smart contract would make sure that fees are only paid after the transaction is completed.
This gives all Lightning network users a good reason not to interfere with transactions.
A quick note on Lightning network fees
Lightning network fees are likely to be very small compared to the fees charged by miners on the main blockchain. The work done by Lightning network nodes is far easier than that done by miners. Any user trying to charge high fees to allow payments to pass through their node would be avoided. However, fees would soon add up to respectable amounts due to the high volume of Lightning network transactions.
Two other important features of Lightning network security are timelocks and asymmetric revocation commitments. Here’s what they do;
- Timelocks can be used to set an upper limit on how long a payment channel remains open. This stops one user from disappearing and leaving the balance locked in the wallet. In our example, if Joe only worked for 15 days and then disappeared, Thad could claim back the remaining 15BTC in the wallet using a pre-set timelock.
- Asymmetric revocation commitments are a way to punish users who try to cheat the system and remove their share of a wallet at a time that suits them. Asymmetric revocation commitments allow users to set conditions where the cheated user could claim the full balance of a wallet, leaving the cheater with nothing!
Now you know what the Bitcoin Lightning network is and how it works. Let’s see what stage of development the network is at and who’s using it…
Lightning Network Timeline
It could be argued that the Lightning network release date was December 6, 2017, when its protocol was first issued on GitHub. However, the official Lightning network daemon wasn’t released until January 7, 2017, so this could also be considered the Lightning network release date!
On December 27, 2017, a developer named Alex Bosworth paid his Bitrefill cell phone bill using the Bitcoin Lightning network. This is thought to be the first use of a Lightning Network payment on the Bitcoin mainnet.
Since then, the Lightning network mainnet has been in a long test phase. Several developers have been researching and testing Lightning network projects. The main ones are Lightning Labs, ACINQ and Blockstream.
In March 2018, Lightning Labs released Lightning Charge, a tool for developers to build lApps with. LApps are Lightning applications such as payment services which will be based on the Lightning network.
It’s hoped that banks and other large organizations will use Charge to build lApps that their millions of customers will use. One of the first lApps to become popular is Poketoshi, a game where users bid to control famous Pokemon characters with Lightning network payments!
Time to see where are all these Pokemon fans at! I'm releasing Poketoshi!
A 'Twitch plays' like game, using @lightning network microtransactions.⚡
— João Almeida (@joaodealmeida94) June 16, 2018
The Lightning network will run on any platform that supports smart contracts and multi-signature wallets. This means that we could see Lightning networks providing 2nd layer solutions to platforms like Ethereum, Ripple, and Zcash soon.
The search and analysis engine, 1ml, lists more than 2,500 nodes with over 7,800 payment channels operating on the Lightning network today. However, the network is not ready for use by millions of people and recent problems have confirmed this…
Lightning Network Issues: 2018
In January 2018, Lightning Labs co-founder, Elizabeth Stark, criticized Blockstream for allowing its customers to pay for goods using the mainnet Lightning network. Stark accused Blockstream of risking their customer's money by using technology that hasn’t been properly tested yet. She tweeted, “Bad move @Blockstream.”
In March 2018, the network suffered a DDoS attack. The attack came after a Bitcoin developer, Peter Todd, had warned the community about these kinds of risk. He also explained that attacks like these on the Lightning network could also affect the main Bitcoin blockchain.
You now know where the Lightning network came from and where it’s going. You even know when the Lightning network release date was (you just need to pick one!). Before you go, I’m going to make a summary of everything good and everything bad about this exciting new development…
Lightning Network: Pros and Cons
My Grandma always tells me to start with the bad news, so here it is!
✗ The Lightning Network isn’t ready yet. It’s hard to say how successful it could be until it’s being used by hundreds of thousands of people. Unfortunately, the Lightning network has enough issues to keep the development community busy for quite a long time.
And now the good news!
✓ It’s a long-term solution to the scalability problem. Other platforms - like Bitcoin Cash - have made changes to Bitcoin which they think solve the scalability problem. However, their solutions tend to be short term. If the network is ever going to be truly scalable, then it will come in the form of a project like the Lightning network. A few other suggested solutions are big enough to fix the problem completely.
✓ Micropayments mean micro-fees. The Lightning network could solve Bitcoin’s second-biggest problem which is high fees. When it was created, Bitcoin promised super-fast transactions and low or no fees. So far, it hasn’t delivered. But with the Lightning Network, it might be able to shortly!
✓ The Lightning network gives users more control. The main Bitcoin blockchain is largely controlled by miners. Miners use very powerful and expensive equipment to complete the tasks involved in processing transactions. On the Lightning network, nodes can be run by anyone; on laptops, home PCs and (one day soon) mobile phones. Bitcoin was designed to include everyone and that’s exactly what the Lightning network wants to do.
That’s all folks, the Lightning network explained. I’ll leave you with a few last thoughts...
On January 23, 2018, the major payment services company, Stripe, announced that it was ending its support for Bitcoin payments. Product Manager, Tom Karlo, said that Bitcoin had, “become better-suited to being an asset than being a means of exchange.” This means that Bitcoin is valuable but it’s not good at being money anymore!
As a technology, Bitcoin is years ahead of traditional banking, but as a money system, it’s got a lot of work to do. I want you to think about all the small purchases you make during the day. Can you imagine buying a bus ticket or a cup of coffee with a Bitcoin transaction? The bus would be late and your coffee would be cold by the time the transaction had been added to the blockchain!
Using the main Bitcoin blockchain for small purchases is like using a wire transfer or a cheque to pay for a cup of coffee. You just wouldn’t do it. You’d use a credit card or cash, wouldn’t you?
In the United States, 72% of all non-cash purchases are made with credit and debit cards but they only make up 3% of total spending in dollars. These are the sorts of micropayments that should be happening on the Lightning network. Imagine how much faster the Bitcoin network would run if the main blockchain was only used to process the 28% of transactions that make up 97% of total spending?
If Bitcoin is going to succeed as digital money then it needs to become a better “means of exchange.” In my opinion, the Lightning network is the best solution that’s been suggested so far. It’s not quite ready yet but when it is, we might see the kind of Bitcoin network that Satoshi Nakamoto was imagining in 2009.