Original Author: Ben Harvey

On October 26th, I listened to the live Bankless podcast on blockchain monoliths and blockchain modularity hosted by David Hoffman and Ryan Sean Adams. If you don't know what these two terms mean, that's fine, because the concept of blockchain modularity blew my mind too, so much so that I decided to break it down into several articles. I think blockchain modules represent the future of blockchain technology, and they are crucial to understanding if you want to master the blockchain ecosystem in the future. The purpose of this blog is for you to learn along with me, so I will boil down all the relevant concepts to the basics in order to have a clear understanding of what blockchain modules are, why they are important, and how to invest in them.
Before fully grasping blockchain modularity, there are two key concepts to understand: (1) Rollup and (2) Sharding. This article will focus on Rollups; what they are, how they work, and where they are going in the future. In the near future, an article will focus on sharding. I will then complete this three-part article series with an article tying everything together to explain blockchain modularity and the future of the blockchain ecosystem.
Blockchain Impossible Triangle and the Birth of Layer 2
Essentially, the blockchain faces three major problems, known as the Impossible Triangle. This refers to the tradeoffs all blockchains face between decentralization, scalability, and security, where a blockchain can only be optimized for two blockchains at the expense of the third. Obviously, security is paramount to blockchains, so this often leads to compromises in terms of decentralization or scalability.
Why is decentralization important?
You might be wondering, why is decentralization important? This is often a misunderstood concept, and it is often suggested that web3 promotes decentralization to resist government censorship. In fact, this is not the main reason why decentralization is important. The answer lies largely in stimulating innovation.
image description

Centralized Platform Lifecycle
Once a centralized platform reaches the peak of its S-curve lifecycle, the nature of its relationship with platform participants decreases from positive-sum to zero-sum. Generally speaking, this means that centralized platforms will turn to extracting and monetizing data from users, and compete for attention with complementary businesses developed on their platforms (for example, Twitter kills support for third-party customers). That's bad news for innovation and the continued growth of these platforms.
Over the past decade, we've seen this lifecycle play out across multiple platforms: Facebook, Twitter, Microsoft, YouTube, and Google, among others. These are exactly the platforms that basically own the internet today. Ultimately, this drives entrepreneurs, developers, and investors to be wary of these types of platforms, with many rejecting partnerships with centralized platforms. Why would powerful centralized platforms do this when they control their creations so much? Why are their creations at risk of being taken away? Think of a content creator building a brand on YouTube only to have their audience halved by a recommendation algorithm they have no control over, or a developer building a game with a global community as a Facebook plugin, only to have their first page deleted by Facebook. Three-party client API. On top of that, you also run into problems with centralization from the perspective of users who are vulnerable to security breaches and give up control of their data and privacy.
On the other hand, decentralized platforms pose no censorship risk. Entrepreneurs and developers can build with freedom and conscience. This is closely related to the first era of the Internet (1980s to early 2000s), when Internet services were mainly based on open source protocols owned by the Internet community itself. According to regulations, decentralized platforms cannot extract value from users and developers, but allow users and developers to create value. To establish this, Google associates itself with the motto "Don't be evil", and on a decentralized platform, this goes a step further to "Can't be evil".

