#26 - The Layer 2s, Bitcoin culture and much more!
⚡ Everything at the intersection of the Lightning Network & Finance
If you enjoy this content, feel free to spread the word!
🤓 The Layer 2s: Lightning, Plasma, Rollups
Rollups seem to be all the rage in the Ethereum community right now, as they could enable to reduce transaction fees for complex smart contracts such as Uniswap. We must admit our very low knowledge on these alternative layers’ constructions, therefore we decided to dig in and let you know of our findings!
In this short section, we will try to provide a brief overview of the different scaling solutions and their respective tradeoffs.
Ok but first, why scaling?
Bitcoin is the first secure and decentralized electronic value transfer network. What makes it secure? Proof-of-Work. What makes it decentralized? Low trust and low cost. Low trust since anyone can verify and propose transactions and blocks. Low cost in running a full Bitcoin node. Security and decentralization of the network ensures censorship and asset seizure resistance.
In order to reinforce Bitcoin’s security and decentralization, its performances are limited to around 7 transactions per second with a 1 megabyte block limit. If we want to increase Bitcoin’s scalability, we can change Bitcoin’s parameters: increase block size (throughput) and / or frequency of blocks (latency). But the cost to operate a node is now higher, and less and less individuals can run a node. We do not want that.
A much more suitable option is to change the way we use Bitcoin: instead of computing all activity on the blockchain base layer, most transactions are now computed off-chain. The on-chain activity is limited to processing deposits, withdrawals and verifying that everything happening off-chain is following the rules. The level of trust and the cost of running a node remain roughly unchanged. This option is called layer 2 scaling.
The big difference between layer 2 and sidechains is that layer-2 solutions generally rely on the security on the main chain, while a sidechain has its own security properties. While layer 2 solutions should be trustless, sidechains require trust.
In the Bitcoin and the Ethereum community, three main types of layer 2 solutions are being developed: state channels, plasma and rollups, each with different needs and trust assumptions, that we will explore in this section.
The most famous implementation of state channels is the Bitcoin Lightning Network, based on Poon-Dryja’s payment channels construction. The concept of the Lightning Network was proposed in 2015, and the first implementation was launched in 2018. As a reader of this post, you may already be aware that the Lightning Network is a peer-to-peer network of payment channels implemented as smart contracts on the Bitcoin blockchain, which enables cheap, trustless and extremely scalable instant payments.
In short, smart contracts enforce trustlessly updating a transaction an infinite number of times in private before publicly broadcasting it. Multiple transaction updates can be done atomically: this enables routed payment in this new decentralized peer-to-peer network.
On Ethereum, we can cite the Raiden Network, a state channels implementation for ERC20 compatible token, which ICO-raised $33Mio in 2017. It seems not very active these days.
While state channels have proven to be very secure over the years, they also have limitations. For example, they can not be used to send funds to people who are not yet participants in the the network. In the summer of 2017, Vitalik Buterin and Joseph Poon proposed another layer-2 scaling solution, called Plasma, that could enable to send funds to participants who were not previously part of the system. Plasma could even presumably handle “nearly all financial computation worldwide.”
The initial specification of Plasma described a mechanism for constructing a MapReduce “tree of blockchains”: each node in the tree would represent a unique blockchain connected to its parents. It was quite complex to implement and soon after, Vitalik Buterin proposed a simplified spec called Minimal Viable Plasma (MVP).
MVP was a simple UTXO sidechain that aimed to minimize the trust in sidechain operators. Generally, sidechain operators can misbehave in two ways: first trying to steal users’ funds, and second by rendering transaction data unavailable, which would prevent anyone from verifying the correctness of the sidechain.
In MVP’s design, a user who wants to deposit funds sends it to the sidechain. Each sidechain is managed by an operator which could be a centralized actor, a multi-sig or another chain. Every interval, the operator bundles all the off-chain transactions it has received, generates a Merkle tree and publishes its Merkle root on-chain. To withdraw, a user publishes the Merkle branch of the most recent transaction sending the asset to them. The sidechain then starts a challenge period, during which other users could challenge the withdrawal by providing proof that it was invalid.
Plasma was designed to be safe under data unavailability: even if operators withheld data, all users would still be able to retrieve their funds and exit the sidechain. To do so, each user would submit a transaction to withdraw funds based on the Plasma MVP chain’s last valid state.
However, when implemented in real-life, Plasma posed several issues:
Its cost: users had to monitor and verify all transactions of the Plasma MVP chain to detect malicious operator behavior
Withdrawals were slow, since challenge periods could take up to 1 week
The mass exit problem: if all users wanted to withdraw their funds, the entire valid state of the chain would have to be posted on Ethereum within a single challenge period, which could prove to be impossible given the base layer scalability issues that Plasma was trying to solve.
In mid-2018, a new version of Plasma, called Plasma Cash, was designed to tackle these problems using a different data model. But Plasma Cash introduced its own new sets of problems, such as ever increasing storage requirements, and never really took off. By the end of 2018, many development groups halted their work on Plasma.
Just as confidence in Plasma declined sharply, a new “hybrid” scaling idea emerged: rollups. Contrary to state channels and Plasma, rollups could be used to process transactions for complex smart contracts such as Uniswap, for which the state of an object can be changed without the user’s consent (decrease or increase in balance for example).
Rollups are a Plasma-like construction with off-chain bundling of transactions by an operator and on-chain registration of the sidechain transaction data (stored as function arguments, but not executed). Instead of relying on operator trust, the correctness of the bundle could be proven using this data per transaction kept on-chain. How? There are two types of proposals:
ZK rollups, which use validity proofs: every batch includes an on-chain SNARK, which ensures that an operator can not post invalid transactions and guarantees that all sidechain blocks are valid
Optimistic rollups, which use fraud proofs: if the operator posts an invalid state transition, anyone can submit a proof that the transition was invalid and revert those transactions for a period of 1 week
However, each solution comes with its own set of tradeoffs:
ZK rollups could solve the data availability problem and avoid Plasma’s challenge periods, but validity proofs are computationally expensive to generate and it is currently not possible to deploy general smart contracts like Uniswap on ZK rollup sidechains. ZK rollups are also extremely complex to design and their development could take years.
Optimistic rollups are less computationally expensive, but they are less safe. Transactions can be incorrectly processed and later reverted. Hence a safety window of up to one week applies for withdrawals.
The current state of the Layer 2s
On Bitcoin, the Lightning Network is now considered sufficiently secure for channel volume limitations to be lifted with the Wumbo upgrade. The network is showing substantial growth:
New innovations both on the base layer and on Lightning keep improving its privacy (with Taproot activation) and user experience (with multi-path payments, Pool, etc.).
On Ethereum, the most popular scaling solution is currently Polygon (formerly Matic), for which the total value locked (and the price of its token) have exploded. If this clearly shows demand for scaling solutions on Ethereum, Polygon’s success is at the detriment of decentralization and security for users. Indeed, Polygon is a Proof-of-Stake Plasma sidechain that requires a high level of trust.
The Ethereum developer community is now mostly focused on the very nascent space of rollups. While many security and UX challenges remain, the launch of optimistic rollups is planned for this summer. The main interest of rollups is to support the execution of complex smart contracts used for DeFi.
While for its base layer, its secondary layer, and for the development of decentralized financial applications, Bitcoin chooses security and trust minimization over flexibility.
Sources: The life and death of Plasma by Ashwin Ramachandran & Haseeb Qureshi, An Incomplete Guide to Rollups by Vitalik Buterin, (Almost) Everything you need to know about Optimistic Rollup by Georgios Konstantopoulos.
Lightning Labs keeps shipping awesome products to support the growth of the ecosystem:
Terminal Web provides your node health check with actionable insights
Sidecar is a trust-minimized solution which facilitates the onboarding into Lightning. Sidecar leverages Pool, their non-custodial channel leases marketplace, to allow third-parties to open channels on behalf of their users. Sidecar could for example enable direct Lightning-enabled exchange withdrawal to a channel.
Bull Bitcoin’s node needs your help:
Impervious has announced their pre-seed financing round. They are building a censorship-restistant tech stack on top of the Lightning Network Bitcoin’s. As an example of what can be developed utilizing their API, they are releasing a dynamic VPN that leverages the Lightning Network to provide on-demand, high-bandwidth VPN services.
✌️ Bitcoin Culture
Michael Peterson and Nicolas Burtey explain their work with the Bitcoin Beach in El Salvador, showing how thousands of people are going lightning native to benefit from international remittance and creating Bitcoin tourism:
It’s always a pleasure to read the one and only Arthur Hayes, sharing his global macro wisdom in his incomparable writing style. It is a dense post which may require multiple reads, but it’s definitely worth taking your time on this one:
Dave White from Paradigm has published a pedagogical primer on perpetuals swaps with cool illustrations by Chelsea Myers. The article also contains an interesting replication of a perpetual swaps into its underlying instrument through the funding rates, inspired by Sam Bankman-Fried:
🤓 Look how we managed not to mention Bitcoin price once in here!
😘 He’s right you know
🤑 Only in “crypto”
Thank you for your support and let’s keep building the future of finance together!