An ingenious Solution

The lightning network is an ingenious solution to some of the problems with bitcoin. It allows for fees orders of magnitude less than what they would be for on-chain transactions. Also, since lightning transactions are not recorded on the Blockchain, they are also more private than traditional on-chain bitcoin transactions. This blog post will give a high-level view on how the lightning network works.

A Real Life Example

In order to highlight how the lightning network works, let’s view it through the lens of a hypothetical relationship between a tenant and landlord. Let’s say the monthly rent for the tenant is 1 bitcoin. In the scenario where on-chain transactions are used, the tenant would send the landlord 12 separate transactions for 1 bitcoin throughout the year and pay 12 transaction fees for this service.

When using the lightning network, it works a little differently. In this scenario, the tenant and landlord open a multi-signature wallet with each of them holding one of the two private keys. Nothing can happen in this channel without the two of them agreeing on it. Every month, the tenant would send 1btc to the landlord slowly draining the tenants account. At the end of the year, the tenant would have 0 bitcoin and the landlord would have 12 bitcoin. They can now agree to close the channel and this closing would be recorded on the Blockchain as an on-chain transaction. In using the lightning network, there were only two transaction fees paid compared to 12 fees paid in the other scenario. The tenant and landlord also enjoyed more privacy because to prying eyes there was only two transactions to read on the Blockchain.

A Real Life Example

Lightning channels are not limited to these one-sided ‘subscription’ based transactions described above. For example, two friends that often find themselves owing each other money can open a channel with each friend contributing 1btc. They can trade these 2btc back and forth with each other as many times as they want. When they are done transacting, they can close the channel. Furthermore, two entities that are not directly connected can transact as long as they are connected via intermediaries. Each intermediary used gets a small fee in exchange for ‘routing the transaction.’

Today, the lightning network is a robust, thriving network of nodes and channels. Some ‘nodes’ with higher amounts of bitcoin tend to make more connections, or channels, than others and tend to have more transactions route through them. Anyone on the network can transact with anyone else on the network because they are connected in one way or another. Here is a live visualization of the lightning network.