This all sounds great, and while I think we have a compelling case for decentralized platforms, will they actually win, or even happen in reality? The first era of the internet was won through a decentralized open source protocol. The second era is dominated by centralized applications like Google, Youtube, and Twitter. I think the third era of the Internet may be decentralized. The reason is simple: it's a developer's choice. Entrepreneurs and developers, who were denied developing on centralized platforms for the above reasons, are flocking to develop on decentralized platforms like Ethereum. What would the third era of the Internet be without entrepreneurs and developers? Sure, you could argue that centralized platforms might be able to simply pay developers, but in my opinion they won't be able to outpace development on decentralized platforms, and they certainly won't be able to match the rate of innovation of completely free entrepreneurs match. This is especially true when one considers what is emblematic of the third era of internet decentralization, where entrepreneurs are able to raise capital at breakneck speed, thereby reducing the impact of centralized platforms and simply paying out to the developer community.
Blockchain technology is the breeding ground for the ultimate web3 platform. No third-party involvement is required here, and inefficiencies are largely eliminated. If we are going to encourage entrepreneurs, developers, and investors to build on these blockchain platforms, we have to make them decentralized. If you want to know more details on this topic, I strongly recommend you to read this article.
Well, a decentralized blockchain makes sense from an innovation, user privacy, and data ownership standpoint. Unfortunately, this means forgoing scalability in the blockchain's impossible triangle.
Components of the blockchain
The way these blockchains used to work was that when someone posted a transaction, miners validated it and then published it on the blockchain, but all the other miners in the network had to validate it too. Given the potentially large number of miners in a decentralized network, this obviously represents a lot of inefficient and wasted work.
However, decentralization, security, and scalability are just properties of a blockchain, determined by the components that make up that blockchain. As a basic concept, it is important to outline the following components: (1) consensus, (2) data availability, and (3) enforcement. The consensus part requires collective verification of transactions by network nodes, providing security and authenticity for data stored on the blockchain. Data availability refers to the data that the settlement layer guarantees is available for transactions on the blockchain (whether in transmission, holding state, etc.). Execution refers to the calculations required to update the blockchain with new information.
In short, the consensus part is where the records of transactions on the blockchain are agreed upon and stored. The data availability component is the space for the blockchain to add additional data at any point in time. The execution component is where new transactions are registered on the blockchain before they are validated and written to the permanent record.
The development of Layer 2 scaling solutions becomes the solution to the blockchain impossible triangle. The Layer 2 protocol can be seen as a scaling solution for the Ethereum settlement layer, which enables the settlement layer to optimize decentralization and security. Later in this article, I'll expand on the different types of scaling solutions and how they work. Layer 2 scaling solutions focus entirely on the execution and (occasionally) data availability components of the blockchain. The consensus part must essentially co-exist with the reconciliation layer to take advantage of its decentralization and security features.
image description
The total locked position of the Layer 2 protocol
There are many kinds of scaling solutions, ranging from state channels, plasma, sidechains, and rollups. For the purpose of this article, I will focus on Rollup due to the inherent limitations of state channels, plasma, sidechains, and captcha scaling solutions. In the context of the three components of the blockchain, Rollup is primarily focused on the execution layer.
Rollup type
Rollup is a solution for bundling, compressing and sending transactions to the consensus layer for verification. By validating multiple transactions simultaneously, they greatly increase efficiency while allowing Ethereum to increase from 15 transactions per second to over 3000 transactions per second (TPS) without sacrificing security.
Essentially, instead of sending transactions to Layer 1 miners, users send their transactions to Rollup servers, thereby verifying that those transactions are valid. So they are doing transaction execution outside of the Ethereum main chain, but these Rollups then publish the transaction data to the Ethereum main chain. When publishing transactions to the main chain, they inherit the security properties of Layer 1.
There are two types of Rollup with different security models: (1) Optimistic Rollup and (2) Zero Knowledge (ZK) Rollup.
- Optimistic Rollup 
Optimistic Rollup bundles hundreds of transfers and only publishes the minimum information required on-chain, without proof. This basically assumes that no fraudulent or malicious actions have been committed, hence the "Optimistic" name. Optimistic Rollup will only provide evidence if the transfer or status is contested.
The benefits of Optimistic Rollup, in addition to the obvious increase in scalability, also include EVM and solid compatibility, which means that anything you can do on Ethereum Layer 1 can be done on Optimistic Rollup.
However, the wait time for on-chain transactions can be long due to potential fraud challenges. You have to wait about 1 week to withdraw assets from an Optimistic Rollup, as this gives time for fraud to be discovered and resolved. This is an inherent problem, assuming no fraudulent or malicious acts have been committed.
Another disadvantage of Optimistic Rollup is that all witness data, such as signatures and oracle data, need to be published on the chain. This limits scalability, especially compared to zero-knowledge Rollup, which I'll discuss shortly.
Large Optimistic Rollup protocols include Arbitrum and Optimistic, which we will explore later in this article.
- Zero Knowledge Rollup 
Zero-Knowledge (ZK) Rollups differ from Optimistic Rollups in that they integrate privacy by utilizing zero-knowledge techniques. Zero knowledge refers to the ability to prove something (transaction or state) to another party without disclosing the information necessary to prove it.
Instead of sending the transaction to a Layer 1 miner, the user sends the transaction to a Rollup server that executes the transaction. The two most common proofs of verification used in ZK Rollups are ZK-SNARKS and ZK-STARKS, I will relate to ZK-STARKS in a later section. Then generate ZK-SNARKS (zero-knowledge succinct non-interactive knowledge argument) as a proof of transaction validity and publish it to the Layer 1 main chain. If you are interested in exactly what a ZK-SNARK is and how it came to be, I highly recommend reading this short article. These evidences are generated quickly, convincingly, and verified with astonishing speed. For context, hundreds of transactions can be rolled up into a proof, which takes about 5 milliseconds to verify.
By leveraging the zero-knowledge capabilities of this technology, Layer 1 miners will never know what data is in a transaction. Only Rollup miners will know the transaction data. This is a very exciting technology because it means that data can be private, even on public blockchains. This is critical for companies like Apple, who may want to keep certain entities they pay for, etc. private.
In ZK Rollup, there will be no delay when withdrawing assets, because the ZK-SNARK evidence accepted by the ZK Rollup contract has already verified the assets. This is one of the main characteristic differences between Optimistic and ZK Rollup.
As mentioned above, the advantages of ZK Rollup include faster final time, and less economic attack than Optimistic Rollup. However, ZK-SNARK proofs are computationally intense and may not be worth it for applications with little to no on-chain activity.
Later in the article, I will discuss the four main ZK Rollup protocols on mainnet, but for a complete catalog of ZK Rollup protocols, check out this link.
It is worth noting here that most ZK Rollups currently do not actually take advantage of the privacy aspects of ZK technology. Instead, they focus on the scalability aspect, i.e. proofs can be much smaller than native computation and are more oriented toward verification.
Technical comparison of Optimistic and ZK Rollup
Ethereum co-founder Vitalik Buterin has written extensively about Rollup technology and a comparison of Optimistic and ZK Rollup. Here's Vitalik's outlook for both technologies based on a technology comparison.
In general, my personal opinion is that in the short term, Optimistic Rollup may win in general EVM calculations, and ZK Rollup may win in simple payment, exchange, and other application-specific use cases, but in the medium to long term , with the improvement of ZK-SNARK technology, ZK Rollup will win in all use cases. —Vitalik Buterin
image description
Complex trade-offs between Rollup types
While Optimistic Rollups are currently more practical than ZK Rollups, ZK Rollups clearly have the potential to provide greater benefits to users simply because of their less complexity. In the next section of this article, I'll explore the future roadmap for each rollup type.
The Future of Rollups
challenges
- challenges 
EVM stands for Ethereum Virtual Machine and can be thought of as a large decentralized computer that computes every kind of task on the blockchain. It is essentially the cornerstone of the entire operating structure of Ethereum and runs the execution and deployment of smart contracts.
EVM compatibility means that another chain, such as the Rollup chain, will be able to deploy Ethereum smart contracts on said chain. Therefore, without EVM compatibility, it is impossible for another chain to run Ethereum smart contracts. EVM compatibility is obviously very beneficial, because it means that projects already deployed on Ethereum, think that DeFi giants such as Uniswap can be deployed on compatible chains. This means that it is relatively easy for compatible chains to attract users in the execution module if the user has a significant competitive advantage over the Ethereum execution module. This is also a huge advantage for compatible chains given the size of developers within the Ethereum community. Leveraging this community by being compatible with the EVM, compatible chains are able to benefit from the aforementioned developer adoption and network effects, as well as the innovations that will result in the future.
The downside of EVM compatibility stems from complexity and the associated risk of security vulnerabilities. Hence why, in general, the development of EVM compatibility has been slow on Rollup, but there have been some breakthroughs, especially on Optimistic Rollup, which I will mention later.
Another challenge for Rollup, and actually the one I'm most excited to see going forward, is straight "fiat on-ramp". "Fiat" refers to traditional currencies such as the US dollar, the Great British pound, and the Japanese yen. "On-ramp" refers to a service where you can directly convert fiat currency in exchange for cryptocurrency. The service is currently typically hosted on centralized exchanges (CEXs) such as Coinbase and Binance.
So far, there have been several bottlenecks in the process of buying cryptocurrencies, purely because it is difficult to obtain fiat currency from a traditional bank account and enter the crypto world. If you wish to interact with a decentralized exchange (DEX), the usual practice is to deposit fiat currency into the CEX, which must then be exchanged for cryptocurrency, but only to a wallet of your choice (e.g. MetaMask ), and from there interact with the DEX of your choice. This is obviously a bit of a hassle and significantly degrades the user experience. Notably, there is a project called Dharma, the only ethereum wallet on ethereum that can move fiat seamlessly between ethereum and decentralized exchanges like Uniswap, Polygon is a lower fee side chain. However, this solution only works with Bank of America and is relatively new.
Rollup's challenge is even tougher. In order to interact with cryptocurrencies while on a Rollup, you are faced with the bottleneck of getting your cryptocurrencies into the wallet of your choice, and from there, you must link your crypto assets to the Rollup itself. This is a very poor user experience and requires a lot of patience. Notably, fiat currency exchange solution Ramp recently announced a partnership with Zk Rollup’s zkSync. I will discuss this issue later in the article.
I truly believe that mass adoption of direct fiat conversion, the path from your traditional bank account directly to Rollup, will increase usage tremendously. This is why I'm so excited about their development; the enhanced user experience will undoubtedly give users a reason to no longer directly interact with Layer 1, and will perform a massive migration of markup from Layer 1 to Layer 2 execution, allowing Layer 1 Focus on consensus and security. This will be the real start of modular blockchain adoption.
It is also worth noting that in order to achieve the lowest fee rate, transactions need to be settled on the Layer 1 chain to the maximum extent. This is to distribute the fee evenly across the Rollup to many transactions. Therefore, Rollup fees can be seen as a product of Layer 1 fees, or as a product of Rollup demand. Therefore, in order to truly realize their potential to reduce fees, they need a higher level of demand than Ethereum. This is often referred to as economies of scale, and it means that the marginal transaction cost of the next marginal transaction falls.
This pretty much creates a chicken-and-egg scenario, where users are asked to significantly reduce fees, but only if fees are significantly reduced. However, I don't think this is a particular problem. In fact, this is a breakthrough because it inverts the traditional cost structure of blockchains, which typically become more expensive per marginal transaction. This is also an example of ZK Rollup outperforming Optimistic Rollup, since Optimistic Rollup will always need to include a signature for every transaction, adding another cost factor. ZK Rollup, on the other hand, does not require signatures and has better data compression, resulting in superior scalability potential.
Existing Optimistic projects
- Aritrum 

