Analyses
22
Jun
lightning network

This website has affiliate links. We may receive compensation if you visit partners we recommend. Read more about our advertising principles from the About Us page.

What is the Lightning Network? | Beginner’s Guide

What is the Lightning Network? It is a solution to Bitcoin’s scalability issues. Lightning Network enables real-time transactions with close to zero fees. This article is the Lightning Network beginner’s guide. You’ll learn about the technology and how to use it in practice.

The history of the Lightning Network

The Lightning Network is actually an old concept. It can be traced all the way to 2009 when the first versions of the Bitcoin codebase were released. Satoshi Nakamoto was the first to write about payment channels over ten years ago!

This idea of payment channels was developed further between 2011 and 2015. Different developers and tech companies participated in the process. However, no final consensus was reached.

You can read more of the history of the payment channels from this article.

The concept of the Lightning Network was born in 2015. Tadge Dryja and Joseph Poon published a white paper titled The Bitcoin Lightning Network: Scalable Off-Chain Instant Payments.

This white paper presented an idea called the Poon-Dryja payment channel. It made it possible to create a payment channel, which can be updated endless times in both directions. Hashed Timelock Contracts (HTLCs) are also an integral part of the Lightning Network.

At the same time, the discussion of Bitcoin’s scalability issues exploded. There were two major scaling conferences held in late 2015.  Poon and Dryja presented their ideas at these conferences and received strong support from the Bitcoin community.

Different implementations

The Lightning Network is an open-source concept, just like Bitcoin. Hence, different entities have developed their own versions of the Lightning Network. ACINQ, Blockstream, and Lightning Labs have been the most important developers. They have co-operated during the process and developed LN specifications together.

Blockstream started to develop its implementation already in 2015. It’s called c-lightning because of the programming language C it was created with. Bitfinex is a popular cryptocurrency exchange, which has adopted Blockstream’s c-lightning.

Lightning Labs is a tech company founded in 2016. It was built by previously mentioned Tadge Dryja & Joseph Poon together with Elizabeth Stark and Olaoluwa Osuntokuni.

elizabeth stark
Elizabeth Stark, the CEO of Lightning Labs

Many feel that Elizabeth Stark has given the face to the Lightning Network technology. She has been an active speaker in many conferences in the past years. Stark is currently the CEO of Lightning Labs. She’s also active on Twitter with the handle @starkness.

You can learn more about different LN implementations from this article.

The Lightning Network required also changes to the Bitcoin program code (Bitcoin Core). The most important one was SegWit (Segregated Witness) in August 2017.

The SegWit soft fork was also the reason why the Bitcoin community split in half and Bitcoin Cash was created. This was all due to the scaling debate, which had been going on for years. Bitcoin Cash hard-forked a couple of weeks before the SegWit soft fork was activated.

The development in recent years

The Lightning Network transformed from theory to practice in late 2017 and early 2018. An important milestone was reached on the 28th of December 2017. This is when Alex Bosworth (a developer at Lightning Labs) successfully paid his phone bill using the Lightning Network.

Blockstream and Lightning Labs published their first versions of the Lightning Network in early 2018. This made it possible for others to join the network and start testing it. The Lightning Network is a network of nodes running the required software, just like Bitcoin.

Lightning Labs published a beta version of their LN implementation in March of 2018, which was a major step. The company also raised 2.5 million dollars of additional funding at the time. One of the investors was Twitter’s CEO Jack Dorsey, who is a big fan of Bitcoin and the Lightning Network.

The Lightning Network has grown steadily in the past few years. You can view up-to-date statistics of the network at 1ml.com/statistics/ and bitcoinvisuals.com/lightning/.

The number of nodes has 10-folded to 12,000 between 2018 and 2021. There are currently about 45,000 payment channels. This number has doubled in two years. There are more than 55 million USD worth of bitcoins locked in the network (as of June 2021).

Layer 2 explained

The scalability debate of Bitcoin is the reason the Lightning Network exists. Bitcoin is over 10 years old as a technology, and the transaction capacity is very limited. Roughly speaking, there are two ways to scale Bitcoin.

  1. Increase the throughput by increasing the block size. This is the path Bitcoin Cash has chosen.
  2. Increase the throughput by moving small transactions out of the Bitcoin blockchain. This solution is called Layer 2.

Bitcoin is not the only cryptocurrency facing scalability issues. Ethereum’s blockchain has been badly clogged since 2020. This has been solved by moving the heaviest applications to a different blockchain (sidechain). Polygon is a very popular solution.

