LNP/BP: A gentle introduction
(originally published at AlzaShop)
The Lightning Network is a relatively new and quickly developing system that promises cheap, fast and private payments on top of Bitcoin. It’s already working in production, many people use it daily. But is that all? What if that was just the tip of some technological iceberg? What if what lies beneath the surface has a chance to significantly affect some parts of the Internet as we know it? Does that sound crazy? Maybe it is, but bear with me for a little while.
Let’s start by addressing the mysterious acronym “LNP/BP”. It became fairly common, in the last year, to see some Bitcoin enthusiasts flaunting it around: I have it in my Twitter bio, and so do other fellow Bitcoiners (for a few random examples see here, here, here, here, here, here, here, or here). I also entered a long and noisy Twitter-quarrel with my friend Vortex about the use of this “LNP/BP” meme over the less accurate “BTC/LN” one (which he used to prefer in order to express the same basic concept…before eventually capitulating to my annoying insistence).
It doesn’t actually stop at Twitter, for me: together with Maxim Orlovsky I even decided to use it as the name of a small non-profit association, created to sponsor the development of Bitcoin-related R&D projects (including RGB, Magical, Proofmarshall, Storm, Lightspeed, and others).
But what do we really mean with this acronym? It’s trivial to see an attempt to exploit the parallelism between Bitcoin and the Internet: more specifically the Internet protocol suite, known as “TCP/IP”. It clearly has something to do with a “layered architecture”, as opposed to a “monolithic” one…but which are, exactly, the “layers” of Bitcoin? There seems to be a lot of confusion (at the very least terminological, but possibly also conceptual) around them. Is the entire Lightning Network truly Bitcoin’s “layer 2”? What is, then, a sinlge Lightning channel? Is the Liquid federation really a “layer 1.5”, as sometimes claimed, or is it maybe more like an “imaginary layer i”, as I half-jokingly objected? If strong federations are “layers”, are also multi-sig cold storages of custodial exchanges so? And what about state-chains, or channel factories, RGB-assets, op-return-based writing systems? Is all this hype about “layer 3” systems just meaningless noise, like “web 3”?
The goal of this article is to try to summarize, clarify, and systematize the discussion about the “LNP/BP” meme, hopefully reducing the level of confusion.
Layers before Bitcoin
The concept of “abstraction layer” is obviously older than Bitcoin. In general, thinking about “layers” as a mental model is useful to label all those complex systems that can be meaningfully divided into an ordered series of subsystems, each one strictly dependent on the ones coming before: this is why the analogy is made with a vertical juxtaposition, where things that are “above” stand on the shoulders of other things “below”, the latter being usually more difficult to safely touch, move or change than the former (like with different floors of a Jenga tower).
A very good example of this analogy, older than the Internet itself, can be found in Architecture, where the different “shearing layers” of a single building represent independent aspects of it, each one evolving in different timescales, with different longevity.
In computer science we can see an obvious example of the concept in the hardware/software duality (sometimes with additional intermediate layers known as middleware, firmware, etc.), where an underlying, complex, physical configuration of electronic components can be also described in a more abstract and simple way, as some functionally interesting “informational configuration”.
The 4-layer TCP/IP model is probably the best known example of layered architecture, together with its “academic/bureaucratic” competitor, the 7-layer OSI model. Within the OSI model we have a “layer 1”, also known as “physical”, transmitting actual raw bit-streams; a “layer 2”, aka “datalink”, defining the serialization format of data; a “layer 3”, aka “network”, deciding the routing path that the data will take; a “layer 4”, aka “transport”, managing transmission protocols; a “layer 5”, aka “session”, maintaining connections and controlling ports and sessions; a “layer 6”, aka presentation, managing data format and encryption; a “layer 7”, aka “application”, managing the final human-computer interactions.
The same mental model is also somewhat consistently reused in many sub-fields, from OpenGL rendering to Object-oriented programming, always in relation to the concepts of information hiding, encapsulation, tunneling, modularity, standardization, reuse, inhomogeneous time-dependency, security through insulation, etc.
“Reinterpretation Layers” in Bitcoin
In the context of Bitcoin, the term “layers” got initially mentioned in the usual Internet-related meaning, in connection to information overlays to communicate blocks and transactions across nodes and miners (see examples here and here).
A new meaning for the expression “layers on top of Bitcoin” started to emerge around the announcement, in 2013, of the “Mastercoin” protocol (today called “Omni-layer” after a re-branding made necessary by the typical delivery, governance, and transparency problems that always follow “ICOs” by centralized “Foundations”).
Mastercoin was a protocol that allowed some (valid) Bitcoin transactions to be also reinterpreted through the “lenses” of an additional semantic, which allowed the issuance of custom digital assets (representing for example IOUs, shares, options, royalties, voting rights, collectibles, certificates, etc.) and the creation of complex contracts (enabling for example atomic p2p exchange, gambling, financial derivatives, dividend distribution, etc.). J.R. Willett, its main developer, explained it with these words: “We’re a protocol layer on top of Bitcoin, adding extra features. We use Bitcoin like email uses the underlying layer of TCP/IP.”
Other projects reinforcing this definition of “second layer” followed closely: from Counterparty (very similar to Mastercoin, but without the shady ICO model) to many Colored Coin ideas (segregating the issued-asset representation on the upper abstraction layer from the contract dynamics, delegated back “below” to Bitcoin’s native scripting system). The generic name for these experiments, back then, was typically “Bitcoin 2.0 protocols”. In a well-written blog-post, the young journalist-to-be-ICO-launcher Vitalik Buterin labeled them “meta-protocols” (arguably not a very clean choice, since the expression already indicates something completely different: a protocol used to define other protocols). But the expression “layer 2 protocols” was also pretty common.
Since they usually leverage the “OP_RETURN” script opcode within Bitcoin transactions, these protocols could actually be considered as “layer 3”, while their layer 2 would be the interpretation of the information payload in the opcode itself, which could be also used for something simpler than digital asset schemes. A historical example would be the Eternity Wall mobile app (discontinued since the creator honestly acknowledged the absolute un-scalability of the method, pivoting to OpenTimestamps notarization instead) where you could also answer and “like” other people’s messages, in a simple but effective “Social Network on the Blockchain” (not unlike the few examples that shitcoiners are still shilling today as a scalable idea, which it of course isn’t).
We could call this particular conceptualization “reinterpretation layer” or “infrastructure reuse”. Every “event” of the second layer is an actual valid and confirmed Bitcoin transaction within the first layer, reinterpreted in a higher-order semantic to mean something more than a simple bitcoin transfer. The economic asset bitcoin (with the “b”) is not necessarily reused, while the technological infrastructure Bitcoin (with the “B”) is leveraged in order to move more assets around.
“Omission Layers” in Bitcoin
A second, completely distinct use of the expression “second layer on top of Bitcoin” emerged within the debate about the several problems created by the fact that Bitcoin has been originally conceived a “global consensus” protocol. While indisputably brilliant, Bitcoin’s decentralized solution to the double-spending problem, the “Timechain”, is inherently impossible to scale. It assumes that every node in the network must forever keep track of everything: every single on-chain transaction must be downloaded and verified by every actor who will use the system for its entire history, even far into the future. This also implies serious privacy and fungibility limitations, enabling any kind of forensic analysis and deanonymization attempt.
There aren’t trivial solutions: if you strictly limit size and frequency of blocks in the Timechain, then the validation burden for all the nodes may remain manageable, but the “block-space” supply will leave so much demand unsatisfied that transaction fees and waiting times will increase a lot. If, on the other hand, you allow size and frequency to grow, then the “block-space” price will decrease, but the increasing costs of running nodes will centralize the topology of the entire system.
There’s a clever, nontrivial way to mitigate the fundamental limits of global consensus systems, without sacrificing its decentralization: migrating some of the activity over a trustless and permissionless “second layer”. Most users can just refrain from committing every transaction to a block until that’s strictly necessary, keeping most of the traffic off the public Timechain, only using the latter for conflict resolution or periodic settlement. The most famous example of this kind of approach is without any doubt the Lightning Network: a system where valid Bitcoin transactions can be locally transmitted between couples of peers and concatenated in “routing paths”, as opposed to broadcast and committed to the Timechain, in order to route value between payers and payees, at the edges of the paths.
The idea is somehow similar to the way people use courts and contracts in common-law systems: courts can create publicly binding precedents, reaching some sort of “legal global consensus,” but they are comparatively slow, expensive and bad for privacy, so most trading parties usually only sign private contracts, asking courts to verify and enforce them only when conflicts arise or when some periodic public audit is due. Advanced Bitcoin scripts can be used to keep the operation trust-minimized: unlike actual legal trials, the process of Timechain-settlement can avoid human bias and corruption, relying mostly on cryptography, incentives, and code.
The Lightning Network is not the only example of this kind: also the off-band interactions among peers needed to prepare advanced contracts like CoinJoin, PayJoin, or CoinSwap (and in the future also hopefully different kinds of Signature Aggregation) could be considered as happening on a second layer, with only some parts actually hitting the Timechain, depending on the scenario.
We could call this particular conceptualization “omission layer” or “asset reuse”. Every “event” of the second layer is an actual bitcoin transfer that can eventually be settled on the first layer, crafted in a way to guarantee acceptable levels of security, even if most of the Bitcoin transactions used to accomplish this goal aren’t actually broadcasted to the entire network and confirmed to the Timechain. The technological infrastructure Bitcoin (with the “B”) is not necessarily reused, while the economic asset bitcoin (with the “b”) is leveraged in order to mediate more value transfers.
Difference with Credit
It’s interesting to notice how these “off-chain” solutions may somehow resemble the institution of credit systems in the context of commodity-money. The use of physical gold, for example, was very difficult to scale (even if for different reasons entirely with respect to Bitcoin): precious metal coins were very expensive to store, transfer, and verify. That’s why, since the Middle Ages, people started to store, transfer, and verify, instead of physical gold, “paper gold” certificates issued by trusted third parties, to be redeemed only when needed. At the peak of the Gold Standard Era, it was possible to subdivide the global monetary system into at least three different “layers”: physical gold, sometimes traded directly by some final users, but more often kept as a reserve by central banks; central bank notes, mostly held by commercial banks; commercial bank notes, directly traded by most final users.
Ironically, while the foundational “layer 1” has disappeared from the modern fiat system (central bank certificates aren’t redeemable in anything anymore), there has been a proliferation of new “layers” in the upper section of the tower. As an example, when final users today pay via some “FinTech” application like PayPal, Venmo, GPay, AliPay, or ApplePay, they operate on a technical “layer 6”, which is mostly based on traditional banking relationships under the hood, which in turn represent a “layer 5” on top of a network of international corresponding banks, which are “layers 4” on top of the local central banks acting in legal monopoly within their jurisdictions, which are but a “layer 3” on top of the more fundamental “layer 2” of the Federal Reserve of the United States of America (again: the “layer 1” is sadly missing: no physical gold redeemability anymore).
Despite this superficial similarity, it’s important to clarify that the currently dominant notion of “second layer” in Bitcoin is actually something very different from the “credit-layerization” of previous monetary systems! Lightning transactions, for example, are not in any way promises of future transactions, or “credit” created by some trusted third party. They are actual, completely valid Bitcoin transactions, that may be effectively broadcast and committed to the Timechain when and if needed, with strong safety and fairness guarantees based on game theory and cryptography, as opposed to social reputation, legal liability or direct trust!
That such kind of trust-minimized second layer could even exist, is not something that Bitcoin pioneers could actually take for granted! A typical example is the way the Bitcoin-legend Hal Finney was imagining the future of Bitcoin scaling, after almost 2 years since the system’s inception: a mix of the trustless but unscalable layer 1 with a competitive network of scalable but trust-based “Bitcoin banks”. It was something unexpected when Satoshi Nakamoto himself came up with the embryonal idea of what is now known as an “off-chain payment channel”: a second layer which was not based on some trusted third party, but on self-enforcing mechanisms. The original construction devised by Satoshi was defective, so it took some more years to developers like Jeremy Spillman, Christian Decker, and Joseph Poon to fix the concept, and to merge it with the complementary concept of “atomic credit routing” (which was even pre-existent to Bitcoin itself, see as an example the original Ripple project) to create the current Lightning Network. And this evolutive process still hasn’t come to an end: see as an example the Eltoo proposal.
Trust-based “layers” to store and transact the bitcoin asset can still exist (and in fact they do: that’s what most online exchange are today), but it’s a completely distinct kind of “layerization” from the one that the Lightning Network embodies. In the former, the asset is not exactly bitcoin, but bitcoin-denominated credit. In the latter, actual bitcoins are moved within valid transactions, which just happen to follow a different anti-double-spending strategy than immediate global-consensus publication.
Of course, the distinction between trust-based social “layers” and trust-minimized technical “layers” is not always clear-cut and unambiguous. On one hand, for example, a peer withing the Lightning Network could decide to establish a payment channel with reduced cryptographic or game-theoretical guarantees, if the counterpart (for example a huge liquidity hub in the network, connected with a famous and reputable financial service) is sufficiently known and reputable. On the other hand, a traditional, full-custodial exchange could decide to somehow increase the reasons for its customer to trust it, open-sourcing the technical details of their (possibly multi-sig and HSM-based) cold-storage procedures and implementing sophisticate strategies of “proof or reserve”, “proof of solvency”, and “proof of ownership”, based on cryptographic guarantees that anybody could independently verify. In between these extremes, a number of different compromises are possible, blurring the line between trust-based social layers and trust-minimized technical layers: Statechains could replace the typical Dryja-Poon channels within some particular Lighting Network topologies, while some custodial exchanges could evolve their safe and cryptographically-provable procedures into full-fledged dynamic strong federations.
Some hybridization is also possible between the “Reinterpretation-layers” and the “Omission-layers” discussed above: for example the RGB project can be seen, on one hand, as an attempt to leverage the Bitcoin infrastructure to manage different issued assets, but it is also a technology strictly related with the Lightning Network, and an experiment around the concept of “client-side-validation”, originally intended to manage the bitcoin asset over a different kind of infrastructure. A similar thing can be said about Issued Assets on Liquid, or about the Proofmarshal proposal for assets.
The interaction among such abstraction layers may be nontrivial: in theory, you can route an RGB token, which represents a trust-based IOU denominated in the bitcoin asset, over a Lightning channel opened on the Liquid federated chain. Yeah, I know. You can now sit down a moment to process this.
LNP/BP like TCP/IP: How?
So, how much of a good job does the “LNP/BP” meme in representing the various ways in which the Bitcoin development is being “layerized”, and in maintaining a meaningful and consistent analogy with the most well-known example of “layarization”, namely the Internet Protocol Suite, also known as “TCP/IP”?
First of all, a few words on the “TCP/IP” expression: it is used to represent a very rich suite of open protocols, together collectively known as “Internet”, by explicitly naming the acronyms of the protocol which constitutes the base layer (if we exclude the physical “layer 0”) for the entire stack (or the “Internet Protocol”, abbreviated “IP”, also sharing the same name of the entire suite), on the right, together with the most used among the few second layer protocols built directly on top (or the “Transmission Control Protocol”, abbreviated “TCP”), on the left. It’s important to remind that the TCP/IP suite itself is not limited to the two protocols IP and TCP! There are a few important second layer protocols in alternative to TCP, which are integral parts of the suite, like for example UDP, SCTP and ICMP. There are many very important protocols on top of TCP, which are integral parts of the suite, like for example HTTP (also known as “The Web”), SMPT, FTP, and SFTP (there are also protocols on top of UDP, like RTP).
In this sense, the analogy implied by the “LNP/BP” expression sounds pretty elegant: it is intended to be used to represent a very rich suite of open protocols, together collectively known as “Bitcoin”, by explicitly naming the acronyms of the protocol which constitutes the base layer for the entire stack (or the “Bitcoin Protocol”, abbreviated “BP”, also sharing the same name of the entire suite), on the right, together with the most used among the few second layer protocols built directly on top (or the “Lightning Network Protocol, abbreviated “LNP”), on the left. Neat! Much symmetry! Of course, the LNP/BP suite itself would not be limited to the two protocols BP and LNP! A few important second layer protocols in alternative to LNP are being discussed, which would be integral parts of the suite, like for example some “Eltoo Network Protocol”, or some “Elements Federation Protocol”, or some “Statechain Entity Protocol”, or some “Proofmarshal Notary Protocol”. There could also very well be many very important protocols on top of LNP, which are integral parts of the suite, like for example protocols for advanced escrows like Discrete Log contracts, advanced management of LN-services like Watchtowers, or even more complex backup protocols and messaging protocols on top of LNP (the Storm and Lightspeed proposals mentioned in the introduction of this article are also experiments along these lines). Some layer 3 protocols on top of LNP could also bridge payments across the various layer 2 systems (the HTLC-routing and Sphynx parts of LNP could be easily segregated and interpreted in this sense).
If compared with some alternative, less sophisticated attempts to stress the analogy, like “BTC/LN” (where the orders of the layers is inverted, and the “Protocol” characterization is omitted, and the price-ticker for the asset is used instead of the name of the protocol, and the homonymy between the first layer and the entire suite is lost), I think it’s clear the extent to which the “LNP/BP” expression actually works smoothly.
Now an interesting question: is TCP an “omission layer” on top of IP? Or more like a “reinterpretation layer”? While maybe the latter is a more literal parallel, there is a strong argument for the former as well: every TCP communication is also a valid IP communication with some additional meaning, but instead of being broadcast to huge sections of the global network in a multi-cast style (like typical of the IGMP sub-protocol of IP), it is only unicast across a specific network path, as long as the TCP connection lasts. It has been already pointed out that the analogy is sound and quite insightful in this sense: every LNP transaction is also a valid BP transaction with some additional meaning, but instead of being broadcast to the global consensus, it is only unicast across a specific network path, as long as the LNP channels last.
LNP/BP like TCP/IP: Why?
But why is this analogy with TCP/IP important, in the first place? Apart from just confirming and reinforcing the very successful “Bitcoin is the Internet of Money” meme, I think there are very good reasons to stress this specific comparison to the multi-layer Internet protocol suite.
The first reason is to stress the importance of such “layerization”, especially in the context of safety-critical and politically controversial projects like Bitcoin. On the one hand, the possibility to change Bitcoin’s base layer too often, without much resistance and inertia, would open up serious social and political attack vectors. But on the other hand, no change at all in the whole system would mean technological stagnation and eventual obsolescence. Layarization allows us to enjoy the best of both worlds: fast innovation at the top layers, long-term reliability at the bottom layers. The same concept extends beyond the realm of time, into the realm of diversity of people, approaches, and ideas. On the one hand, a huge proliferation of alternative implementations of the base layers, without much convergence and standardization, would open up serious risks of consensus failure. But on the other hand, no competition at all would mean monoculture and concentration of risk into a single approach. Again, layerization allows us to enjoy the best of both worlds: diverse competition at the top layers, consistent convergence at the bottom layers. I expressed this idea of LNP/BP as multi-layer mental model, where the bottom layers should stay highly conservative, reliable, convergent and standard, while the top layers can be highly evolutionary and competitive, in one of my talks (where I also explore some other peculiar cross-layer trade-offs, like the one between chain-fungibility and network-deniability, or between blockspace-divisibility and routing-portability, or between confirmation-finality and channel-reliability, etc.), and I really think it makes sense.
A second reason to stress the comparison is to take inspiration from the similarities between some historical events which concerned the TCP/IP suite and some important milestone in the first 10 years of Bitcoin. Specifically, the story of the so-called “protocol wars” shows startling resemblances with the most recent debate about “Bitcoin Maximalism”, while the story of the “IPv7” takeover attempt closely echoes what happened around the NYA attack against Bitcoin in 2017. In both cases, the history of TCP/IP can be used as lessons about the superiority of open, independent, convergent standards. While history never repeats itself exactly, some social and technical dynamics are often recurring, making the two episodes an important source of inspiration.
A third reason to stress the comparison would be to further highlight the fact that transfers of value over properly-intended “second layer technologies” in Bitcoin do not represent “credit”, “IOUs” or separated assets (like some distorted narrative around the Lightning Network seem to suggest), but literal bitcoin transfers. As discussed above, there are some important similarities between credit systems and off-chain strategies, but also fundamental differences. The LNP/BP meme helps clarifying this: just like a TCP connection is integral part of the Internet suite, a LNP channel is integral part of the Bitcoin suite.
The last reason I see is about a very long-standing terminological and didactical problem: the homonymy between Bitcoin (intended as protocol, software, and network) and bitcoin (intended as the arbitrary unit of the limited supply of “digital gold” created within the protocol), which always generates some confusion among newcomers. While impossible to eliminate entirely, this source of potential misunderstanding is already mitigated by the more and more common use of the “satoshi” unit instead of the historical “bitcoin” one (this switch is not only naturally emerging from the necessity to counteract the “unit bias” which a surprisingly high number of “nocoiner” newcomers suffer from, and to reduce the number of decimal zeroes in front of the amount with the progressive increase in the value of a “bitcoin”, but is also, incidentally, closer to the way the actual Bitcoin software encodes amounts under the hood). Referring to the protocol suite as “LNP/BP” instead of “Bitcoin”, at least when some ambiguity may occur, is another didactical tool that can be used to clarify and distinguish.
Now you finally know the secret of “LNP/BP”. You know what layers are in the context of Bitcoin and beyond. You know why nobody should try to change Bitcoin’s base layer too much, or in too many ways, while fast evolution and diverse competition are still needed on the upper layers. You know why Bitcoin is even more “like the Internet” than you thought it was. You know why you have to put this acronym on your Twitter bio if you want to be cool. Use this knowledge responsibly.