The first Optimistic Rollup I'll talk about is Arbitrum, an Optimistic Rollup protocol developed by Offchain Labs. Arbitrum will be fully released to the Ethereum mainnet in August 2021, known as the mainnet network Arbitrum One. Concurrent with the full launch, Lightspeed Venture Partners led a $120 million funding round for Offchain Labs.
Arbitrum supports all EVM languages and supports all Ethereum tools natively without any special adapters, making it fully EVM compatible. This includes deploying smart contracts and dApps. However, this is all possible thanks to the Arbitrum virtual machine, although this has never been exposed to developers or users.
This EVM compatibility has enabled some of the largest dApps in the Ethereum ecosystem to deploy to Arbitrum so far, including DeFi giants Uniswap, SushiSwap, Aave, Curve, and 1Inch. A full list of ecosystems of wallets, dApps, etc. can be found at this link. The result of these deployments is a total value locked on the network of over $2.65 billion.
From a throughput standpoint, Arbitrum One theoretically has a maximum TPS of 40,000, although in practice the highest recorded TPS is currently around 49. The cost-effectiveness of using Arbitrum One compared to the Ethereum mainnet depends largely on the type of transfer, e.g. for normal transfers, Arbitrum One costs about 36% of the Ethereum mainnet fee, while Uniswap v3 transactions cost about 6.9%.
- Optimistic 

