What is the Lightning Network?
The Lightning Network is a second-layer payments network which uses the Bitcoin blockchain as a settlement layer. But what does that mean? To answer that, let's change the question: "Why do we need the Lightning Network?"
- Bitcoin's Scaling Problem
- Payment Channels
- Getting Started with the Lightning Network
- Resources For Further Learning
The Lightning Network is not a new blockchain or coin. It is Bitcoin. All transactions on the Lightning Network are valid Bitcoin transactions. As the name suggests, the Lightning Network is a network of nodes which together form a global, second-layer payments network which uses the Bitcoin blockchain as a settlement layer. Importantly, this is all done in a trust-less way - without the need for any central control or authority.
The above image is a visualization of the Lightning Network. The number of nodes in the network has more than doubled since the image was created. Here are a few statistics about the Lightning Network as of the time this guide was written:
- 34,652 nodes (+5.32% in the past 30 days)
- 87,437 channels
- 3,454.06 BTC (~134,000,000 EUR) total network capacity
- 0.168 BTC average node capacity
You can find the latest statistics at 1ml.com.
And now to understand what the Lightning Network is, it's important to understand why it is necessary.
Bitcoin's Scaling Problem
In Bitcoin, on average a new block is found every 10 minutes. When a block is found, it is broadcast to the network, validated and stored on disk forever by every single Bitcoin node on the planet. Each new block contains about 2 megabytes of data. This means that the Bitcoin blockchain is growing at a rate of about 288 megabytes (MB) each and every day. About 2 gigabytes (GB) every week. Almost 9 gigabytes per month. And 100 gigabytes per year!
This might not sound like a lot of data. After all, the computer you're using to read this probably has hundreds of gigabytes of space. The problem here is that it's not just 100 GB in one place. It's 100 GB multiplied by the number of nodes in the network. Which today is about 10,000 nodes. That's 10,000 x 100 GB of disk space consumed each year. And disk space is not the most important limitation when running a Bitcoin full node. We'll get to this more in detail later.
With so much new data created, transmitted, validated, and stored every year, the Bitcoin network is still only able to handle about 6 transactions per second. Compared to other (centralized) payment networks, this isn't much:
- PayPal - 240 transactions per second (average)
- VISA - 3,500 transactions per second (average) and 65,000 (peak capacity)
- AliPay - 325,000 transactions per second (peak capacity)
It's not entirely fair to compare these other payment networks to Bitcoin because they achieve their high thru-put by being totally centralized. But it's still a useful metric. So how can Bitcoin scale to a similar or greater number of transactions per second?
Limitations of All Blockchains
Before we can find a solution, it's necessary to more deeply understand the problem. Why is Bitcoin limited to 2 megabytes per block every 10 minutes? There are hard limitations which constrain any public ledger blockchain which cannot be hand-waved away with flashy marketing. Disk space is the most obvious limitation, but networking and computation can be bottlenecks as well.
- Disk Space - The amount of space needed to store the blockchain on disk directly translates to higher hardware costs. Typically solid-state drives (SSD) are preferred over hard-disk drives due to superior read/write performance.
- Networking - Bandwidth and data caps imposed by internet service providers can make it too expensive for normal people to operate a node in some parts of the world. Latency caused by physical distance between nodes in the network and computational complexity in validating blocks/transactions can apply pressure to geographically centralize mining operations.
- Computation - New block and transaction validation can greatly affect how computationally expensive it is to validate the whole blockchain since it was first created. This can make it difficult or impossible for new node operators to catch-up.
So what kind of scaling solution can help address some or all of these technical limitations?
A bi-directional payment channel allows a pair of nodes to exchange value in the form of signed Bitcoin transactions which designate the shared balance between the two nodes. These signed transactions are stored only by these two nodes and are not broadcast to the rest of the Bitcoin network. Instead, they can go on exchanging signed transactions back and forth forever until one of the nodes would like to close the payment channel.
Each node in the Lightning Network manages its own payment channels between itself and other nodes. To create (or "open") a channel, a single on-chain Bitcoin transaction is created as a sort of joint escrow account between two nodes. This is the opening channel transaction. Once the transaction is confirmed, the channel is considered open and it is safe for the two nodes begin exchanging value using that channel.
To close a channel and settle its balance between the two nodes, a single transaction is broadcast and stored on-chain. Either node is able to close the channel and move their funds at any time without the permission of the other. In this way the Lightning Network is a trust-less scaling solution for Bitcoin.
It's important to note that a node in the Lightning Network does not have to be directly connected to another node in order to send it Bitcoin. Payments can be relayed thru the network, passing it from one node to the next, thru payment channels until it finally reaches the recipient.
Getting Started with the Lightning Network
- Custodial - easy to use, but not your keys not your coins, as they say:
- Non-custodial - require more learning and setup, but you are in control:
Hardware Projects to Run Your Own Node
There are several hardware projects with the stated goal of making it easier to run your own Bitcoin + Lightning nodes:
Growing The Bitcoin Community
At Bleskomat, our mission is to provide innovative hardware devices designed specifically for small business owners who would like to grow their local Bitcoin community. We believe that practical experience is worth more than a thousand articles or tweets. So that's why we created the Bleskomat ATM - the next generation Bitcoin Lightning ATM. It's easy for the customer to use and it's easy for the operator to setup and manage.
Check out our shop to learn more. We offer a variety of products including the fully assembled Bleskomat ATM, do-it-yourself kits, stickers, and more coming soon!
Resources For Further Learning
Below is a list of resources that can help you to learn more about Bitcoin and the Lightning Network:
Need additional help?
If you're stuck and would like some extra help to get your Bleskomat ATM setup working, please feel free to reach out to us directly at firstname.lastname@example.org