What Is Lightning Network And How It Works
At some point in history, sending a telegram was the quickest and most efficient way of long-distance communication. To do so, you had to go to your local post office, fill in a form and pay for your message based on how many letters it contained. Then, the message would get telegraphed to the nearest telegraph office for transmission to the distant end. A postman would then deliver the telegram to its destination.
Basically, there were a lot of people involved in sending a simple short message and you had to pay quite a bit of money for it. That’s pretty much the current state of the Bitcoin network. In this analogy, the Lightning Network is essentially like having a person you want to talk to on speed-dial: you just need to press ‘1’ and your friend’s phone is already ringing.
To put it simply, the idea behind the Bitcoin Lightning Network might’ve sounded something like this: we really don’t need to keep a record of every single transaction on the blockchain.
Instead, the Lightning Network adds another layer to Bitcoin’s blockchain and enables users to create payment channels between any two parties on that extra layer. These channels can exist for as long as required, and because they’re set up between two people, transactions will be almost instant and the fees will be extremely low or even non-existent.
How does it work?
Enter Danny and Jon. They may be working together, they might be relatives or a couple, the point is they need to send money to each other rather often, quickly and with minimal fees. Thus, they set up a channel on the Lightning Network.
Firstly, they need to create a mulitisignature wallet, which is a wallet that they can both access with their respective private keys. Then, they both deposit a certain amount of Bitcoin — say, 3 BTC each — into that wallet.
From then on, they can perform unlimited transactions between the two of them. Essentially, these transactions are redistributions of the funds stored in the shared wallet. For instance, if Danny wants to send 1 BTC to Jon, she will need to transfer the ownership right of that amount to him. Then, the two of them use their private keys to sign for an updated balance sheet.
The actual distribution of funds happens when the channel gets closed. The algorithm uses the most recently signed balance sheet to determine who gets what. If Danny and Jon would decided to close the channel after that one transaction, Danny will get 2 BTC and Jon will receive 4 BTC.
Only after the channel is closed, the information about it’s initial and final balance is broadcasted to the Bitcoin blockchain. So, the way the Lightning Network works is it enables users to conduct numerous transactions outside of the main blockchain and then record them as a single one.
The most exciting thing here is that once the technology is widely adopted, you won’t necessarily even need to set up a dedicated channel to send funds to a certain person. Instead, you will be able to send payment to someone using channels with people that you are already connected with. The system will automatically find the shortest route.
This is how the Lightning Network might eventually provide an answer to the never-ending debate about buying a cup of coffee for Bitcoins. By the looks of it, doing so through the network of Lightning channels may just work, as it will be an almost instance purchase that won’t incur any fees.
Security. However, it is worth noting that the concept of the Lightning Network means that the system will work on top of the blockchain, but won’t actually have its security behind itself. Thus, it’s very likely that it will be mostly used for small or even relatively microscopic transactions. Larger transfers that require decentralized security will most likely still be done on the original layer.
Finally, another fascinating feature of the Lightning Network being tested at the moment is cross-chain atomic swaps, which are transfers of tokens between different blockchains. Simply put, it’s a way of swapping any given cryptocurrency to a different one without using cryptocurrency exchanges.
Ultimately, this technology might make unsafe centralized cryptocurrency exchanges as well as the hassle associated with trading on them obsolete. The first test of exchanging tokens between the Bitcoin and Litecoin test blockchains has already proved to be a success.
Who developed it?
Lightning Network was first described in a white paper by Joseph Poon and Thaddeus Dryja in 2015 — the current version of the white paper can be found here. There are currently three teams collectively carrying out most of the work on the development of the Lightning Network: Blockstream, Lightning Labs and ACINQ, with input from other members of the Bitcoin community.
Each of the startups mentioned above is working of their own implementation of the Lightning Network Protocol written in different programming languages.
Moreover, there are other implementations currently in development. The full list is available here. Finally, it is important to mention that the recent tests have proven that the three major implementations are fully interoperable, which means they can seamlessly work with one another.
Where, when and why will it be used?
It seems that the cryptocurrency community is eagerly anticipating the launch of the Lightning Network. Originally, it was designed specifically for Bitcoin, but the technology is currently being developed for an array of other cryptocurrencies, such as Stellar, Litecoin, Zcash, Ether and Ripple.
Real Bitcoin has actually already been sent and nearly always received using Blockstream’s, Lightning Labs’ and ACINQ’s implementations, proving that all three of those are interoperable. Moreover, the first version of the lightning specifications outlining the rules of the network has been published.
Those specifications are a huge step forward for the network, as they can be used by developers of applications and the implementation of the Lightning Network in other programming languages.
However, the network is still very much in its infancy. As of yet, there’s no software with which real-life casual users of the network can make transactions. Moreover, the current implementations are still quite buggy. Lightning Network developers have urged users to learn about the network using Bitcoin’s testnet and not send any real money.
The developers are also advising users to stay patient, as the network’s code is very complex and requires rigorous testing. To be fully adopted by the Bitcoin community, the Lightning Network will need to prove itself to be safe and usable. With that and many other factors in mind, experts predict that a fully working Lightning Network can be from several months to a couple of years away.
As to the reason why the network will be used, the answer is simple: scalability. If the network will actually provide a solution to Bitcoin’s main issue, it will most likely be adopted by other cryptocurrencies.
If that happens, there is a possibility of cross-chain atomic swap technology being developed further, thus marking a first step towards building truly decentralized cryptocurrency exchanges.
As it was mentioned before, the Lightning Network is only making its very first steps. It’s still very much in development, and whether it will actually work as the developers imagine it still remains to be seen. If it does, here are some of the most important advantages of the Lightning Network you can benefit from:
Transaction speed. Once the network is live, you won’t have to wait for several confirmations of every transaction you’re trying to make. The transactions will be almost instantaneous no matter how busy the network is. If this happens, the cryptocurrency market will make huge steps towards being able to compete with traditional payment systems like Visa, MasterCard and PayPal.
Transaction fees. As the transactions will actually take place within the Lightning Network channels and outside of the blockchain, you will only need to pay the tiniest fees, if any at all. This is one of the main advantages of the Lightning Network, as this will fully enable Bitcoin to be used as a form of payment in shops, cafes, bars and so on.
Scalability. The Lightning Network is said to be able to take the transactions per second figure of Bitcoin and other cryptocurrencies to unprecedented heights of at least 1 million transactions per second.
Cross-chain atomic swaps. The first tests of cross-blockchain transactions worked, and this is all very exciting. As long as the two blockchains share the same cryptographic hash function (and most major one do), the users will be able to send money from one chain to another without having to trust a third-party intermediary, such as an exchange. This technology has a truly revolutionary potential.
Security and Anonymity. The vast majority of cryptocurrencies out there are not fully anonymous. The transitions can still be traced from one wallet to another. When it comes to the Lightning Network, though, most of the transactions happen outside of the main blockchain, so all the micropayment made via Lightning channels will be almost impossible to trace.
Not fully operational. Perhaps the main disadvantage of the Lightning Network at the moment is the fact that’s it’s not fully operational yet, so there’s no way of fully asserting how good it actually is. Moreover, it’s concept looks great on paper, but as of yet it’s impossible to find out whether it’ll look as great once realized.
Complexity of channels. The Lightning Network is conceptualized as sort of a web of channels which, once established, should theoretically allow for seamless transactions. However, there is no telling what will happen if the payment will have to take too convoluted a route. Surely, if your transaction will need to go through dozens of intermediate channels, the fees will add up.
Channel caps. Another drawback of the network is the fact that in its current version the channels are capped. That is, the amount of Bitcoins stored in the wallet by the two users upon establishing a channel is the maximum amount of funds in that channel. This setup creates a situation where some users might need to choose between having liquidity within the Lightning Network channels and having liquidity outside of them, on the main blockchain. This is far from ideal, especially for those with rather limited resources.
Hubs. Moreover, there have been concerns voiced over forming of ‘hubs’ — a sort of nodes with a lot of capital that the majority of transactions will go through. Many Bitcoin enthusiasts see this as further centralization of the network. But, it is unlikely that such hubs will be able to make any significant profit of transactions fees.
Again, it is worth pointing out that at the moment both the advantages and drawbacks of the Lightning Network listed above are very speculative.