Optimistic is the second Optimistic Rollup I'm going to talk about today, and it's launching on mainnet in July 2021. Since launch, Optimism has amassed $466 million in locked volume and processed over $2.2 million in trades.
According to Optimism, their Optimistic Rollup solution has helped save over $100 million in gas fees when transacting with the Ethereum mainnet, saying you can transact within milliseconds and save 10-100x on fees. The network itself has over 100,000 unique wallet addresses (users).
In November 2021, Optimism will go live with the EVM equivalent on Optimistic Ethereum, replacing the previously used Optimistic Virtual Machine solution. EVM equivalence is fully compliant with the Ethereum stack. Of course, every debugger, toolchain, node implementation allows deploying smart contracts and dApps.
This EVM equivalence enables many key players in the Ethereum ecosystem to deploy to the Optimism network. These key players include, but are not limited to, Uniswap, Synthetix, and 1Inch.
It is worth noting that currently Optimisticism operates without evidence of fraud. In other words, this means that the technical aspect of Optimistic Rollup is not yet on.
Existing ZK Rollup projects
- StarkNet 
The first ZK Rollup project I'll be touching is StarkNet, which is StarkWare's Ethereum mainnet ZK Rollup. StarkNet Alpha (an unaudited version of StarkNet) was launched on mainnet on November 29, 2021 and deployed to testnet in June 2020, a self-explanatory instance of a blockchain powered by a newer version of the underlying software , for testing and debugging.
The predecessor of StarkNets, StarkEx, was launched on the mainnet in June 2020 and provides support for general smart contracts. The applications deployed on StarkEx are dYdX, ImmutableX, DiversiFi and Sorare. They have processed 65 million transactions so far, with a cumulative transaction volume of $215 billion across the four protocols. The StarkEx network also shows that the transaction fee rate is 9,000 TPS, and the transfer fee rate is 18,000 TPS, which is equivalent to an increase of about 600 times in the scalability of Ethereum mainnet execution layer transactions.
StarkNet follows the path of its impressive predecessor, offering general-purpose smart contracts on a fully composable network. Composability refers to the ability of applications to coordinate, develop and interconnect with each other. Other StarkNet contracts and via L1<>Layer 1 contracts for L2 messaging all support this composability. StarkNet will also be permissionless, meaning it enables dApps to leverage StarkNets for computation at unlimited scale without requiring permission to deploy on the network. However, currently StarkNet Alpha is only available for whitelisted dApps.
One of the biggest benefits of StarkEx and StarkNet in terms of competing with ZK Rollup is their ZK-STARK (Zero-Knowledge Scalable Transparent Argument of Knowledge) technology. ZK-SNARKs and ZK-STARKS are both privacy-enhancing technologies because they reduce the amount of information required to communicate between users. They are also scaling solutions, as they allow proofs to be verified at a faster rate than native Ethereum execution modules, since they do not contain the full information of non-specialized systems. However, while ZK-SNARKS requires a trusted setup phase, ZK-STARKs use publicly verifiable randomness to create trustless, verifiable computing systems. The upshot is that ZK-STARKs are more scalable in terms of computational speed and size than ZK-SNARKs.
Besides that, ZK-STARKS is robust to computationally unbounded detectors due to strong cryptographic primitives such as functions. This means that the verifier has zero chance of being confident about the wrong ZK-STARK. Result: ZK-STARKs are post-quantum because their security does not depend on the computational power of the prover. For more details, check out the tweet thread below explaining how ZK-SNARKS and ZK-STARKS compare in this context.
However, StarkNet is not directly compatible with EVM. Instead, they developed a STARK-optimized programming language called Cairo. Cairo is used to write provable programs on the blockchain, enabling developers to use verification techniques. A software solutions team called Nethermind then developed a solution that ported Solidity (the EVM language) to Cairo, so there is an indirect EVM compatibility. Both STARK and Cairo are developed internally by StarkWare and power all of their production-grade applications.
image description
text
- zkSync 
The second ZK Rollup project, we look at zkSync, which is the mainnet ZK Rollup from Matter Labs. A few months ago, Matter Labs received a $50 million investment from a16z to help them bring ZK Rollup scalability to Ethereum. zkSync was launched to mainnet in June 2020, mainly for scalable payments. This means users can deposit to the network and transfer funds between other zkSync accounts for a fraction of the cost of Ethereum.
So far, zkSync has processed 4 million transactions with a total locked volume of $24 million. In July 2020, the network added NFT functionality via zkNFT.
Matter Lab's iteration of zkSync, zkSync 2.0 is scheduled for mainnet release and aims to have fully composable smart contracts on ZK Rollup. zkSync 2.0 will introduce zkEVM, a virtual machine that simulates an environment like Ethereum, making it compatible with the EVM and enabling Ethereum smart contract deployment. The zkEVM testnet has been successfully launched with UniSync, a fork of Uniswap V2, to demonstrate its capabilities. Since its launch in October, UniSync has processed more than 3 million transactions on its testnet.
A huge development for zkSync is the announced partnership with Ramp to provide fiat on-ramps directly on the zkSync protocol. This is the solution to one of the main shortcomings of Rollup in general and will undoubtedly drive mass adoption of the zkSync network.
The zkSync roadmap below is similar to StarkNet. We have seen the first phase of bringing zkSync to mainnet. zkSync 2.0 will complete Phase 2 when deployed to mainnet. The final stage, censorship resistance, will eventually require platforms to decentralize and become permissionless, which may mean the introduction of governance tokens. zkPorter, a staking verification chain providing off-chain data availability for zkSync 2.0, is expected to have its own token.
- Loopring 
Loopring is a ZK Rollup protocol that allows the development of highly scalable exchange and payment solutions, allowing high-throughput, low-cost transactions and payments on Ethereum. Loopring 3.0, their first ZK Rollup iteration released to mainnet in December 2019, is the first zero-knowledge Rollup DEX protocol deployed to Ethereum mainnet. The latest version of Loopring, v3.6, was deployed to mainnet in December 2020.
To date, Loopring has more than $650 million in total value locked in the protocol. Loopring themselves believe that their ZK Rollup throughput is about 1000 times that of Ethereum, or up to 2,025 transactions per second, which greatly enhances the user experience of the native Ethereum execution module. Loopring utilizes ZK-SNARKS to achieve this, just like zkSync.
Loopring is the only ZK Rollup protocol with its own smart wallet, available as an app download on iPhone and Android. It allows you to store on Rollup of crypto assets and interact with their ZK Rollup functions, transactions and payments. However, it currently costs around $300 to set up a Loopring native wallet. This is expected to be replaced by the release of the completely free Loopring wallet in the near future. In August 2021, Loopring announced that it now supports NFT minting, trading, and transfers directly on its ZK Rollup protocol.
image description
text
text
- Polygon Hermez 

