Understanding the Lightning Network - Bitfinex blog
post-template-default,single,single-post,postid-18090,single-format-standard,bridge-core-3.0.6,et_bloom,qode-page-transition-enabled,ajax_fade,page_not_loaded,,qode-title-hidden,qode_grid_1300,footer_responsive_adv,qode-content-sidebar-responsive,qode-child-theme-ver-1.0.0,qode-theme-ver-29.3,qode-theme-bridge,qode_header_in_grid,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

Understanding the Lightning Network

The Lightning Network (LN) has been getting the public attention due to the many publications it’s been receiving lately. A new Lightning Torch movement just initiated recently. This time though, the public seems to be more drawn to the news related to its adoption and updates that would resolve the network’s drawbacks, as told by some people. 

In the previous Lightning Series post, we mentioned the considerable effort made by the Lightning Network community to develop the technology. 

Read more: The Lightning Network journey: An overview

Still, as a new technology, LN can be quite challenging to understand, especially by those without a technical background. We created this piece of content to help people get familiar with LN, the terms used, its features, as well as how to use the Lightning Network. Hopefully, it will also encourage them to explore the technology further and get the most benefit out of it.

First, we need to understand Bitcoin’s blockchain technical challenges that have inspired the creation of LN. The Bitcoin blockchain’s block size is variable; on average, it’s around 1.2 Megabyte. With an average creation time of 10 minutes for each block, the number of transactions the network can process is between 3.3 and 7 transactions per second. 

As more people use Bitcoin, which is expected, the number of transactions also goes up. The limited block size – 1.2 Megabyte – is claimed to have become “congested”, which results in a high fee to include and process a transaction inside the block. 

These limitations, namely the low number of transactions per second and the high fee are what the public refers to as Bitcoin’s scaling issues. They are believed to be the stumbling blocks for Bitcoin to see the expected mass adoption and significant hurdles for the largest crypto to become a universal and widely used currency.

The Lightning Network: Resolving Bitcoin’s Technical Limitations on Scalability 

LN offers a solution to the Bitcoin blockchain technical limitations. The nascent technology works on a second layer to process transactions, without involving the Bitcoin blockchain and use it only for the initial creation and final funds settlement. 

By moving the transactions away from the main blockchain, LN will decongest the Bitcoin network. As a result, the transaction processing fee will become lower than Bitcoin on-chain transaction fee. 

In more details, here is what LN has to offer: 

  • Instant transactions

Since the transaction happens on the Lightning Network and not on the Bitcoin blockchain or off-chain in short, it doesn’t have to wait for block confirmation. As a result, all transactions can happen almost instantaneously.

  • Low fees

Another benefit of having the transactions done off-chain is that it doesn’t have to compete with other transactions to succeed, thus keeping the fees very low.

  • Scalability

Without block size limitation, more transactions are possible. The Lightning Network capacity to process transactions can reach nearly unlimited. 

  • Cross-chain transaction 

Called the Atomic Swap, the feature has been tested and successfully performed for two different blockchains that share the same cryptographic hash function. That means users can transact with different cryptocurrencies on the Lightning Network, without having a 3rd party intermediary. The feature is under continuous development, so more capabilities can be expected in the future. 

How does the Lightning Network Work?

Here’s an illustration to better understand how the Lightning Network works:

Annie and John are good friends, and they’re looking for a fast and cheap way to send Bitcoin between them, so they decided to give LN a try. As first-time users, they have to: 

  • Create a multi-signature (multi-sig) wallet 

To create one, both parties must provide their public addresses and private keys. The wallet can then be accessed by both parties using their respective private keys. 

  • Deposit a certain amount of Bitcoin to the multi-sig wallet 

The Funding Transaction can be done by both or just one of the involving parties. In this illustration, Annie deposits 0.01 BTC into the wallet and John 0.05 BTC. 

After the multi-sig wallet setup is done, both Annie and John’s lightning nodes can start sending funds to each other. Transactions made on the Lightning channel are called Commitment Transactions. The total amount of Commitment Transactions can’t exceed the amount of the deposit, which in this case, 0.01 BTC for Annie, and 0.05 BTC for John. 

The channel can remain open for as long as Annie and John want. The Commitment Transactions will not affect their actual Bitcoin balances, until the channel is closed, which will trigger the Settlement Transaction and the incurrence of the transactions fee. When a Settlement Transaction takes place, the amount of Bitcoin owned by each involving nodes on the Lightning Network wallet will be “synced” with the balance recorded on the Bitcoin mainnet. 

Let’s say, Annie wants to send 0.001 BTC to Ryan. She doesn’t have an open channel with him, but John has. If the channel between Annie and John still opens, she can send the fund to Ryan, without having to open a multi-sig wallet with him first. Annie’s Lightning node can route the payment to Ryan through John’s node. But if Annie-John’s Lightning channel is already closed, the node will find another route to send the fund to Ryan through any existing connections. Annie is required to open a multi-sig wallet and go through the above steps all over again with Ryan only when there are no possible connections between them. 

The Bitcoin Lightning Network Adoption and Use Cases

The first commercial use of LN presumably happened on December 27th, 2017. It was when Alex Bosworth, a developer, paid his cell phone with Bitcoin using Bitrefill, a platform that allows people to purchase various products and services, such as gift cards and prepaid mobile refills using crypto.

Ever since more use cases have been discovered and reported as more businesses adopt the Lightning Network as a payment option. Users can use LN for online gaming and gambling, shopping online for various items, from pizza, smoothies, to t-shirts, purchasing tech products and services, such as domain register/hosting and cold wallet.

In the crypto trading business, Bitfinex is the first major exchange to integrate LN. The development process was challenging, yet full of excitement and resulted in a successful Lightning Network integration on Bitfinex platform. 

Read more: The challenge of integrating the Lightning Network

Users are now able to withdraw and deposit Bitcoin to their account easily by connecting to Bitfinex’s Lightning node; more capabilities are on the way. 

So, what’s the catch?

Being a new technology, LN without question still needs more time and effort to reach its full potential. The good news is, it has a community that’s actively working on building the technology. As a result, at a very young age, the network has already gone through major developments and seen significant improvements. 

Different Lightning Network Protocol Implementations for the Tech-savvy

To users with technical capabilities, there are multiple Lightning Network protocol implementations according to the programming languages used to choose from. Here are some of them:

  • C-Lightning is developed in C by Blockstream.
  • Lightning Network Daemon (LND) is developed in Golang by Lightning Labs.
  • Éclair is developed in Scala by ACINQ. 

Although LN was initially proposed to surmount Bitcoin’s scaling problems, the technology itself applies to other cryptocurrencies, particularly those that support multi-sig wallet and smart contracts. Following its predecessor, the Litecoin Lightning Network was launched in April 2018. Meanwhile, Stellar quietly started their own version of the Lightning Torch movement in June 2019. 

The Lightning Network status is always under rigorous development, which is why the crypto community can expect more features and capabilities in the future. With the Lightning Network support, it may well be just a matter of time before we see Bitcoin as the ultimate P2P payment system as Satoshi Nakamoto envisioned back in 2008.