What Is the Lightning Network?

6 min read

Bitcoin Scalability

Bitcoin’s blockchain can only process an average of 7 transactions per second. This is not enough to make Bitcoin a suitable platform for handling the millions of transactions humans make every day. Thus, if Bitcoin is to become a medium of exchange, payment systems must be built which allow users to transact bitcoin quickly and cheaply. The Lightning Network is one such payment system.

Bitcoin itself cannot scale to have every single financial transaction in the world be broadcast to everyone and included in the block chain. There needs to be a secondary level of payment systems which is lighter weight and more efficient.

Hal Finney describing the need for layered scaling solutions, BitcoinTalk Forum

What Is the Lightning Network?

The Lightning Network is a second-layer protocol designed to enable off-chain Bitcoin transactions, which are not recorded on the blockchain. Because they are not recorded on the blockchain, and thus require no mining, Lightning payments are extremely fast and cheap.

River Financial uses the Lightning Network to enable users to instantly deposit or withdraw. (Youtube)

How Does the Lightning Network Work?

Similar to the Bitcoin network, the Lightning network is made up of nodes running the Lightning Network software. Unlike the Bitcoin network however, Lightning transactions are not publicly broadcast and stored by all members of the network. Instead, individual Lightning nodes transact with one another privately. Lightning nodes use channels to execute such payments.

What Is a Lightning Payment Channel?

A Lightning channel is a bidirectional payment channel, meaning both parties can send and receive payments across the channel. Lightning channels comprise the Lightning Network and have a defined bitcoin capacity. This capacity is split between the two parties to the channel, and bitcoin is moved from one side of the channel to the other by Lightning transactions.

Opening a Lightning Channel

Two parties open a Lightning channel by depositing bitcoin in a 2-of-2 multisig address. This transaction is recorded on the Bitcoin blockchain, and when this transaction is confirmed, the Lightning channel is opened. Once open, a Lightning channel enables both parties to execute any number of transactions cheaply and instantly. When the two parties are done transacting, they can close the channel with another on-chain Bitcoin transaction, which will reflect the net change in both of their balances.

Transacting Over a Lightning Channel

A payment channel is a pool of funds divided between two parties. These funds are always stored in the multisig address—there is no extra token or representation of the bitcoin created by the Lightning Network. Lightning transactions occur over this channel by redistributing the funds stored in the multisig address. Whenever bitcoin is spent through the channel—from party A to party B—the channel’s balance updates. However, these updates are not recorded on the blockchain.

In the example below, Alice and Bob open up a channel and deposit 1 BTC each in a multisig address. Then Bob pays Alice 0.5 BTC on the Lightning Network. The shared balance is still 2 BTC, but 1.5 BTC belong to Alice, and 0.5 to Bob.

A Lightning Channel allows users to transact off of the Bitcoin blockchain.

Closing a Lightning Channel

The settlement of the funds will occur when both parties decide to close the channel. When the channel closes, an on-chain transaction will be recorded on Bitcoin’s blockchain, spending bitcoin from the multisig address. When this happens, the balance in the channel is settled. Alice will now have 1.5 BTC and Bob will now have 0.5 BTC.

Routing Payments Over Lightning

The fundamental building blocks of the Lightning Network are nodes and payment channels that allow nodes to communicate with one another. Naturally, not every node will be connected to the node that it wants to send a payment to. Routing is what allows transactions between two unconnected parties to occur through a series of pre-existing channels.

How Does Lightning Routing Work?

Imagine that Alice wants to pay Carol over the Lightning Network, but does not have a direct channel with Carol. However, both Alice and Carol have channels with Bob. A cryptographic process allows Alice to send a payment to Bob with the assurance that Bob will forward the payment to Carol. In exchange for his assistance, Bob will receive a small fee.

Routing is enabled by Hashed Time Locked Contracts (HTLCs). An HTLC is a special type of Bitcoin transaction which serves as a smart contract. In the context of the Lightning Network, HTLCs are used to allow Alice to promise payment to Bob only if he can prove that he has paid Carol the proper amount.

Learn more about how Lightning could work in the future.

Accessing the Lightning Network

You can get started using the Lightning Network by setting up a wallet and connecting to the network to send or receive Bitcoin transactions quickly and with lower fees. Here are a few steps to follow:

  • Choose a Lightning-Compatible Wallet: Download and install a Lightning wallet, such as Phoenix, Breez, or BlueWallet, which are user-friendly options. Advanced users can opt for Eclair, Zeus, or running a full Lightning node.
  • Fund Your Wallet: Transfer Bitcoin to your wallet either on-chain or by opening a payment channel by committing a small amount of Bitcoin to the Lightning Network.
  • Open a Payment Channel (optional for advanced users): If you’re running a Lightning node, open a payment channel to a trusted node. This step is often automated in user-friendly wallets.
  • Connect to the Network: Once funded, your wallet will automatically connect to the Lightning Network.
  • Start Transacting: Use the wallet to send or receive payments by scanning a Lightning invoice or providing one for others to pay.

With user-friendly wallets, the process is straightforward and ideal for beginners. For greater control, running a node offers enhanced functionality but requires technical knowledge.

Lightning Network Use Cases

The primary use case for the Lightning Network include gaming, cross-border payments, social media tipping, streaming, and P2P marketplaces. River’s report, “The Lightning Network Grew by 1212% in 2 Years”, provides an in-depth overview of the state of the Lightning Network and how it’s being used.

Who Developed the Lightning Network?

Thaddeus Dryja and Joseph Poon first introduced the Lightning Network in their white paper, ‘The Bitcoin Lightning Network: Scalable Off-Chain Instant Payments’ in 2015.

Different Lightning Implementations

There are multiple Lightning Network node implementations that are used by wallets. Popular ones include Lightning Labs’ Lightning Network Daemon, ACINQ’s Eclair, and Blockstream’s c-lightning.

While these three implementations are written in a different programming language, they are all compatible with one another. All Lightning implementations follow the standards set by the Basis of Lightning Technology (BOLT), a set of rules ensuring that Lightning implementations can achieve consensus and interoperability. Thanks to the BOLT specifications, there is only one Lightning Network protocol.

Lightning on River

As shown in the video above, River supports Lightning deposits and withdrawals. We were among the first Bitcoin businesses to do so in 2019.

River is one of the largest participants in the Lightning Network, and we have shared our insights from working with Lightning publicly in our Lightning report.

Key Takeaways

  • The Lightning Network enables users to transact bitcoin in a near-free and instant manner.
  • The Lightning Network is an example of how Bitcoin can become a global medium of exchange without sacrificing the security or decentralization of the Bitcoin network.
  • While the Lightning Network is fully functional, it is still experimental and should not be used to store or transact large volume.
#
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z