In August 2021, the Ethereum extension protocol Polygon announced the acquisition of Hermez and merged with Hermez. Polygon is a protocol and framework for developing and connecting Ethereum-compatible blockchain networks, with the goal of aggregating scalable solutions on Ethereum to support a multi-chain Ethereum ecosystem. They basically support the modularity of the Ethereum ecosystem through the ability to develop execution and data availability modules.
Hermez, itself part of the Polygon ecosystem, is an open-source ZK Rollup secured by the Ethereum network and optimized for secure, low-cost token transfers. By using zero-knowledge technology, Hermez said they were able to increase throughput by 133 times over the Ethereum mainnet while reducing token transfer costs by more than 90%.
Below is a visual diagram made by Hermez that outlines the general Rollup concept we discussed in this article, while explaining how to batch 2000 transactions in a single Hermez network.

image description

secondary title
text
- EIP-4488 
The one big thing in this article (and if you've gotten this far, I'm assuming you're really interested in learning about ZK Rollups!) is EIP-4488. For those unfamiliar with EIPs, they stand for Ethereum Improvement Proposals, which are standards for specifying potential new features or processes in Ethereum. Anyone within the Ethereum community has the ability to create an EIP, although full consent is required for implementation.
In summary, EIP-4488 reduces the call data cost from 16 gas per byte to 3 gas, and the call data per block is capped to reduce security risks. Essentially, this means lower overhead costs for Rollup, which means lower fees for Rollup's end users. For a more detailed look at EIP-4488, check out the following thread on proto.eth on Twitter.
- Sharding 
conclusion
conclusion
Rollups are undoubtedly critical to the future of blockchain, arguably the network for everyday users of dApps to interact with blockchain technology. These users may not even know which rollup they are using, just like the internet, we often don't know which cloud hosting service a website is using.
It's for this reason that I'm very excited about Rollup. We're still very early in their lifecycle, so the technology is complex and in some cases missing features. This means we'll be able to watch their development, and possibly even speculate on various Rollup technologies in the coming months and years.
If you want to learn more, or hear about Rollup's technical progress and adoption, you can follow the following people on Twitter:
- @likebeckett 
- @epolynya 
- @SwagtimusP 
- @EliBenSasson 
- @l2beatcom 


