#3 - Scaling Bitcoin
An Introduction to the Lightning Network
Matt Fox - April 28, 2022
Bitcoin is a base layer of financial settlement that replaces trust in a third party with trust in (i) the mathematics underlying cryptography and computer science, (ii) the validity of open-source software and (iii) the economic self-interest of miners to accurately update the shared ledger. As discussed in our Why Bitcoin piece, in the same way that the U.S. Constitution is valued because it set a higher standard for rule of law in political life, bitcoin is valuable because it sets a higher standard for rule of law in economic life. Because bitcoin does not rely on human institutions (banks, courts, governments) for its security, it is capable of scaling as open financial infrastructure across customs, jurisdictions, and boundaries of enforcement.
However, bitcoin’s unique assurances come at the cost of other desirable features of a monetary network, namely transaction speed, throughput, and privacy. This piece will summarize the scalability challenges inherent to the bitcoin blockchain and the different models of resolving them. It will then explain how the most promising scaling solution, the Lightning Network (“LN”), works to enable scalable, near-instant, and largely private bitcoin payments, all while maintaining the trust-minimizing characteristics of bitcoin. It will conclude by contextualizing LN’s significance.
Bitcoin Doesn’t Scale
Everyone has heard that bitcoin doesn’t scale, that “you can’t buy a cup of coffee” with it. This is not a new concern, in fact it was the topic of one of the very first responses that Satoshi Nakamoto received on the Cryptography Mailing List after posting the bitcoin white paper. The scalability of bitcoin as a currency is limited by the trade-offs necessary to create the historically strong and novel guarantees that bitcoin offers. Specifically:
Maintaining consensus on the state of the ledger across the peer-to-peer network is the primary function of the bitcoin protocol. In order to avoid confusion as to the most recent state of the blockchain, the bitcoin protocol targets 10 minutes between each new block. Due to periodic, temporary confusion over the state of the blockchain, best practice is to wait 6 blocks until considering a bitcoin transaction “final.” This implies roughly 60 minutes for transaction settlement, which is clearly not suitable for a global currency. Fast settlement time is sacrificed for the primary goal of maintaining consensus.
A large and geographically diverse population of full nodes running the bitcoin software is crucial to the health of the peer-to-peer network, and ensures the ability to use bitcoin without relying on a third party to send transactions or know the state of the network. In order to maintain the economic feasibility of individuals running a node, the amount of data in each block in the blockchain is limited (the block size limit). As each transaction inside of a block contains a minimal threshold of data (at the least to include the signature in the transaction), this block size limit puts an upper bound on the number of transactions the bitcoin blockchain can process in any given period (roughly 7 transactions per second). To get a sense of the challenge, increasing block size in order to equal Visa’s peak usage rate of 40,000 transactions per second would require roughly $100 per day (or over $35,000 per year) in storage costs alone to run a node, well in excess of what is practical to expect of tens of thousands of individuals across the globe. The ability to process the world’s transaction volume is clearly a prerequisite for a global monetary network. Transaction throughput is sacrificed for the primary goal of maintaining a decentralized, peer-to-peer network.
A public, immutable ledger is necessary to ensure that anyone can validate and verify transactions on the network. Broadcasting all economic activity to the entire world, to be kept in a public record for all time, is not a suitable trait of a monetary network. Transaction privacy is sacrificed for the primary goal of ensuring bitcoin remains open to all, without centralized control.
Models of Scaling Bitcoin
This is not to say that improvements to bitcoin’s scalability cannot be made, just that the limitations are inherent trade-offs enabling bitcoin’s ultimate value proposition. Nevertheless, there have been and are those who believe such performance attributes are primary goals themselves and warrant trading off consensus, peer-to-peer, and permissionless guarantees.
The clearest example of this was seen in the Block Size War from 2015-2017. In short, a number of bitcoiners believed scaling bitcoin was an existential challenge that should be addressed by (indefinitely) increasing the block size limit. The opposing side objected for two reasons, (i) a concern that bigger blocks would result in network centralization as fewer and fewer people would be able to afford the bandwidth and storage costs of running a node and (ii) a concern that initiating a hard fork to raise the block size limit would represent a radical expansion of human governance of bitcoin, eroding its promise to be a system of rules, not men. Ultimately the “large blockers” were unable to garner the near-unanimous consensus needed and ended up forking bitcoin and creating Bitcoin Cash (which currently has a market capitalization less than 1% of bitcoin’s and has less than 1% of bitcoin’s hash power securing the network).
The big block proposal was an example of an on-chain (or “Layer 1”) scalability proposal, meaning that it aimed to change the bitcoin protocol itself. The opinion held by the small block group was generally that bitcoin’s scalability should be addressed off-chain (or on “Layer 2”), effectively by enabling transactions to take place off of the bitcoin blockchain. The mental model here is of a “layered” system, where scalability and incremental functionality would be unlocked on networks on top of bitcoin, with the base layer used to enforce rules and periodically settle transactions. The off-chain model addresses the scalability question while also keeping bitcoin a conservative, rules-governed, base layer of economic activity.
This layered model is hardly a novel concept, and is employed in many complex systems, such as:
Governments – where federal, state, and local governments are used to enable increasingly local political questions to be addressed by increasingly representative governing bodies
Existing Payment Infrastructure – where Fedwire serves as the base layer and numerous (non-interoperable) transaction networks sit on top of it
The Internet – which uses a 5-layer model (Physical, Data Link, Network, Transport, Application layers)
The on-chain approach is by no means limited to Bitcoin Cash, and it has been a main dividing line between bitcoin and smart contract (or “Web 3”) platforms. The scalability challenge is even more urgent for Web 3 protocols, as they generally attempt to use bitcoin’s basic architecture to execute and reach consensus on a much larger scope and scale of computation. While bitcoin has spent the last 3-4 years waiting for off-chain (Layer 2) implementations to mature, the broad arc of the Web 3 space has been to make on-chain (Layer 1) trade-offs to achieve immediate scalability improvements. While these scalability gains (and a business model based on seigniorage – more on this in our upcoming memo) have allowed Web 3 to dominate developer and user mindshare, it has come at the cost of the aforementioned inherent trade-offs. Examples can be seen with:
Ethereum – which raised its block size to such an extent that it is economically infeasible for an individual to run a full node, resulting in almost 70% of Ethereum nodes ironically being hosted on centralized servers such as AWS.
EOS – which did away with permissionless mining and instead restricted block production (mining) to 21 entities, essentially gutting an assurance of censorship resistance in the pursuit of transaction scalability. In order to keep the permissioned miners accountable, EOS enabled any protocol rule to be changed by a “vote” of token holders, reverting away entirely from a rules-based system and to a primitive “majority rules” system.
Solana – which, in response to bugs and resource exhaustion, actually froze their entire blockchain numerous times in the last year. Despite claims of “unstoppable” transactions and a statement on its website that says, “transactions will never be stopped,” Solana’s ability to freeze the entire network shows that availability is implicitly permissioned.
Our Why Bitcoin piece discussed how bitcoin’s core value proposition is its system level decentralization, and that the weakening of any one vector erodes the others. While it has become popular for VC-backed Web 3 protocols to say that “different levels of decentralization are needed for different use cases,” the reality is that compromises to core tenets of decentralization transform the value proposition entirely. In place of a durable, world-historical advancement in rule of law emerges a game of regulatory arbitrage, where long term success is dependent on keeping complexity ahead of regulators’ ability to police and building a sufficient political lobby (and hiring enough former regulators) to keep them off your back. This looks much more like the centralized, human enforced model of existing systems than it resembles bitcoin and is subject to the same inevitable political capture that bitcoin is valuable for resisting.
How the Lightning Network Works
In contrast to the on-chain model, bitcoin’s most promising Layer 2, the Lightning Network (conceived in a 2016 white paper and launched in 2018), aims to scale bitcoin without sacrificing its core value propositions. Specifically, users do not need to trust other participants to store and spend bitcoin on LN, but they are able to send bitcoin nearly instantly, cheaply, and privately.
Before getting into how LN works, it is helpful to review how transactions on the bitcoin blockchain work. The bitcoin blockchain is a replicated public ledger that simply enables consensus on the proper ordering of transactions on its global state. Bitcoin transaction contain three basic components:
An output – the recipient’s information. This is also called an unspent transaction output (“UTXO”). If one “owns a bitcoin,” he technically controls the private key that enables the spending of a UTXO.
An input – the sender’s information. The input in every transaction is a reference to an output (UTXO) from a previous transaction. The one exception here is the block reward paid to miners, which has an empty input field as the bitcoin are newly minted.
Transaction data – referencing necessary data concerning the transaction and blockchain.
If Alice wants to send bitcoin to Bob, she creates a transaction specifying which UTXO she wants to send to Bob’s address. Alice then signs the transaction with the private key corresponding to her UTXO, broadcasts the signed transaction to the network, and waits for this unconfirmed transaction to be added to the blockchain. Nodes and miners organize these unconfirmed transactions into a queue called the mempool (short for “Memory Pool”), and miners construct blocks from transactions in the mempool while racing to guess a large random number in order to mint the next block and receive the block reward and transaction fees. As the block size limit implies, the scarce resource in bitcoin block production is block space, so transaction fees are based on the amount of data a transaction uses, rather than the number of bitcoin in the transaction. Once the transaction has been included in a valid block, the transaction is confirmed, and the new UTXO can be spent only with the private key corresponding to Bob’s address. Again, regular consumer payments are a challenge on the bitcoin blockchain due to:
The time it takes for the entire network to agree each new block is valid
Miners’ transaction fees being a function of the amount of data in the transaction (and not the value)
The need for each transaction to be included on the public ledger
The primary innovation of LN is that not every transaction needs to be broadcast and settled on the main chain. The basic building block of LN is the payment channel, which is simply a shared UTXO between two parties through a 2-of-2 multisignature address (which requires both party’s signatures to be able to spend on-chain). One of the two channel partners will “fund” the channel by sending bitcoin to the multisignature address, which defines the maximum amount that can be sent across the payment channel. Sending a payment in a channel on LN simply entails the two parties’ updating the balance of the UTXO and exchanging signatures with each other. This enables the following characteristics:
Because only the two channel partners need to agree on the updated UTXO (rather than broadcasting a transaction and waiting for the entire network to agree it is final), LN payments can settle nearly instantly, and with greater privacy.
Because LN payments are not broadcast to the blockchain and competing for space inside of a block, payments can be extremely low-fee.
Because the channel partners exchange signatures with every payment, they do not need to trust (or even know) each other. By exchanging signatures, either party can (independently, at any time) use both signatures to broadcast the most recent state of the channel to the blockchain, “closing” the channel and receiving their portion of the balance back on-chain.
Payment channels are often described as bar tabs. One party uses an on-chain transaction to open a tab with a channel partner, and they are able to make an arbitrary number of payments back and forth between each other, only needing to broadcast to main chain again when they want to “close the tab.”
As the name implies, the Lightning Network is simply a network of these 2-of-2 payment channels. LN users are able to send payments to other users, without having a direct channel to them, through a process called routing. In the graphic below, each letter represents a node, and each line represents a payment channel, with the graphic showing how node A can route a payment through the Lightning Network to node Q, while only having a channel open to nodes B and C. Any node on LN can be a routing node, and nodes are incentivized to route payments through the ability to collect routing fees.
Routing essentially entails each stop in the payment path updating its channel balances with the nodes directly before and after it, in the amount of the payment (plus fees). For example (excluding routing fees), if in the scenario above node A wanted to send 10,000 sats (0.0001 bitcoin) to Q, node K would help route the payment by receiving 10,000 sats from F, and sending 10,000 sats to L.
Routing fees are generally paid as a percentage of the value of the payment, which makes lower value / consumer payments much more economical on LN versus on-chain
The routing process makes use of Hash Time Locked Contracts (HTLC’s), which cryptographically ensure that routed funds are effectively escrowed, and if a payment is not successfully routed after a certain amount of time, it will fail, and everyone will be refunded. HTLC’s make LN payments atomic, meaning they either succeed or fail, and ensure that routing nodes are not risking their funds (only their time and capacity that could have been earning routing fees).
Routing is done using an onion protocol, ensuring each node on the path knows only the party directly proceeding and succeeding it on the route, without knowing if either is the initial payer or ultimate receiver. So in our example above, node K knows only that it received from F, and sent to L, without knowing the other nodes involved in the path, protecting privacy.
Finally, Lightning payments maintain the permissionless, peer-to-peer, and trustless properties of bitcoin. This is ensured both at the payment channel level, and the network level, due to:
The ability to force close a channel at any time (as discussed above), enabling bitcoin held on the Lightning Network to be similarly “self-custodied” as bitcoin held on-chain.
The use of routing fees to incentive the sending of payments across the network in a peer-to-peer fashion, without any centralized third party or database.
The use of HTLC’s and onion routing, which prevent loss of funds and privacy, respectively, while routing funds across the network
The above is a very high-level overview of the mechanics of the Lightning Network. A more detailed overview can be found in Mastering Lightning (with chapters 1,3,7,8,15 providing insight on key components).
To summarize, the Lightning Network scales bitcoin by enabling payments to be made off-chain, over a network of 2-of-2 payment channels. Because these payments are made off-chain, they can be instant, cheap, and private. The use of HTLCs and onion routing provide payments with a cryptographic assurance of end-to-end security, enabling LN to be peer-to-peer, permissionless, and trustless. The ability to independently, at any time, close a payment channel and use the bitcoin blockchain to enforce its most recent balance grounds the ultimate security of funds on LN in the security of bitcoin itself.
Why the Lightning Network is Important
The Lightning Network is still early, and challenges remain (specifically surrounding, channel management, privacy, and other items), but it represents a tectonic shift in the bitcoin ecosystem for three main reasons.
First, it essentially provides the medium of exchange (“MoE”) functionality for bitcoin. With the Lightning Network, one can practically buy a cup of coffee with bitcoin, and the expanding integrations of LN companies is making it more accessible every day. More importantly, instant and cheap payments elevate bitcoin from just a store of value (“SoV”) to an open monetary network, bringing it one large step closer to viably serving as a global currency. The significance of MoE functionality compounds through its unlocking of bitcoin’s other useful properties. Being natively digital, programmable, and borderless has a much larger multiplier effect for a monetary network than a conservative store of value. The impact of these traits in the next 3-5 years will be much stronger than it has been in the past, and can be seen by the large and diverse group of start-ups already building on LN. The below industry map, from Arcane Research and OpenNode, provides a helpful visual overview of these burgeoning use cases.
Second, LN creates an environment of innovation on top of bitcoin. Whereas the base layer is famously conservative (in an effort to preserve bitcoin’s reliability), Layer 2 protocols can experiment much more aggressively, as their mistakes do not pose an existential risk to bitcoin itself. The compounding innovation that LN engenders will accelerate and broaden bitcoin adoption, and disrupt the dominance of developer, user, and investor mindshare that Web 3 has enjoyed these last few years. Our Bitcoin Conference 2022 Recap highlighted many of the most noteworthy examples of this compounding innovation already being unlocked by LN.
Taro – a proposal using bitcoin’s new signature upgrade (Taproot) and LN to enable other assets / tokens to be issued on bitcoin and transferred over Lightning. Putting aside the discussion of a multi-coin future, Taro appears to offer the technical capability to replicate much of the Web 3 market, with the unparalleled security of bitcoin and scalability of Lightning.
LNURL / Lightning Address – enables the lifting of LN payments from just the Lightning Network to the internet itself. Leverages the infrastructure and familiarity of the HTTP layer to bring bitcoin closer to being the native currency of the internet.
Impervious Browser – leverages LN to extend peer-to-peer, permissionless, and trustless guarantees to a wider array of online activity. The initial product includes video/audio/text messaging and collaborative documents, in addition to payments.
Finally, LN provides a glimpse into the wide-ranging potential of bitcoin. By showing how the unique reliability of bitcoin can be used to underpin higher level networks that provide incremental functionality, LN enables one to begin to see how bitcoin is properly understood as not just a store of value, but as the base layer for and foundation of an entire ecosystem of online and economic interaction. There are two main implications of this emerging utility value. The first is that the “digital gold” investment case only scratches the surface of bitcoin’s potential. A noteworthy proportion of the total bitcoin supply being held for utility on various Layer 2 networks would force investors to reevaluate their mental model and consider “digital gold” as just one component of a Sum of the Parts approach. Such a shift would significantly increase the Total Addressable Market and projected future value of bitcoin.
An emerging utility value also greatly strengthens bitcoin’s cultural relevance. It offers a realistic hope of a future less defined by political capture, where sovereignty is returned to the individual through direct, open, global cooperation. In such a future, online and economic activity is not a privilege given by centralized, quasi-government entities, but is easily accessible to all through its foundation on pillars that cannot be taken away from any free person – mathematics (cryptography and computer science) and free expression (open-source software). This is the future that we are eager to help build at NGU.