What Is the Lightning Network?

  • 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.

The Lightning Network is a second-layer protocol built on top of the Bitcoin protocol. It enables off-chain transactions which are faster and cheaper, and are a potential improvement on Bitcoin’s scalability. Off-chain transactions refer to transactions which are not added to the Bitcoin blockchain. An arbitrary number of off-chain transactions are later recorded as a single transaction on the blockchain.

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

How Does It Work?

Similar to the Bitcoin network, the Lightning network is made up of nodes running the Lightning Network software. Lightning nodes allow two parties to create a payment channel between them, which is recorded as a transaction on the Bitcoin blockchain. Each participant deposits bitcoin into the channel (a dual-funded channel) or more often, only one participant deposits funds into the channel. This deposit of bitcoin at the start establishes the total amount of bitcoin that will be locked in and able to be used to transact with. In other words, this is the maximum amount of bitcoin that can be sent or received within the channel. The parties can use the channel to perform a near unlimited number of transactions between themselves and the channel can exist as long as it is required.

What Is a Payment Channel?

A payment channel is a payment connection between two parties. The transactions that occur in this channel are the redistribution of funds that are stored in the channel. Whenever bitcoin is spent through the channel—from party A to party B—the channel’s balance updates. For example, Alice and Bob open up a channel and deposit 1 BTC each. Then Bob pays Alice 0.5 BTC on the Lightning Network. Now the shared balance is still 2 BTC, but 1.5 belong to Alice, and 0.5 to Bob.

The settlement of the funds will occur when both parties decide to close the channel. When the channel closes, an on-chain transaction will get recorded on Bitcoin’s blockchain. 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

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. If a node opened a channel everytime it wanted to transact with a node it wasn’t connected to, this would defeat the purpose of having a second-layer on top of the Bitcoin network.

For example, Bob and Alice have an open channel. Bob now wants to pay Carol but he does not have a channel with her. Because of routing, Bob can transact with Carol if Carol has an open channel with Alice.

How Does Routing Work?

The Lightning Network allows its users to route payments. In the scenario where Bob wants to pay Carol, a complex cryptographic process allows Bob to send a payment to Alice. Once she claims this payment, she forwards a separate payment for the same amount to Carol through their payment channel.

Routing is what allows transactions between two unconnected parties to occur through a series of pre-existing channels.

Who Developed It?

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.

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. There is only one Lightning Network protocol.