LNP/BP: A gentle introduction
LNP/BP: A gentle introduction
Jul 27, 2022 11:30 AM (a year ago)

LNP/BP: A gentle introduction

(originally published at AlzaShop (opens new window))

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.

# Introduction

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 (opens new window), and so do other fellow Bitcoiners (for a few random examples see here (opens new window), here (opens new window), here (opens new window), here (opens new window), here (opens new window), here (opens new window), here (opens new window), or here (opens new window)). I also entered a long and noisy Twitter-quarrel (opens new window) with my friend Vortex (opens new window) 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 (opens new window) to my annoying insistence).

Search for the LNP/BP acronym on Twitter to select the noble users who deserve to become your new best friends (block and report everyone else).

It doesn’t actually stop at Twitter, for me: together with Maxim Orlovsky (opens new window) 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 (opens new window), Magical (opens new window), Proofmarshall (opens new window), Storm (opens new window), Lightspeed (opens new window), and others).

The GitHub repository of the LNP/BP non-profit organization.

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” (opens new window). 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 (opens new window)? 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”?

Trying to keep up with what actually is, or isn’t, a “second layer” is starting to become a little confusing.

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” (opens new window) 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 (opens new window)).

It’s layers all the way down (layers are the new turtles)

A very good example of this analogy, older than the Internet itself, can be found in Architecture, where the different “shearing layers” (opens new window) of a single building represent independent aspects of it, each one evolving in different timescales, with different longevity.

Sharing layers in a building

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”.

Random triangle with computer-science-sounding layers

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 (opens new window). 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.

Comparison of layers in the ISO/OSI model and the TCP/IP model.

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 (opens new window), 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 (opens new window) and here (opens new window)).

The first mention I found on Bitcointalk about “new layers on top of Bitcoin”.

A new meaning for the expression “layers on top of Bitcoin” started to emerge around the announcement (opens new window), in 2013, of the “Mastercoin” protocol (today called “Omni-layer” (opens new window) after a re-branding made necessary by the typical delivery, governance, and transparency problems that always follow “ICOs” by centralized “Foundations”).

Sorry, Mastercoin friends…but you know this is true.

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 (opens new window): “We’re a protocol layer on top of Bitcoin, adding extra features. We use Bitcoin like email uses the underlying layer of TCP/IP.”

MasterDoge: a second layer on top of the Dogecoin Standard (this banner was sponsored by Elon Musk)

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 (opens new window), 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 (opens new window): a protocol used to define other protocols). But the expression “layer 2 protocols” was also pretty common.

Lol, remember all those “Bitcoin 2.0” conferences?

Since they usually leverage the “OP_RETURN” (opens new window) 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 (opens new window) mobile app (discontinued since the creator (opens new window) honestly acknowledged the absolute un-scalability of the method (opens new window), 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).

Eternity Wall was not scalable, but it was cool.

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.

I recycled this meme from the Discovering Bitcoin series, but you have to admit it’s just too perfect to not reuse it.

There aren’t trivial solutions: if you strictly limit size and frequency of blocks in the Timechain (opens new window), 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.

Difficult trade-offs (and difficult to read verbose memes).

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.

Self-explanatory meme.

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.

Incentives and cryptography are always better than lawyers and judges, including when you are deciding who to invite to a party.

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.

Nice illustration of (intra-input) signature-aggregation (the cross-input one will be even nicer).

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.

Gold certificates on paper…not bad, if you don’t have anything better.

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).

The Fiat Standard in one picture.

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!

Lighting Network bitcoins are not bitcoin-denominated credit, they are bitcoins.

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 (opens new window) 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” (opens new window). It was something unexpected when Satoshi Nakamoto himself (opens new window) 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 (opens new window) devised by Satoshi was defective, so it took some more years to developers like Jeremy Spillman (opens new window), Christian Decker (opens new window), and Joseph Poon (opens new window) 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 (opens new window).

Arguments from authority are always wrong…except for Hal Finney…if Hal says so, then it proves my point.

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.

# Hybrid Ideas

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 (opens new window) 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 (opens new window).

“Omission” vs Credit layers (plus hybrids).

Some hybridization is also possible between the “Reinterpretation-layers” and the “Omission-layers” discussed above: for example the RGB project (opens new window) 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 (opens new window) to manage the bitcoin asset over a different kind of infrastructure. A similar thing can be said about Issued Assets on Liquid (opens new window), or about the Proofmarshal proposal for assets (opens new window).

“Reinterpretation” vs “Omission” layers (plus hybrids).

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.

Ok…this is starting to look a bit messy…also, what is that “???” purple box there?

# 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”?

Let’s test our analogy.

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” (opens new window), 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” (opens new window), 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 (opens new window), SCTP (opens new window) and ICMP (opens new window). There are many very important protocols on top of TCP, which are integral parts of the suite, like for example HTTP (opens new window) (also known as “The Web”), SMPT (opens new window), FTP (opens new window), and SFTP (opens new window) (there are also protocols on top of UDP, like RTP (opens new window)).

Upper layers: increasing “competition”.

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 (opens new window), advanced management of LN-services like Watchtowers (opens new window), or even more complex backup protocols (opens new window) and messaging protocols (opens new window) 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).

The Lightning Network itself is not necessarily a single “second” layer: it could be fruitfully separated.

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.

Sorry Vortex…I know the war is over and you conceded…but I can’t get over how much “BTC/LN” sucks.

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 (opens new window) sub-protocol of IP), it is only unicast (opens new window) across a specific network path, as long as the TCP connection lasts. It has been already pointed out (opens new window) 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.

Does all this make sense anyway?

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 (opens new window). 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 (opens new window) (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.

I know: “Matrix”-style colors are terrible for presentations…I don’t care…I like them.

them.

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” (opens new window) shows startling resemblances with the most recent debate about “Bitcoin Maximalism”, while the story of the “IPv7” takeover attempt (opens new window) 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.

Seriously, you must read this great tweetstorm by Alex B..

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 use of physical violence is just metaphoric…I just want to slap you intellectually.

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” (opens new window) 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.

🔥 If you enjoyed this content, please consider donating
© 2024 Giacomo Zucco