Back

What is the Lightning Network, and how does it work?

The Lightning Network has quickly established itself as the go-to scaling solution for Bitcoin. With it, you’ll be able to send your Sats all around the world within a matter of seconds.

In this blog post, we’ll introduce you to the Lightning Network, how it works, what you need to know, and how it could be a big driving force in global Bitcoin adoption.

What Is the Lightning Network? 

The Lightning Network is a layer 2 Bitcoin scaling solution that enables microtransactions at a lower cost and much faster speeds compared to regular on-chain transactions. 

The network is a channel-based solution that uses the Bitcoin blockchain as the main layer and opens or closes channels to it to settle the Lightning transactions off-chain. This facilitates the use of Bitcoin for everyday scenarios, whether to pay for coffee or send money across the globe with Satoshis, the smallest unit in Bitcoin. 

The channel-based setup allows users to participate in the network by running a Lightning node, offering public and private channels to interact with. A payment is routed through this network of different channels and pathways, either in the fastest way possible or by fulfilling specific rules, for example, not costing more than a certain amount or doing a certain amount of hops in the network. 

In theory, the Lightning Network can settle millions of transactions per second, leaving competitors like Visa or MasterCard miles behind. This output allows Bitcoin users to plug their store of value into a highly efficient payment network and thus start a new Bitcoin economy, in which different use cases are solved on different layes or levels. 

The Lightning Network was born out of necessity as the Bitcoin blockchain is not a great tool for mass scaling with its 10-minute block time. Additionally, because of its monetary policy, transaction costs will increase in the future, making on-chain transactions too expensive for everyday situations. 

There had to be an alternative, and in 2016, the Lightning whitepaper was released. Lightning is fixing the problem, by taking a big load off the main network and allowing for more customizability because of its smart contracting capabilities. 
The Bitcoin sent through the Lightning Network doesn’t differ from those sent on-chain. There is no need for a pegging mechanism, as it is used in the Liquid Network, or a stabilization mechanism similar to other scaling solutions. Users in the Lightning Network send and engage with Bitcoin only.

How Does the Lightning Network Work?

Like the Internet, built on the TCP/IP stack, the Lightning Network uses the Bitcoin blockchain as its foundation and runs as a channel-based scaling solution. 

To use the Lightning Network, a user locks his Bitcoin in channels to engage. They first need to send a commitment transaction, a regular on-chain Bitcoin transaction that opens the Lightning channel, and from there on out, they can connect to other peers in the network and create dedicated payment channels. Additionally, the sender creates a single input representing the channel point or the transaction ID of the channel.

The final channel creation step is using Hashed Timelock Contracts (HTLCs). These are smart contracts with timeframes and the backbone of the Lightning Network. They create the connections between Lightning channels and ensure no one breaks the rules. These HTCLs are hashed contracts in a two-out-of-two multisig. 

This means that for someone to be able to send a payment through the network, they have to engage with other peers and lock in their Bitcoin through an HTLC. Because the Lighting Network utilizes the onion routing technology, payments engage with multiple HTLCs simultaneously. Therefore, different layers emerge, and different payment routes are possible. 

However, the routes are only one side of the story. The other story is the liquidity in these channels as well as the overall inbound liquidity one node runner has to manage. Because both peers have to engage with each other, they also have to be careful that the amount of Bitcoin in that channel is equally balanced. Otherwise, forced closures of the channels may occur, resulting in the loss of the Bitcoin.

Each time funds are routed through different nodes and peers in the network, the software ensures that all contacts are valid, instantly checking and validating HTLCs. The payment goes through once the network finds a safe way to settle the transaction. 

How users pay each other in the Lightning Network differs from regular Bitcoin transactions. There is also the possibility of having a public address to reuse. However, the genius behind HTLCs is that you can also time your receive requests in the form of invoices. The receiver can request the amount at the invoice’s creation and add that information to the QR code or invoice text. As soon as the sender scans it, they’ll apply the correct amount and pay it instantly. 

The Lightning Network is growing daily, and new solutions are emerging. One of these solutions is the implementation of various Lightning Service Providers (LSPs) or wallets that offer to run the infrastructure on behalf of their users. This makes access to the scaling solution easier and allows users with different knowledge states to use the network and instantly send Satoshi around the world.

How Does the Lightning Network Help Scale Bitcoin?

The Lightning Network is a big driver in Bitcoin adoption and the evolution of the ecosystem as a whole. It’s much faster than regular Bitcoin transactions by settling transactions instantly and costing a fraction of what the regular transaction would cost. 

It also makes Bitcoin more spendable by pricing goods or services in Satoshis. The smallest unit in the Bitcoin allows to divide such goods by a factor of 1:100’000’000, as there are 100 million Satoshis in one Bitcoin, making it much more dividable than regular fiat currencies, potentially allowing further divisibility into micro units. 

However, the most significant driving factor for Lightning and how it will help scale Bitcoin is the possibility of less fortunate economies or countries participating in the network. While access for most in the Western world is easy, it can be a hassle for the global south. They often lack the financial resources to integrate their outdated banking systems into modern technology. 

Lightning fixes this by allowing both ends to participate in the same network. Also, there is the added benefit of Lightning’s programmability. Some companies and projects are already doing autoconversion with their wallets or services. This means that users in the Global South will be able to participate in the global financial system and, for the first time in history, break free from the financial cuffs that were put in place beforehand.

FAQs

How Much Do Lightning Network Transactions Cost?

While there is no definite answer, the transaction costs vary based on network traffic and the routing costs of the nodes themselves. Having said that, most people typically pay a few cents per transaction, significantly lower than on-chain transactions. They also only have to engage twice with the Bitcoin blockchain, when opening and closing channels.

How Fast Is the Lightning Network?

In theory, the Lightning Network has the capability to send 1,000,000 transactions per second (TPS) and settle all of them instantly. By comparison, Bitcoin can process about 7 TPS, while Visa can process tens of thousands.

How Does a Lightning Wallet Work?

A Lightning wallet works similarly to a Bitcoin wallet. There is also a send and receive function, and you often have the opportunity to swap between on-chain Bitcoin and Satoshis in the Lightning Network. 

Where they differentiate each other is on the receiving site. Lightning invoices often have a timeframe attached to them, and the invoices always start with “lnbc” followed by a long string of information and numbers.

What Are Lightning Payments? 

Lightning payments are transactions that occur in the Lightning Network. They differentiate themselves from regular Bitcoin payments, as they don’t take place on the main Bitcoin blockchain but rather off-chain in the Lightning Network. 

Who Controls the Lightning Network? 

There is no single entity or foundation that controls the Lightning Network. A few companies and different implementations allow developers to get started, but just like Bitcoin, there are also several open-source services for developers to get started.

Information about the author

Joël Kai Lenz

Joël Kai Lenz

Joël has a background in the media world and uses this experience to create content online in all shapes and forms. If he's not writing or producing content, he shares his thoughts on X or enjoys a delicious coffee. Follow Joël on X.

Related
stories

Please select your preferred language

Relai Weekly Bitcoin News