You've probably heard of the Lightning Network. If not, fill in the blanks with us. Bitcoin transactions these days are not only slow but also uncomfortably expensive. Sending Bitcoin over the Lightning Network is not only cheap and fast, but almost anyone can do it. If you thought that sending payments was the alpha and omega of the second layer of the bitcoin network, you could never be further from the truth. Will Lightning change the world we know?
Blockchain is actually a decentralised ledger that contains all transactions and account balances that have ever occurred on a specific network. Unlike centralized systems, this ledger is maintained collectively by all nodes in the network and does not rely on any single authority (such as a bank). This made it possible to create the first functional decentralised cryptocurrency - Bitcoin. But there is a catch. In the beginning, when the network is still small or little used, everything is fine - transactions are fast, extremely cheap and anyone can download the entire blockchain to a computer and independently verify that everything fits.
Over time, however, as Bitcoin's popularity and use has spread, it has become apparent that the blockchain as a database is a relatively slow and inefficient solution - it is much more efficient to add to and reference a single centralized database than it is to coordinate all the nodes on the network. The blockchain stores all transactions that have ever taken place in a given cryptocurrency. Even a small payment for a coffee from 2015 will forever be stored in the bitcoin network. This is a problem for a network that aims to become a global payment instrument with a huge number of transactions. This will mean that the size of the blockchain will inflate and will place specific demands on those who want to manage a node in the network (a.k.a full node).
We will continually increase the size of blocks to keep speed and transaction fees low. But this will mean that soon only big players with the capital for expensive data centres will be able to afford to verify the blockchain. This option will lead to a centralised network, making it easier to attack. This is the direction that a section of the BTC community took and split off to form Bitcoin Cash.
A set of solutions that reduce individual data writes to the blockchain. This is in part, for example, SegWit, Schnorr's upcoming signatures along with Taproot and other improvements. Bitcoin's technological improvements, called BIPs (Bitcoin Improvement Proposals), will be discussed in a separate article: BIP – Bitcoin Improvement Proposal. These solutions work, but they cannot be applied indefinitely and will never completely solve the problem of blockchain bloat.
The vast majority of nodes in the network will not maintain the entire blockchain, but only parts of it, but in such a way that even a small number of nodes can put the entire blockchain back together. This solution is still only in the experimental phase, it is envisaged for example by Ethereum (partly also Cardano).
These solutions reckon that most common transactions will not be written directly to the blockchain, but to payment layers above it, as these will be faster and cheaper. The blockchain will serve as the cornerstone and "final judge" for these layers, where only once in a while a new account status is written (called the Settlement layer). The dominant solution here is the Lightning Network or, for example, its equivalent on Ethereum called Plasma.
Some innovators are proposing to discard the blockchain altogether and use an alternative protocol, such as cryptocurrencies that run on DAGs (such as Nano, IOTA, Byteball). However, these solutions are still in the early stages of development, fall far short of the security and stability of the bitcoin blockchain, and there is scepticism as to whether they will even work on a decentralised global scale.
Payment channels outside the BTC blockchain have been talked about almost since the beginning of Bitcoin. One of the first imperfect designs was described by Satoshi Nakamoto himself (probably so much for the claim by Bitcoin cash supporters that LN is not part of "Satoshi's vision"). The concept was further developed by other BTC developers (for example Mike Hearn and Matt Corallo) overcoming various problems (the first attempts with payment channels, for example, worked only one-way).
It was not until Joseph Poon and Thaddeus Dryja released the Lightning Network whitepaper in 2016 that the Lightning Network concept was given a coherent form. From that moment on, the development of Lightning's Bitcoin scaling solution began in earnest. Independently, 8 implementations in different programming languages are under development:
The developers of all these implementations have committed to the BOLT standard, which leads to their implementations being compatible with each other. This will create a unified network instead of competing with each other. Blockstream and many independent developers are also involved in the development and support of the Lightning Network.
Lightning Network is primarily a network scaling solution, but that's definitely not the only thing its implementation is meant to help Bitcoin with.
Bitcoin will not be able to be used for efficient payments unless it supports many more transactions per second (TPS) than the current 7 at total. Lightning Network transactions will increase network throughput many times over as they go off the blockchain. Yet the whole network will still be as decentralised as ever.
Transaction blocks are added to the BTC network approximately once every 10 minutes. To consider a transaction safe, we should wait at least 2-4 blocks, i.e. 20-40 minutes. However, Lightning Network transactions are instantaneous, so they can be a suitable solution for payment terminals, for example.
Small transactions (even smaller than 1 satoshi) can be sent to the Lightning Network. The fee is almost negligible, assuming a long-term open lightning channel. Thanks to this, we can set up automatic payment systems for small services, for which micro-fees can be charged by the minute, for example.
The Lightning Network can help improve user privacy because transactions on Lightning take place outside the public blockchain - in channels that are not completely transparent. Lightning will thus function a bit like a Bitcoin mixer.
Cross chain atomic swaps will be possible with Lightning if the Lightning Network supports multiple cryptocurrencies. In the channel, it will be possible to quickly and cheaply exchange one cryptocurrency for another, without the need to use any stock exchange.
The cornerstones of the Lightning Network are payment channels. Payment channels are essentially smart contracts - special addresses with slightly more sophisticated rules than a regular BTC address.
These channels are created by writing to the BTC blockchain between two counterparties and are bidirectional. "Transactions" in the Lightning Network are actually overwrites of account status (but these overwrites are only stored in the channel, not in the BTC blockchain). Any change in this channel must be approved (signed) by both parties (multisignature). The status of the channel can be changed freely after both parties have signed, but the old status is deleted and the last one is always binding.
In very simple terms, the two parties agree between themselves what the status of the accounts is between them, and in the end, the payment is settled by writing it to the blockchain. Some channels may be created for only a few payments, others may remain active for years without the need to close the channel. Closing a channel means having to write to the blockchain, so it makes no sense to open new channels just for one or two payments.
The consent of both parties is also not required to close a channel - the smart contract contains mechanisms to prevent channels from being misused by dishonest parties (who may lose their funds in the channel). Each party, therefore, has the option, in certain circumstances, to conclude it separately, thereby terminating the payment relationship. The technical details of smart contract are well described in this article.
A payment channel is useful in itself, especially if the parties that have opened it together have some kind of long-term payment relationship. However, for normal use (a one-off payment for coffee), it is not practical for a coffee lover to open their own channel with the café unless they plan to return regularly. However, the individual channels are not isolated from each other. On the contrary, it creates a connected network!
Some LN channel administrators may even build a network of channels (hubs or channel factories) purely for the purpose of connecting the network and forwarding transactions. They will be able to charge a fee for this service. This will rapidly increase the network throughput.
Some critics of Lightning argue that these services will increase centralization and make it easier to regulate Bitcoin. Personally, I think that the criticism is unjustified - on one hand, it will still be possible to use (especially for larger and important payments) the BTC blockchain itself (which is sufficiently decentralised thanks to small blocks and the ability to easily manage your own BTC node), on the other hand, the lightning network will be global and everyone will be able to participate or create hubs.
The Lightning Network also carries certain risks. Under certain circumstances, e.g. if one of the parties to the channel is offline (especially for mobile wallets), the other party may attempt to unilaterally close the channel and the appropriate part of the counterparty's funds without its consent. One possible solution may be to use a service known as Watchtower, which has been part of the LND implementation since version 0.7.0-beta. In the event that one party attempts to cheat the other, Watchtower will step in and punish the unfair party by transferring all resources in the channel to the other party.
Once the payment channel is closed, the resulting final account balance (agreed by both parties) is written as a regular transaction to the BTC blockchain. In the event of a dispute, one of the parties may close the channel unilaterally, in which case the last transaction approved by both parties will be written to the blockchain.
Blockchain can therefore act as a "court of last resort" - a fixed, decentralised and immutable base layer on which other, more flexible and faster layers are built. You could liken it to contracts - most contracts we ever sign are never discussed with a judge, only when there is a conflict.
Lightning Network is still in the development phase, however, there is already a number of nifty apps and wallets with great UX and UI that allow both beginners and advanced users to use Lightning Network on a daily basis.
The number of nodes and subscribers in the network is growing rapidly. The average channel lifetime is 389 days and the average channel capacity is 0.029 BTC. There are currently 17,556 nodes running on the Lightning Network, of which 3,837 are running on the Tor network. There are already several services (exchange offices, e-shops selling physical and virtual goods, casinos and virtual games) that accept Lightning payments.
Classic payment via the Lightning Network is most often made using QR codes, which traditional banking is just discovering. The Lightning Network hasn't just been for Linux and command line geeks for a while now, but most of the intuitive LN wallets are available for iOS, Android, MS Windows and macOS. Not only do they offer a pleasant and simple user interface without unnecessary complications, but the most popular ones are also in Czech.
!
It should be remembered that the whole Lightning Network technology is still in the beta (development) phase. Although there are no known cases of loss of funds, the Lightning Network should be approached with caution and not leave any large sums of money on the network.
We remind you that Lightning wallets are also called hot wallets, i.e. they are connected to the internet around-the-clock. For larger sums, we recommend using a cold wallet, preferably a hardware wallet, which we cover in detail in our article: Hardware Wallets – How to Safely Store Bitcoins and Other Cryptocurrencies?
ZAP: Desktop is currently the most successful lightning wallet with a perfect graphical interface, simple operation and a lot of handy features.
Don't take the seed backup, these 24 words, lightly. Make a note on a piece of paper or in Cryptosteel or Bunkeroid. NEVER save the seed to your PC, take pictures with your phone or show it to anyone!
Choose a strong password, preferably using a password manager. Name your wallet and choose a way to backup the channel state. These are stored in the channel.backup file and it is the only way to access the bitcoins you have in the channel. Cloud backup may sound untrustworthy, but be sure that without seed, channel backup is useless. An SSD drive in a PC can die, so it's not a bad idea to have a backup somewhere else.
The example shows the completion of the backup setup in local mode, i.e. on the same PC where the ZAP wallet is located. After confirmation, the wallet starts synchronizing with the Lightning Network and within 1-2 minutes everything is done. In the meantime, you can send the first bitcoins to the on-chain part of your wallet to open the first channel. For better transactional privacy, send the unrounded amount and send smaller charges from a bech32 address that always begins with bc1.
To open a channel with sent bitcoins, you must have at least one confirmation in the blockchain. Clicking on the link next to the Transaction ID will open the Blockstream explorer. Note the information in green about the savings in transaction extraction fees and the fact that there were no known breaches of transactional privacy, e.g. no rounded payment amount.
When clicking on Channels, we see that we don't have any channels yet. There are two options, Create and Manage. Choose Create and get to work.
Once you have selected a node, the only thing left to do is to choose the channel capacity, i.e. the amount of bitcoins (satoshi) that are to be enclosed in the channel. Click Next to see the recap and click the button at the bottom of the window to confirm the opening of the channel.
The successful opening of a channel is dependent on an on-chain transaction with a single confirmation unless the other party has set up otherwise. As soon as the first confirmation occurs in the blockchain, the channel is open and ready for use.
Payments over the Lightning Network are made using the LN invoices beginning with the letters lnbc. Most good wallets and projects accepting LN payments automatically translate to a QR code. So just scan the QR or copy the wording of the invoice by pressing the button and paste. ZAP wallet will automatically load all the details, just confirm and the payment is ready.
The moment you pay something on the Lightning Network, a remote balance of the same value as you sent is created on the other side of the channel. This represents the amount that you can in return receive via Lightning Network. You create an invoice for the amount you want the other party to pay and send them a QR or text version of the invoice.
Once the other LN party has paid the invoice, the invoice status changes to paid. Bitcoins appear in our payment summary and are available for use immediately, no need to wait for any confirmation on the network.
In Preferences and General, you will find language settings, fiat currency and dark/light mode settings. Under Wallet, you can set the on-chain address type (we recommend bech32), the preferred on-chain explorer, the source of the BTC exchange rate, and the mining fees in terms of the number of blocks since the transaction was sent to the network.
Once we have an open channel, we can choose from a fairly wide range of stores and services that Lightning Network supports:
Many Bitcoin supporters consider the Lightning Network to be the best way to go and a true innovation (as opposed to many "fast blockchains" which are often fast just because they are either centralized or nobody uses them). Developer activity and enthusiasm are indeed high, but so far it is mainly kept below the surface - in professional technical circles. Developers liken the development of Lightning to the excitement they felt in the early stages of Bitcoin's development - from 2010–2013. The Lighting Network is slowly, but surely making its way to mainstream users and businesses.
And now - history time. Once upon a time, the way the Internet worked was that all computers were interconnected by a single cable and all computers on the network communicated with each other. If you wanted to send an image to one computer on the network, you had to send it to everyone at the same time. This type of communication is called Broadcast. We can also find there some considerable similarities with the bitcoin blockchain. When we send a transaction to the bitcoin network, we send it to all computers (full nodes) in the network. And just like we figured out then that Broadcast is not a scalable solution, we figured it out with blockchain.
The solution was provided by a type of communication we call Unicast. Today we no longer send data to all computers that are connected to the Internet, but only to one, in most cases to a server. In the case of Bitcoin, there is no need for every piece of information exchanged between two parties to be propagated to all computers on the Bitcoin network. All that is required from the parties of the transaction is to exchange information. And that's the way Bitcoin scales, brought about by the Lightning Network.
Today's digital world is mostly based on Unicast. You don't even need to have a vivid imagination, and if you understand the Lightning Network a bit, you'll see some similarities. If Bitcoin is the internet of money, then the Lightning Network is to Bitcoin what Unicast is to today's Internet. If this sounds like something out of a sci-fi movie, we recommend an excellent article by Melik Manukyan: Lightning Network enables Unicast Transactions in Bitcoin. Lightning is Bitcoin’s TCP/IP stack.
As soon as you understand a little, another rabbit hole opens up before you, which is quite possibly even deeper than the bitcoin one. And while everyone is working on cheap and fast transactions, projects like RGB, Storm, Prometheus and other components of LNP (Lightning Network Protocols) are flying under the radar unnoticed. Have you ever owned something with no record of it anywhere (not even on the blockchain), yet you could prove your ownership?
If there's anyone else within Bitcoin and the Lightning Network that you most likely haven't heard of yet, but should, it's Dr Maxim Orlovsky, one of the founders of the LNP/BP Standards Association, a brilliant scientist, engineer and cypherpunker. The future that the first glimpses of Maxim's work suggest is fascinating and difficult to describe in words.
i
LNP/BP: A gentle introduction by Giacomo Zucco
Are you interested in LNP/BP? Then we recommend this "gentle introduction to the subject", written for us by Giacomo Zucco himself, co-author of the aforementioned RGB protocol.
The Lightning Network is a complex technology and we still have a long way to go before we can use it intuitively and seamlessly. There is also criticism of various features and functions of Lightning - we will address this criticism and the future of Lightning (and other cryptocurrencies) in the next article.
Michal Mikle
I'm an overclocker and enthusiast Bitcoiner. With computer hardware, any unused performance won't keep me calm. If there is the possibility of squeezing another drop of power from the hardware, I won't miss it. I love the adrenaline and pushing the limits, of the components and myself. This activity is rich with choices, but I mainly use liquid nitrogen and phase-change methods. I also set up a service to optimise Intel processors, delid.cz, building custom PC setups on demand and I enjoy security and privacy topics. Outside the digital world I'm interested in permaculture and other low time preference systems.