Scaling Bitcoin with the Lightning Network ⚡

The hottest topic of the Bitcoin 2022 conference in Miami was surely the Lightning Network, but does this second layer scale Bitcoin and how does it work?

source: https://cvj.ch/en/focus/background/bitcoin-lightning-network-records-record-growth/

source: https://cvj.ch/en/focus/background/bitcoin-lightning-network-records-record-growth/

This week will go down in the cryptocurrency history books as one of the worst as we watched a top 10 cryptocurrency project lose 98% of it’s value overnight (yes, we’re looking at you LUNA). This serves as a reminder of the difference between Bitcoin and most other cryptocurrencies - the former probably being the most scarce digital asset ever and the latter possibly just a project doomed to fail.

What is the Lightning Network?

The Lightning Network (LN) is a key development within the Bitcoin ecosystem. Created in 2018, it is one of the most promising features of Bitcoin that could allow it to become a common means of payment. Lightning utilises the underlying blockchain as a means to settle transactions in batches on another layer, without counterparty trust. Lightning aims to overcome some of the pain points in Bitcoin:

  • Fees: Large transactions incur very little fees whereas small transactions are costly

  • Speed: Average of 7 transactions are proceesed per second with a total blocksize of 1 megabyte due to Bitcoin’s distirbuted nature

  • Energy: Transacting Bitcoins requires a lot of computing power

What's a blockchain anyway? 🤔
The term 'blockchain' encompasses all the constituent parts of a technology like Bitcoin: peer-to-peer networking, consensus mechanisms and the actual blockchain itself, also known as hash-linked data structures.

Representation of the blockchain as a chain of linked hashes. Source: https://preferredbynature.org/newsroom/fsc-blockchain-across-board-five-years

Representation of the blockchain as a chain of linked hashes.
Source: https://preferredbynature.org/newsroom/fsc-blockchain-across-board-five-years



The list of all transactions ever made with Bitcoin live on the blockchain which a copy of sits on every connected computer. The format ensures the latest entry references the previous entry, preventing any single computer from maliciously altering an earlier block as this would require changes in each subsequent block and would not be unanimously verified.

How does it work?

I find it easier to understand new concepts by creating an easily digestible story, so let’s take a look at an example of transactions taking place over the LN:

Instead of Pierre making paying a hefty transaction fee by making a transaction on the main Bitcoin network, he can pay minimal fees by using the LN. It allows for many instant payments to occur directly between himself and the boulangerie which are then grouped and added to the main Bitcoin blockchain as single transactions.

Smart Contracts

The LN scales by using smart contracts to create a network of channels by allocating payments through other open channels. For example, Pierre could buy a croissant through Marie if she already has an open channel with Charles, who has an open channel with the boulangerie. This ensures the network operates in a decentralised fashion and removes the need for trust between the parties involved.

This requires the intermediates to have a high enough balance but further helps reduce the load on the blockchain. Ultimately, Pierre won’t have to trust the intermediaries that his croissant payments go through to reach the boulangerie as the protocol will ensure the funds reach the destination or be returned to him. The reason for this is that a receiving payment is dependent on having already forwarded it, thus making it impossible for Marie to be able to steal Pierre’s money. The caveat is that if Marie goes offline, the smart contract mechanism will close the channel and it could be a matter of hours to days for the timelock on the contract to expire and return the money owed to Pierre.

Security

The main Bitcoin blockchain operates under proof-of-work, which ensures it’s securtiy by the economic incentives to operate the protocol. Similarly, the off-chain transactions that take place on the LN layer in parallel enforce fair play through a cryptographic process. If foul play occurs and a party tries to broadcast an older version of the balance sheet in an attempt to close a channel prematurely, other servers will catch this by monitoring the blockchain. This would result in Marie facing a penalty and forfeiting all her funds in the channel to Pierre and so acts as a disincentive to broadcast invalid data.

Participants of the LN will have to monitor the blockchain via software on a ‘watcher’ node to detect any broadcasts of obsolete transactions. Although this could be outsourced to trusted services, this reinforces users to run full nodes on the Bitcoin network, which may even allows them to earn money for contributing.

The Future

The LN has made significant progress with the adoption rate rising steadily as more exchanges onboard it and reduce the fees for their customers. El Salvador was the first country globally to adopt Bitcoin as legal tender in 2021 and Lightning is used widely via mobile apps to transact in Bitcoin using QR codes.

Increase in Bitcoin transacting using the Lightning Network since inception. Source: https://cvj.ch/en/focus/background/bitcoin-lightning-network-records-record-growth/

Increase in Bitcoin transacting using the Lightning Network since inception.
Source: https://cvj.ch/en/focus/background/bitcoin-lightning-network-records-record-growth/

This technology has the potential to disrupt the payments industry by providing merchants with a low fee for handling transactions and could expand to other assets such as stablecoins. Stablecoins that are backed by physical assets are becoming an integral part of the digital currency space. The UK recently gave the green light on incorporating stablecoins as a payment method and put forward adjustments to the existing regulatory framework.

Personally I’m quite excited to see how projects like the Lightning Network will evolve over the next decade and to watch the race between countries eager to be leading the new age of digital currencies.