Proposed in a white paper in 2016, the Lightning Network (LN) is a layer-2 solution built on top of Bitcoin. LN was created in response to scalability issues with Bitcoin, namely the speed and cost of Bitcoin transactions.

Bitcoin’s current theoretical maximum transactions per second (TPS) is 10, though in reality it is between 3 and 7. Contrast this with traditional payment processors like VISA, which handled on average 6,000 TPS in 2020 (based on VISA’s claim of 188 billion transactions a year).

Bitcoin’s transaction fees can vary wildly depending on the current demand to use the network. For instance, on April 20th 2021 average transaction fees were in excess of $50, while on August 9th 2021, the average was around $2.50. For large transactions, such as bank transfers or international remittance, Bitcoin’s speed and cost is comparable or superior to alternatives. But if Bitcoin is to be used for everyday payments (so-called micro-transactions, e.g., a cup of coffee, gas), the transaction speed must increase and transaction costs must decrease drastically.

Lightning Network in theory

To understand how LN works, and the current challenges of LN, we need to talk about Bitcoin. The limiting factor of the Bitcoin network is that every transaction must be put in a new block on chain. Since blocks are added to the chain approximately every 10 minutes, there is a hard limit to the number of transactions possible without significantly altering the Bitcoin protocol.

Debates on major reworkings of the Bitcoin protocol have happened before and resulted in 'hard forks,' most notably the creation of Bitcoin Cash. The Lightning Network, rather than creating a new blockchain, is a layer-2 solution. This means that it allows the Bitcoin protocol to remain relatively unchanged, but provides the benefits major reworkings could bring -- in theory, at least.

LN works by setting up a payment channel between two parties, where only the first and last transaction are put on the Bitcoin blockchain. Any number of transactions between the first and last will happen off chain, which means those transactions are not limited by the Bitcoin protocol.

To start a payment channel, both parties must commit an amount of Bitcoin. That Bitcoin is held and cannot be released as long as the payment channel remains open. The total amount of Bitcoin that can be transferred through this channel is the total amount of Bitcoin committed. Let’s look at an example to illustrate this:

Alice and Bob want to form a payment channel with each other. Alice commits 10 BTC and Bob commits 5 BTC into the payment channel. An opening transaction holding Alice and Bob’s combined 15 BTC is put onto the Bitcoin blockchain. Once that transaction has been added to the blockchain, which can take 10 minutes or more, Alice and Bob can transact an unlimited number of times at much faster speeds and effectively zero cost. Below are transactions between Alice and Bob:

  1. Alice sends Bob 1 BTC Alice: 9 BTC Bob: 6 BTC

  2. Alice sends Bob 2 BTC Alice: 7 BTC Bob: 8 BTC

  3. Bob sends Alice 3 BTC Alice: 10 BTC Bob: 5 BTC

  4. Bob sends Alice 1 BTC Alice: 11 BTC Bob: 4 BTC

When one or both wish to close the channel, a closing transaction is sent to the blockchain with the final balances of Alice and Bob. In this case, Alice’s final balance is 11 BTC and Bob’s is 4 BTC.

What if Alice wants to transact with Carol? Well, it so happens that Bob has a payment channel with Carol, so Alice transacts with Bob, and Bob passes the transaction on to Carol. Note that in this scenario, Bob might take a small payment for passing on the transaction. Over time, by the theory of six degrees of separation, LN allows Alice to transact with anyone else.

Lightning Network in practice

LN is a new protocol still in the testing phase. As such, it is faced with many challenges ranging from usability to security.

There are concerns about how easy it is to run a LN node. For LN to be successful, it requires a robust network of Bitcoin nodes running the LN protocol. Running a LN node can be quite difficult and it could be the case that there are payment incentive problems for running smaller nodes. It can be argued that running LN is not too much more difficult than running a full bitcoin node, though. However, since LN is mostly targeted at micro-transactions, the day-to-day experience with LN will be through LN-enabled wallets. LN-enabled wallets are not very user friendly, and most of these wallets caution that since they are still in public testing stages, it is advisable to not deposit too much funds. Unlike some of the more established Bitcoin wallets, the newness of these LN-enabled wallets means there are tradeoffs between custodial and non-custodial versions. The non-custodial LN wallets are a bit difficult to use -- more confusing, less straightforward. The custodial options are easier to use, but you must rely on a third-party with your Bitcoin.

Lastly, and most worryingly, LN has been faced with a number of vulnerabilities. These include:

  • Griefing attacks: Funds aren’t lost, but it causes the victim's Lightning funds to be frozen so that the payment channel cannot process any transactions.

  • Flood and loot: An attacker forces many victims to claim their funds from the blockchain at the same time (flood). The attacker uses this congestion to steal funds that were unable to be claimed before the deadline (loot).

  • Time-dilation attacks: An attacker lengthens the time a victim becomes aware of new blocks by delaying block delivery.

  • Pinning attacks: An attacker tricks a victim into closing their LN channel improperly and steals individual transactions.