Lightning Network And How It Works
If Bitcoin is ever to become a fully-fledged alternative to currently existing payment systems, it will obviously need to be able to compete with them. To understand the magnitude of the situation, simply compare Bitcoin’s minuscule 7 transactions per second to Visa’s average of 24,000, and its peak capacity of around 50,000 transactions per second.
What is the Lightning Network?
When Bitcoin was first proposed by Satoshi Nakamoto in 2008, the very first public comment on the system made by James A. Donald contained the following line: “the way I understand your proposal, it does not seem to scale to the required size”. Ten years later, scalability is still the biggest problem for Bitcoin as well as other veteran cryptocurrency systems.
What exactly does scalability mean? Well, throughout its existence Bitcoin has only been capable of processing around 7 transactions per second. While this was enough at the very beginning, the system has been congested for a few years now. As a result, transactions take a long time to process and transaction fees are extortionate.
If Bitcoin is ever to become a fully-fledged alternative to currently existing payment systems, it will obviously need to be able to compete with them. As of now, it’s not even close. To understand the magnitude of the situation, simply compare Bitcoin’s minuscule 7 transactions per second to Visa’s average of 24,000, and its peak capacity of around 50,000 transactions per second.
Over the years, Bitcoin’s community came up with various proposals on how to improve Bitcoin’s scalability, but an overall resounding consensus is yet to be reached. That’s why we currently have several Bitcoin-like networks branching out from the original one. There is, however, one proposed solution currently being tested that might just work. It’s called the Lightning Network.
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.
Blockstream works on LN version in C.
Lightning Labs is developing a Lightning Network Daemon (lnd) written in Golang.
ACINQ is responsible for a Scala implementation.
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.
Should I use the Lightning Network?
Well, as a matter of fact, if you’re not an advanced user, you can’t use Lightning Network just yet. So, the best – if not the only thing you can do right now is wait and see whether the lightning network lives up to the hype, whether it can actually function and described and whether it’s safe.
Bear in mind, the Lightning Network is not the only scaling proposal out there, and it’s by no means an undisputed leader in that race, with Bitcoin Cash (BCH) being its main rival. The debate between the BCH adepts and the Lightning supporters is fierce and there’s no end in sight. It could be that one of those proposals comes out on top, they could potentially coexist, or there can be an entirely different solution.
The Lightning Network sounds exciting. If it actually delivers, consider what you actually use your Bitcoins for. If you use the tokens as a long-term investment and nothing else, you might not even need the Lightning Network, as currently it doesn’t seem entirely safe to entrust it with handling big transfers.
But, if you view Bitcoin as an alternative form of payment, the Lightning Network, provided it lives up to the expectations, will be essential for you. Instant micropayments, increased anonymity, almost non-existent fees – it really seems to offer solutions to most of the Bitcoin’s problems.
Altcoins With Lightning Network Support
Bitcoin has always been the world’s main and most valuable cryptocurrency, and that’s not likely to change any time soon. Still, many people believe that Bitcoin has been in a crisis for quite some time now. Indeed, lately there’s been a lot of complaints from users not only having to wait for several hours until their transaction is confirmed, but also paying exorbitant fees in the process.
The problem here is that Bitcoin’s blockchain is only capable of processing up to 7 transactions per second, which causes delays and increases fees. If Bitcoin is ever to become a widely-adopted payment system, that figure really needs to change.
There have been many potential solutions to this problem, but perhaps the one with the most potential is the Lightning Network. Essentially, the Lightning Network creates an extra layer on top of Bitcoin’s blockchain, enabling fast and cheap transactions which don’t have to be immediately broadcasted to the community.
In short, that extra layer is comprised of two-way user-generated channels enabling users to send money to each other as often as they need to, instantly, with minuscule fees. Of course, there is a lot more to it, so check out our dedicated guide to learn exactly what the Lightning Network offers to the community.
Spoiler: it’s a lot – the Lightning Network was originally designed to solve Bitcoin’s problems, but it seems that a multitude of altcoins have taken a liking to it as well. Some are planning to implement the entire network as it is, while others are working on their own, albeit very similar solutions.
Perhaps technologies like the Lightning Network are the next logical step in the development of cryptocurrencies. Here’s our round-up of various networks’ takes on this latest trend.
Bitcoin and Lightning Network
This has been thoroughly discussed in our previous guide, but here’s what’s happening with the Bitcoin Lightning Network in a nutshell:
The network is still very much in its infancy and it isn’t fully live yet. However, its testnet, which is an alternative environment used for testing – not real world transactions – has been live since December 2017.
The beta-version of the network was launched on Bitcoin’s mainnet on March 15. At the time of writing, just over a month after the launch, the Lightning Network’s node count stands just below 2,000, which is already more than the number of nodes in Bitcoin Cash.
This implementation is called Lightning Daemon (lnd) and it was developed by Lightning Labs. Around the time of the launch, the startup also announced completion of a seed finance round. They’ve raised $2.5 mln, with contributions coming from some of the biggest names in the cryptocurrency industry.
Lightning Labs are not the only startup out there working on the Lightning Network. There are also other implementations being developed by Blockstream, ACINQ and other members of the community.
So, the completely streamlined and user-friendly version of the Bitcoin Lightning Network is yet to be released, but real Bitcoins have been sent and received via all three major implementations of the network, which also proved that all three of them are interoperable.
Lightning specifications have also been published, which enabled developers to begin working on various applications and other implementations of the network. Most importantly, you can actually already download Lightning Network wallets, albeit nearly all of them are beta-versions.
Here’s a list of some Bitcoin Lightning Network wallets that are already available for you to play with and explore the Lightning technology:
- HTLC— a web wallet created by Alex Bosworth that enables you to start making payments immediately and without any configuration.
- Lightning-app— a desktop wallet developed by Lightning Labs, available for Mac and windows.
- Zap— a desktop wallet with a user-friendly interface, designed by Jack Mallers.
- Eclair— a mobile wallet for Android devices designed by ACINQ.
Litecoin and Lightning Network
Scalability is a pressing issue for most cryptocurrencies in the market and Litecoin – which on many occasions has been referred to as ‘the silver to Bitcoin’s gold’ – is no exception. Litecoin has always been one of Bitcoin’s direct rivals, attracting users with its $0.40 transaction fee besides everything else.
Obviously, once the Bitcoin Lightning Network goes mainstream, Litecoin’s transaction fees are going to turn from an advantage into a major disadvantage overnight. So, perhaps it’s no surprise that of all the altcoins toying around with an idea of Lightning Network, Litecoin is the closest in terms of progress.
In fact, Lightning Labs’ implementation of the Lightning Network which launched on March 15 went live on both Bitcoin’s and Litecoin’s blockchains.
Moreover, back in November 2017 Lightning Labs announced that their initial test of a cross-blockchain atomic swap of tokens was a success. To put it simply, an atomic swap is a way of instantly exchanging one token for another between their respective blockchains, essentially bypassing cryptocurrency exchanges. Which blockchains was the initial testing done on? Bitcoin and Litecoin.
If everything goes well, the Litecoin Lightning Network is expected to be launched by the Q3 2018. Undoubtedly it will give Litecoin a major push towards mass-adoption. Charlie Lee, the founder of Litecoin, even went as far as to say that Bitcoin’s transactions will still cost users more than Litecoin’s, even with Lightning Network. We’ll just have to wait and see.
Ethereum and Raiden
The Ethereum network is faring better than Bitcoin in terms of the amount of transactions per second it’s able to process. It’s maximum capacity stands at around 20 transactions per second, which is nearly three times more than that of Bitcoin.
However, by its nature, Ethereum’s blockchain is way busier than Bitcoin’s as it not only works as a payment system, but also enables decentralized applications and initial coin offerings (ICOs). The vast majority of ICOs take place on Ethereum, which brings sudden floods of traffic as token sales take place, slowing down the entire network.
So, it only seems natural that such Ethereum will require a scaling solution that is fine-tuned to its needs. Ethereum actually has several different solutions in the works, but one is particularly noteworthy: Raiden.
The concept of Raiden is very similar to that of the Lightning Network: it provides an extra layer outside of the main blockchain where users can create two-way channels to conduct instant, nearly free and safe transactions.
One major difference between the two is that Raiden is ERC20 compatible, which means that every single token issued on Ethereum – and there are hundreds of them – will work with Raiden.
Currently there’s no concrete date set for the mainstream rollout. Raiden was launched on Ethereum’s testnet in September 2017, after which the team behind it held an ICO and raised around $50 mln for further development.
But, in December 2017 a lighter version of the protocol called µRaiden (pronounced “Micro Raiden”) was deployed on the Ethereum mainnet. Essentially, it does the same thing by facilitating instant, trustless – meaning you don’t have to trust or even know the other person – and free transactions.
The difference here is that the main Raiden protocol administers a network of two-way channels, while µRaiden allows someone to open a payment channel that is able to transfer tokens in one direction only. Those are extremely useful for micropayments, like paying for a cup of coffee.
ZCash and BOLT
Lightning Network will make transactions on all-transparent blockchains like Bitcoin a little bit more private, as all the micropayments made via its two-way channels don’t need to be broadcasted to the entire network. Still, the channel’s opening and closure will leave records of both participating parties as well as the initial and final splits of funds.
ZCash is a cryptocurrency network aimed at providing its customers with enhanced privacy and anonymity, so in order to scale their blockchain they had to develop their own solution. ZCash’s proposed extra layer is called ‘BOLT’ and is fully inspired by the Lightning Network.
What BOLT will do differently from the Lightning Network is that it aims to make the transitions performed within a channel unlinkable. It will be able to do so by utilizing two classic cryptography techniques: commitments – which will hide the value of the payment, and signatures – which will allow users to sign for transactions without revealing what exactly is being signed.
Ian Miers and Matthew Green, the two researches behind BOLT, claim that their creation will be able to work on top of any other cryptocurrency, provided it supports the required cryptography primitives. It will be able to work on top of Bitcoin right now, but with certain adjustments. Still, Miers said that it works a lot better on top of an anonymous cryptocurrency like ZCash.
Miers and Green are planning to release a prototype in the near future, but actually incorporating it into a cryptocurrency will take a more time.
Ripple and Lightning Network
The thing with Ripple is, it doesn’t actually need an extra layer to scale, as it was designed to handle a lot of transactions in the first place. According to the project’s website, it already consistently handles 1,500 transactions per second and it can be scaled to match Visa’s throughput.
However, back in August 2017 Ripple along with Bitfury, a full-service blockchain technology company, released a code that integrated Lightning Network into Interledger. Interledger is Ripple’s protocol developed to enable transactions between different blockchains.
Evidently, Ripple isn’t interested in Lightning as a way of extending the network’s capability. Instead, the project adopted it to make use of it’s atomic swap technology and make another step towards compatibility of different cryptocurrencies.
This is an extremely exciting development, as Interledger was already capable of fascinating transactions between not just public blockchains, but also private ones and, most importantly, traditional payment systems like PayPal.
According to Ripple’s CTO Stefan Thompson, the long term goal for the merger of those two technologies is to enable the crypto community to seamlessly trade between different cryptocurrencies as well as send funds to any given blockchain from PayPal, Alipay, bank accounts and vice versa.
Monero and Lightning Network
Monero is another privacy-oriented cryptocurrency, so implementing the Lightning Network as it is probably not going to fully work for them. However, there are plans of adding a second layer to the network, and the team sees Lightning as their preferred option.
All the infrastructure – including multisignature wallets which were added to Monero in September 2017 – for the Lightning Network to work is already there. However, before it can be implemented, the team will need to make some key improvements to the extra-layer in order to retain as much privacy as possible.
Still, it seems that Monero will mostly be focusing on the Lightning Network’s atomic swaps technology, not its scaling capabilities. Less than a month ago, one of the Monero subreddit moderators mentioned that the network has a dynamic block size, and they’ll scale on-chain ‘just sort of because’.
In the meantime, Riccardo Spagni, one of the project’s creators, has recently said that he is working with Litecoin in an effort to incorporate Lightning Network into Monero and make atomic swaps between the two blockchains possible.
Undoubtedly, this will lead to Monero users being able to swap their tokens for any other cryptocurrency utilizing the Lightning Network in the near future.
NEO and Trinity
NEO is very similar to Ethereum in a sense that it provides a blockchain-as-a-service platform, where users can run decentralized applications, execute smart contracts and hold ICOs. So, in the same way, the platform needed a specialized off-chain scaling solution and in keeping with ‘The Matrix’ theme, it’s called Trinity.
Trinity is still in the works, and to be quite honest, there’s no immediate need for it to be released. As it is, NEO can already process about 1,000 transactions per second, which is significantly more than most other cryptocurrencies, but the team is clearly thinking ahead.
Trinity, Raiden and Lightning Network are extremely similar, if not identical in what they do: taking payments away from the main blockchain and into user-generated channels, which in Trinity’s case are called State Channels.
What’s different between the three solutions is the underlying technology, as they need to be applied to three drastically differently designed blockchains.
Stellar and Lightning Network
Stellar is another network on this list that can already process around 1,000 transactions per second and, according the project’s founder Jed McCaleb it can easily scale to a lot more than that.
Still, just several days after Lightning Labs unveiled their beta of the Lightning Network, Stellar announced that they will be integrating it, becoming one of the first platforms to publicly announce integration.
Even though Stellar might not need to extend it’s capabilities just now, McCaleb outlines three major benefits to integrating the Lightning Network: scalability, privacy and interoperability. He also mentioned that even though Stellar can scale easily, Lightning will take it ‘much, much further’.
Moreover, Bitcoin Core contributor and the leading developer of Stellar’s Lightning Network stated that Lightning is the most important protocol happening in the cryptocurrency space right now and that any platform not preparing off-chain scalability solutions is going to “get left in the payment dust”.