This is how the Layer 2 architecture looks like. (source)

the lightning network

The Lightning Network is only one of the protocols added on the “top” of the Bitcoin blockchain. This is Layer 2, while Bitcoin blockchain is Layer 1. The third layer is all about software and API for the end-users, such as trading programs and wallets.

The Lightning Network is an alternative network for small transactions (a.k.a micropayments). In theory, one can also make large transactions as well. That just requires higher throughput from the payment channels. The benefits of the LN are seen in situations where payments need fast confirmations. For example, when you are purchasing a cup of coffee.

LN enables transactions between two entities without making ledger entries to the Bitcoin blockchain. Bitcoin has an average block time of 10 minutes and throughput of 7 transactions per second. It doesn’t make sense to use such a network for small purchases. Fees are also too high for that.

When transactions are moved out of the Bitcoin blockchain, this 10-minute restriction is removed as well. Transactions sent in the Lightning Network are done practically in real-time with close to zero fees.

The Lightning Network technology

One cannot fully understand how the Lightning Network works before understanding Bitcoin. If you need to take a quick recap of Bitcoin’s technology, check our beginner’s guide to Bitcoin before proceeding.

The Bitcoin network consists of tens of thousands of computers, which are called nodes. They run the Bitcoin software called Bitcoin Core. Anyone can set up a node and become part of the network at any time.

The Lightning Network is also a network of nodes. They run the Lightning Network software. This is also a permissionless network. A Lightning Network node operator can also set a price for the incoming transaction traffic.

lightning network
Nodes of the Lightning Network in Europe. Source: https://explorer.acinq.co

Each Lightning Network node has a Lightning wallet, to which the operator has to make a Bitcoin deposit. Then it’s possible to open payment channels by staking x number of bitcoins per channel. The Lightning Network is not yet suitable for making large payments. If you tried to send 100 bitcoins through LN, there wouldn’t be big enough channels available.

The Lightning Network differs also from how the internet works. When you connect to a web server, your request is being forwarded one step at a time towards the final destination.

The Lightning Network is using technologies called source routing and onion routing. When a Lightning transaction is sent, the optimal route is calculated based on the current network status. Next, the protocol wraps the route map with encrypted layers. Opening this route map is like peeling an onion. Hence, the name onion routing.

When the Lightning transaction travels in the network, each node sees only the top layer of the route map. The rest of the is encrypted and hidden.

Andreas Antonopoulos has tweeted about this fact. Nobody knows how many transactions there are in the Lightning Network, and that’s great! Check also the link in his tweet.

Payment channels

The Lightning Network is all about payment channels, which were mentioned earlier in this article. LN also adds smart contracts to the mix. They are being used to keep track of the balance of each Lightning Network operator.

The video below explains Lightning Network transactions in a simple fashion.

Since the Lightning Network has thousands of nodes already, there are so many more channels than just one or two.

The network is always taking advantage of existing channels. When a new node joins the Lightning Network, the owner can choose which nodes it opens channels with. Each node adds more channels and increases the capacity of the network.

There is one big misconception here, we should clear. If you buy a cup of coffee using Lightning payments, you are not opening a channel between yourself and the coffee shop.

In practice, your wallet software and the coffee shop’s wallet software are both in the Lightning Network and connected already. Every single LN user is not a node. Just like most users are not nodes in the Bitcoin network either.

Using the Lightning Network

Now you should understand how the Lightning Network works. Next, we show you how to use it in practice. Do you have to open and close payment channels or set up a node? No, that’s not needed. Using a Lightning wallet is as easy as using a standard Bitcoin wallet.

This is how it works.

  1. Download a Lightning mobile wallet
  2. Send bitcoins to your Lightning wallet
  3. Use the Lightning Network as much as you want
  4. Move funds back to the Bitcoin blockchain

First, you need a wallet suitable for transacting in the Lightning Network. Wallet of Satoshi and Bluewallet are popular choices. Both are easy to use and available for both iOS and Android users.

bluewallet

Next, you need to fill your Lightning wallet.

Open the BlueWallet app and create a new Bitcoin wallet. Next, make a standard Bitcoin transaction to it from your existing wallet. Once you have bitcoins, create a new Lightning wallet and use the refill to move your bitcoins to the Lightning wallet.

The Wallet of Satoshi has also a separate Bitcoin and Lightning wallet. When you send bitcoins to your WoS Bitcoin wallet, they are automatically converted to satoshi in your Lightning wallet. No extra conversion is needed.

