The Most Advanced Payment System on Earth ⚡

Nakamoto consensus is notorious for being one of the lowest throughput consensus mechanisms a blockchain might implement on paper. Of course, implementing Nakamoto consensus isn’t for no reason: the highly battle tested nature of proof-of-work (PoW) algorithms makes it the most secure candidate on the list. The problem is clear: how does a blockchain maintain the security inherent in PoW while increasing throughput? In 2015, Joseph Poon and Thaddeus Dryja proposed a revolutionary solution and concept in response to the scalability trilemma: an off-chain protocol running on a network of nodes that settles transactions instantly. Impressively, this elegant solution also maintains the trustless and decentralized nature of the Bitcoin and Litecoin blockchains without any compromise on the integrity of the blockchain’s design or principles.

Why does scalability matter?

Scalability is an important topic in blockchain technology, especially as the rate of adoption picks up across the world for a wide variety of reasons. The more people there are who have a demand for processing transactions on-chain, given a finite supply of room per block, the more it costs to process a transaction. While every transaction is run in tandem (validating, storing, viewing) throughout the gossip protocol on a global scale, a very large amount of data is generated in the process. If demand continues to outpace the blockchain’s present scale, more transactions will be left unconfirmed as the competition for fees rises (MLN 30). This makes it less practical to transact on the blockchain and far-fetched as a means to transact on a daily basis for items of miniscule expense. Therefore, for example, it becomes infeasible to pay for a dollar slice of pizza in Manhattan using cryptocurrency since it adds a high-percentage premium onto the price of the dollar pizza. Moreover, through repeated transactions, these fees will add up over time.

One proposed alternative to the Lightning Network was to increase block sizes on the Bitcoin blockchain. The rationale would be to increase the supply within a finite block in order to cram more transactions in. However, costs would quickly be carried over to the network’s node operators, making it more taxing on their resources, and consequently less decentralized given that the barrier to entry has increased thus (ibid). According to “Mastering Lightning Network, 1st ed.”, assuming Bitcoin needed to match the throughput of TradFi companies such as Visa and Mastercard (40,000 at peak) on layer 1, an internet connection of at least 10 MBps or 80 Mbps would be necessary just to receive the transactions. Combine that with a whopping 864 gigabytes of storage a day, operations for the average node running would become extremely cost prohibitive. Don’t forget either that every single transaction runs the ECDSA (elliptic curve digital signature algorithm), which is hardly manageable to do 40,000 times a second (computationally expensive). Operations at this scale would break Bitcoin’s trust model as average users would be forced to rely on third parties to discover the state of the ledger.

A Lightning Development

The Lightning Network “is a peer-to-peer network of micropayment channels implemented as smart contracts on the Bitcoin blockchain as well as a communication protocol that defines how participants set up and execute these smart contracts'' (MLN 77). The Lightning Network is comprised of a cryptographic protocol run by an extensive network of nodes that route payments either using an onion-like protocol or establish channels between nodes on a peer-to-peer basis. Lightning Network is built directly on Bitcoin, it is not a sidechain (which sacrifices decentralization) or able to exist separately. Bitcoin is Lightning, just as Lightning is Bitcoin.

If you recall about Bitcoin, the blockchain has its own turing-incomplete programming language called Bitcoin Script, and that’s what these smart contracts are created from. In order for two parties to send satoshis or litoshis back and forth, a financial relationship between two Lightning Network nodes must be established in the form of a “payment channel”. Payment channels are bidirectional, indefinite and routable. The purpose of such a relationship is to redistribute the channel’s balance in one direction or the other depending on the transaction’s goal. This is governed by a protocol internal to the Lightning Network and it ensures that this process can be executed trustlessly. Thanks to Script, we can do some pretty cool things, like create multisignature addresses, or require multiple signatures from a set of predetermined users in order to spend a UTXO (unspent transaction output).

Multisignature addresses are the basis of Lightning Network’s payment channels: an unpublished 2-of-2 multisignature address holds the channel balance, with each key held by the respective participant in the transaction.  Afterwards, the sequence of transactions is negotiated between channel partners and held unspent. The channel balance is determined and how it is to be proportioned by funding transactions. Thus, each transaction is akin to moving your balance across the channel to your partner (without the Bitcoin blockchain itself knowing). Whereas each transaction you participate in, a new balance of funds is agreed upon thereby nullifying the previous state. Should someone breach the protocol and attempt to spend the previously revoked state, the cheating partner can be punished by the cheated partner who may seize the total channel balance (not all the funds in the user’s wallet) via the commitment transactions made prior, which are designed to protect the users from losing funds.

The ingenuity behind this design is such that we have the ability to hold partially signed transactions off-line without publishing them. Payment channels in the Lightning Network are limited by only a few factors such as the time it takes for your internet provider to move information across the internet, the channel’s capacity for funds, and the number of payments that can be had across a channel simultaneously. Impressively, there are no block confirmations necessary for this to be done, only the balances to be moved between channel partners (MLN 81). This means that fees are the lowest of any other blockchain or DAG: 1 Satoshi, or 0.00044 cents with instant settlement, which is a fever dream for traditional financial institutions and mountainous competition for [insert names of non-Bitcoin/non-Litecoin blockchains here] trying to be a medium-of-exchange.

This incredible innovation allows for micropayments and a new denomination of satoshis called millisatoshis: 1/1000th of a Bitcoin. This is the minimum denomination that can be sent over the Lightning Network. Moreover, payments are much more private on Lightning network (compared to the public ledger) because nodes only communicate with their channel partner while the transaction is ongoing -- only the final balance is published to the Blockchain and broadcasted. Bitcoin’s consensus rules arbitrate this cryptographic network system, for just in case your partner tries to screw you over or disappears into the darkness of the night, the protocol’s consensus rules keeps your satoshis safe. Off-chain scalability using the Lightning Network allows for the network to reach a theoretical limit of 40,000,000 transactions per second (tps) with a 500 tps cap per channel. Now it is viable to purchase the fifty cent biscotti you forgot to purchase alongside your morning coffee in a separate transaction! In the famous words of Daft Punk: “Harder. Better. Faster. Stronger.”

Notes:

  • Litecoin is included in the dialogue since it integrated the Lightning Network back in April of 2018.
  • Some channels on the lightning network are public and can be discovered through the explorer: https://www.explorer.acinq.co. Explorers, however, cannot display an authoritative state of the network since not all channels are public or visible.

Works Cited

Antonopoulos, Osuntokun, Pickhardt. Pg. 30 - 130. Mastering the Lightning Network: A Second Layer Blockchain Protocol for Instant Bitcoin Payments, 1st Edition, December 21, 2021.

Poon, Dryja. The Bitcoin Lightning Network: Scalable Off-Chain Instant Payments, January 14th, 2016.

Subscribe to Crypdough.eth
Receive the latest updates directly to your inbox.
Verification
This entry has been permanently stored onchain and signed by its creator.