Sending satoshi in the Lightning Network differs a bit from sending bitcoins in the Bitcoin network. In the LN, the receiver must always create an invoice for a specific amount. The wallet software then generates a QR code and a Lightning address for it.

lightning networ invoice

As you can see, an address of a Lightning invoice is a long string of numbers and characters.

So, there is a fundamental difference between LN and Bitcoin transactions. You can go to Blockchain.com explorer, view transactions of any block, and pick a random Bitcoin address. Then, you can send that address some bitcoins.

This is not possible in the Lightning Network. You can only send satoshi to an invoice, which is first generated by the receiver.

Check the video below for using BlueWallet.

As you have noticed, the unit of the LN is satoshi, not bitcoin. This is because the Lightning Network is mainly used for small transactions. It’s easier to express small values with satoshi. For example, 150 sat is more pleasant to read than 0.0000015 BTC.

One satoshi is one hundred millionth of a bitcoin (0.00000001 BTC). Other networks use similar units too. For example, Ethereum has gwei for expressing very small values.

Making transactions in the Lightning Network is easy. When you want to receive a payment, your wallet generates an invoice with a couple of clicks. You can then share the invoice address or QR code. Transactions are done in a couple of seconds with close to zero fees.

The only difficult phase is returning back to the Bitcoin blockchain. If you want to move your satoshi from the Lightning wallet you need a third-party exchange for that. BlueWallet is recommending zigzag.io. Another popular service is Coinplaza. You’ll find user guides from Youtube.

The criticism of the Lightning Network

The Lightning Network is here to stay, there is no doubt about that. It was quite different 2-3 years ago, but the network capacity has increased rapidly. It’s also a fact that LN works! Transactions really are lightning-fast. Still, there is room for criticism.

The Lightning Network is nothing truly remarkable in the big picture. The XRP Ledger and Stellar Lumens have been moving tokens as fast for several years. Many 3rd generation platforms can also process lightning-fast transactions with close to zero fees.

What makes LN unique is the distributed nature of the network and Bitcoin’s security as its backbone. Other scalable platforms are more or less centralized and use a Proof of Stake consensus, where the network is validated by its richest individuals.

On the other hand, there are also critics saying that this could happen to Lightning Network as well. Big operators could dominate the network by staking the most bitcoins to their payment channels.

Check the video below for useful information on the Lightning Network and its limitations. It features Tadge Dryja, who was previously mentioned in the history section.

Then there is the bridge between Bitcoin and the Lightning Network.

You can only enjoy the benefits of LN if your wallet is filled with satoshi. If you walk to a coffee shop with an empty Lightning wallet, you’d have to wait for anything from minutes to an hour to fill it with bitcoins first.

Moving your coins back to the Bitcoin network is not easy enough either. Third-party services are currently needed.

The Lightning Network isn’t a perfect solution. It has its weaknesses, just like any other technology has. However, the potential is there to see already. It’s very easy to use a Lightning wallet for transactions, which are truly done in a matter of seconds.

In the end, we’ll always go back to the question of scaling the network. Is it possible to have a scalable Layer 1? This is a question many platforms will struggle with in the future. Ethereum is a good example of a platform, which has also moved to Layer 2 solutions.

Jack Mallers, Strike, and El Salvador

The Lightning Network has made the headlines in 2021 all over the world. All thanks to Jack Mallers and Strike. This is a money-transfer service using the Lightning Network. It enables free transactions all over the world with fiat currencies as well!

Check out this video. Jack Maller is creating a payment contract, which converts dollars from the U.S. to the euro and sends automated transactions every five seconds. Would you like to get your salary every five seconds instead of once a month? Now it’s possible!

Jack Mallers and Strike became really famous in June 2021. This is when El Salvador announced that the country would make Bitcoin a legal tender. Mallers had brought Strike to El Salvador earlier to tackle remittance issues. This inspired the president of the country and the rest is history.

Lightning Network could make a big impact on the remittance market. Up to 20% of El Salvador’s GDP comes from money transfers. Workers in the U.S. are sending dollars back to their families in El Salvador. Global remittance giants can charge tens of percentages in fees from every transaction.

El Salvador will also make Bitcoin a legal tender. This means the Bitcoin Standard is truly enabled in the country. When all goods and services are priced in bitcoins, you can ditch the dollar entirely. The Lightning Network enables all day-to-day transactions.

We also recommend checking this video by Andreas Antonopoulos.

Photo by Pixabay from Pexels, Photo by NASA on Unsplash, Flickr / PICNIC Network