ZK-Rollups: The Future of Layer 2 Scaling Solutions

Blockchain technology has transformed the world since Bitcoin’s inception 14 years ago. Originally designed to create a global, permissionless network for transacting value, blockchain has since evolved to encompass monetary programmability and has given rise to decentralized finance, non-fungible tokens, and decentralized social networks, among other innovations. However, despite these advancements, we have only scratched the surface of what blockchain can achieve.

Blockchain is powerful due to several reasons. Firstly, it offers a transparent and decentralized system that enables trust between parties without requiring intermediaries. Secondly, it provides immutability and security, as data stored on the blockchain is cryptographically secured, and any changes made to the data are recorded in a tamper-evident manner. These characteristics make blockchain technology an ideal solution for applications that require trust, security, and transparency.

Despite the numerous benefits of blockchain technology, scalability remains one of the most pressing issues for its widespread adoption. Currently, Ethereum can handle over 1 million transactions per day, but the average transaction per second count is only 12-13. Moreover, high demand can cause gas prices to reach 100 gwei.

 

Ethereum’s roadmap to achieve ETH2.0, which promises to address scalability issues by providing over 100,000 transactions per second with reduced gas fees, is still years away.

As we wait, market participants have developed several Layer 2 (L2) scaling solutions to address the issues of slow development and scalability. These solutions aim to achieve higher throughput, reduce transaction costs, and increase the overall efficiency of using blockchain technology. In this document, we will explore rollups and their next evolution, the Zero Knowledge rollup, as the most promising scaling solutions for Ethereum.

Adoption, History, and Metrics

Rollups were first proposed by Barry Whitehat in 2018 and have since become a hugely popular method of interacting with Ethereum. The significant gas savings have led many sectors, most notably DeFi, to move much of their on-chain activity to Layer 2. For example, on February 13th, the Arbitrum-based on-chain futures exchange GMX earned over $5.6m in revenue in a single weekend, outpacing the revenue earned from fees on the main Ethereum network. On February 21st, Arbitrum itself processed more transactions than Ethereum in a single day. This is a notable milestone in the adoption of Layer 2 solutions.

With the gas savings available on Layer 2 compared to Layer 1 ETH, it was inevitable that adoption would take place.

 

Source: L2fees.info

Today, all Layer 2 rollups have a combined total value locked of over $3 billion. This number is set to continue growing with time.

 

Source: l2Beat

How Do Rollups Function?

A rollup is a layer 2 scaling solution built on top of an existing network such as Ethereum. Essentially, rollups work as follows:

 

Source: Bitnovo

  • Layer 2 data is stored on a sidechain, a separate blockchain that communicates with Ethereum through bridges. Generally, these sidechains are compatible with the Ethereum Virtual Machine (EVM), which allows users to use the same wallet addresses as the ETH main net and makes it easy for L1 protocols to be adapted to the L2 environment.
  • The L2 sidechain publishes proofs of data for every transaction taking place in its environment through a series of bundled-up transactions submitted as one block on L1. This provides a significantly cheaper and more immediate method of scaling Ethereum compared to waiting for the complete development of ETH2.0.
  • A smart contract is developed on Layer 1 to store all funds from Layer 2. The contract uses a calldata function to retrieve transaction information from the sidechain (L2). Since only proofs of data validity are being called from layer 2, and not the full data itself, gas costs are significantly reduced.
  • In a rollup, data is stored on Layer 2 using a Merkle tree structure. The Merkle tree tracks account balances and states, allowing for secure transaction processing. The majority of computational work is done off-chain, and only the final state of transactions is submitted to the main chain. This results in faster processing times and lower costs, making rollups increasingly popular in Ethereum.
  • Since the L2 handles compute power off-chain and submits finalized states as bundled transactions on L1, this allows Ethereum to be infinitely scalable without requiring any changes to the L1 code. Despite this, the network’s security remains guaranteed because blocks are immutably appended to the Ethereum ledger through decentralized consensus.

There are currently two main types of rollups being used: Optimistic Rollups and ZK-Rollups. These differ in how they compute and submit proofs of transactions to Layer 1.

Optimistic Rollups

Currently, the most popular rollups are Arbitrum and Optimism, both of which are what are known as Optimistic Rollups. In this type of rollup, the state of all transactions is published on the main net without being checked by the rollup’s L1 smart contract. Users trust that the transactions are computed correctly and in sequence, hence the name “optimistic”. This allows for extremely fast transaction finality.

However, to introduce some level of security against incorrect transactions, there is a one-week delay in the time transactions are made on L2 and submitted to L1, during which users or operators of the L2 can call out, isolate, and revert incorrect blocks. As a result, the actual withdrawal process of optimistic rollups to Layer 1 finality is quite slow.

Optimistic rollups require posting the full transaction data on the L1 chain, but this is still a significant improvement on Ethereum’s scalability due to the bundling of transactions. However, if L2s achieve mass adoption, this could lead to higher gas fees for the entire ETH network due to rising block space needs. In short, block space may not be used in the most efficient way when considering the long-term horizon.

From a user’s perspective, the experience is quite seamless. It is possible to bridge funds onto an L2 in a matter of minutes, transactions on the L2 itself are unbelievably cheap, and transaction finality takes no more than a few seconds. Furthermore, full EVM compatibility has allowed popular L1 protocols such as Uniswap, Curve, and Aave to easily integrate with L2s.

Currently, bridges exist that allow funds to be withdrawn from the L2 in a few minutes. However, these bridges can come with their own security flaws as they rely on their own liquidity and centralized consensus mechanisms to ensure a quick bridge experience. This complexity has led to a notable year of bridge hacks in 2022.

 

Source: Token Terminal

However, the technology behind optimistic rollups has definitely achieved its goal of scalability. Arbitrum, the rollup with 50% market share of all L2s and a TVL of $1.88 billion, boasts up to 4,000 transactions per second. Optimism, the second largest L2 with 30% market share and $875 million TVL, can process up to 200 transactions per second.

To recap:

Pros:
  • Cost-effective: Optimistic rollups can process transactions much faster and cheaper than Layer 1 blockchains, making them a more cost-effective solution for users.
  • More scalable: By moving the majority of computation and transaction processing off-chain, optimistic rollups can increase the overall throughput of the network and make it more scalable.
  • Flexible: Optimistic rollups can be used for a wide range of applications and can be easily integrated with existing Ethereum infrastructure.
Cons:
  • Long withdrawal times: When users want to withdraw their funds from an optimistic rollup, there is a delay period during which disputes can be raised. This delay can last several days or even weeks, which can be inconvenient for users.
  • Centralized consensus: Layer 2 sidechains are generally maintained by a centralized group of operators, who may be able to influence the sequencing of transactions if they so wished
  • Inefficient use of block space: Although optimistic rollups achieve scalability, because they must submit the full data of every transaction on chain they can take up quite a large amount of block space which may lead to overall higher gas fees on ETH L1

Since the widespread adoption of Optimistic Rollups developers have been hard at work on delivering the next evolution of Layer 2, the ZK-Rollup

ZK-Rollups

Zk-Rollups (Zero Knowledge) are a new type of scaling solution currently under heavy development and research. As a rollup, it achieves scalability by bundling up transactions into single blocks appended to L1. However, it utilizes a different method than optimistic rollups to verify and append transactions onto L1.

ZK-Rollups utilize zero-knowledge proofs to enable faster and more secure transactions on an L2 network. In a ZK-Rollup, every change in the state of the sidechain must be accompanied by a complex mathematical computation called a succinct zero-knowledge proof (SNARK), which is then verified by the rollup contract on L1. This proof demonstrates the existence and correct signing of the transactions without revealing the underlying data. As a result, the state of accounts can be finalized on L1 much faster than with an optimistic rollup, and operators cannot manipulate or publish invalid states of accounts. Users will, in turn, be able to withdraw their funds from L2 into L1 in a matter of minutes, a huge improvement over the week-long waiting period associated with Optimistic rollups.

This gives ZK-rollups two main advantages in my opinion.

Firstly, ZK-Rollups are private by default. Because the full data of transactions is not posted on L1, but only the SNARK (proof of the correctness of the underlying data), wallet addresses and their transactions are never fully revealed on L1. This contributes to the censorship-resistant and immutable nature of blockchain technology. This also adds security for users who may not want their entire financial history available for malicious actors to take advantage of.

Following this, the second advantage of ZK-Rollups is that they are a much more efficient use of block space on L1. Because only proofs of validity are posted to L1, instead of all the transactions themselves, there is quite a lot of block space saved when performing transaction finality. In the long term, this would likely lead to more cost savings for gas fees on ETH L1.

ZK-Rollups also offer unmatched TPS compared to other L2 solutions. For example, zkSync 2.0 promises up to 100,000 transactions per second, while Starkware currently handles up to 9,000 transactions per second. This would bring Ethereum to a similar processing speed as Visa or Mastercard.

Currently, most ZK-Rollups are still in test net due to the complexity of the mathematics behind producing zero-knowledge proofs in the blockchain context, while being compatible with main net consensus mechanisms. For example, one main hurdle being faced by all ZK-Rollup developers has been the development of a fully compatible ZK-EVM, which would allow full compatibility with the Ethereum Virtual Machine yet still enable the privacy-preserving nature of zero-knowledge proofs. Developers have been working around this by creating EVM-Equivalent protocols, which require extra work for protocol developers to edit their code in such a way as to be able to deploy on a ZK-Rollup while still working with L1.

However, there have recently been developments in the space which make ZK-EVMs a reality. For example, Polygon is set to release their ZK-EVM main net beta on March 27th, while zkSync 2.0 has launched their fair onboarding alpha that allows developers to deploy their protocols on main net before the full user-enabled launch.

Although there are advantages to ZK-Rollups compared to Optimistic Rollups, there are a few disadvantages associated with ZK-Rollups.

Firstly, the costs associated with computing and verifying validity proofs that will be posted to L1 can be quite high. This can have the effect of increasing fees for users of the L2.

Secondly, specialized hardware with strong compute power is required to produce validity proofs for transactions. This may lead to centralized operation of the rollup by a small number of participants because of the cost associated with obtaining and maintaining such high-spec nodes.

Because there is the potential of centralization among network operators, it may be possible for them to influence the ordering of transactions.

Zk-Rollups are still in a heavy R&D phase; however, these issues may be resolved with further development.

To recap:

Pros:
  • Privacy by default: ZK-Rollups submit validity proofs of transactions to L1, not the full data itself. This makes all transactions private.
  • Efficient use of block space: Submitting proofs instead of the full underlying data means less block space is needed to append the L1 blockchain. This has the effect of reducing load on L1 and potentially scaling down gas fees.
  • Less need for trust: Unlike optimistic rollups which rely on a one week period for operators to prove any frauds, SNARK calculations use mathematics to prove the validity of transactions with certainty
  • Fast withdrawal times: Because SNARK’s are used to prove the validity of transactions on layer 1, funds can be withdrawn in minutes to L1

Cons:

  • High computing costs: The costs of computing zero knowledge proofs for every transaction may be quite high, which may lead to higher fees for users if computations are not optimized
  • Hardware requirements may lead to centralization: High end hardware with a lot of compute power is needed to produce zero knowledge proofs for transactions. Because the cost of entry as an operator can be high, this may lead to a situation where only a few parties are maintaining the L2. This may lead to issues of operators influencing the order of transactions. If the L2 becomes centralized, there is also the risk that malicious operators could attempt to censor users or freeze the rollup state.

Uses Cases of ZK-Rollups

The use cases of ZK-Rollups are numerous. Besides the obvious scaling and privacy improvements that can be brought to L1 protocols, there are a few specific applications of ZK-Rollups which I personally am excited by.

DEX’s & Alpha Decay

ZK-Rollups can significantly improve the efficiency and scalability of decentralized exchanges, which are often burdened by slow transaction speeds and high fees due to the complexity of their operations. By leveraging ZK-Rollup technology, decentralized exchanges could achieve higher transactions per second and lower fees, leading to increased liquidity and a faster trading experience similar to centralized exchanges. While optimistic rollups already offer these benefits, ZK-Rollups provide the additional advantage of less alpha decay for traders. The privacy afforded by zero-knowledge proofs would enable more effective concealment of profitable trading strategies from the public, giving traders and market makers a better edge.

This use case is especially important today in the wake of the FTX disaster. Users are flocking to decentralized exchanges in an effort to avoid any potential fraud or theft of funds that is possible with custodianship, with only L2-based dex’s such as dYdX offering a similar trading experience to a centralized exchange. Furthermore, a few mainstream media outlets such as Bloomberg and The New York Times have filed to publicly dox all creditor information. This can lead to a dangerous situation, as there is the potential to leak customer information, account balances, and on-chain addresses of users. This could lead to the piecing together of the financial history of users and potentially dangerous situations for their personal safety.

By utilizing ZK-Rollups, a decentralized exchange can tackle both issues by creating a CEX-like trading environment without the risks of custodianship that may entail fraud or the collection of private information.

Decentralized Identity Management

Today, there have been a few attempts at constructing on-chain identities that can be ported across protocols for specific benefits and access. For example, there are numerous token-gated stores on Shopify, real-world events, and Discord communities that are only accessible by NFTs. There are also attempts to use blockchain to verify credentials such as diplomas or land ownership being built now. Nonetheless, the problem with these identity solutions is twofold. Firstly, NFTs are not private by default and can be quite costly to mint on-chain. Secondly, verifiable credentials have limited composability due to verification on-chain being too expensive to be used across multiple protocols for various purposes.

Zk-Rollups introduce privacy as a default for any identity management system. They can solve the issues mentioned above by proving that information is verified, rather than sharing the information with a verifier. Next, Composability can be significantly improved, as new types of verifiable credentials can be pieced together through on-chain history. For example, it would be possible to create decentralized credit scores, DAO governance reputations, private P2P communication channels for social applications, and much more, in a cheap and completely privacy-preserving way. This would ensure users have control over their own data and create a safer environment for overall user identity. For a more detailed explanation of these ideas, refer to Polygon ID.

Enterprise Blockchain

During my time at SNGLR, I have learned a lot about the attempts made by enterprises to adopt blockchain for business activities. Unfortunately, these attempts have mostly been huge failures.

Blockchain offers several key benefits to enterprises, including creating an immutable record of transactions, automating activities through smart contracts, and simplifying value transfer across borders. However, the low transaction speed per second, high fees, and public nature of major blockchains like Ethereum have hindered true adoption among enterprises.

As a result, enterprises have mostly taken the approach of building private blockchains for their own use. These are generally built on some version of Hyperledger Fabric and hosted on AWS or similar hosting services. Yet, this brings with it a whole host of problems, namely:

  • High cost of setting up and maintaining blockchains
  • Centralized validators and nodes leading to security risks and the ability to manipulate the ledger
  • The need for large scale consortia to bring industry competitors together to adopt blockchain. As competitors, their incentives are usually not aligned with each other, making this a difficult task.

Due to these issues, private enterprise blockchains have become nothing more than glorified databases for companies to maintain. The costs of maintaining these blockchains often outweigh any benefits they may have received.

One high-profile case of an attempt at enterprise blockchain is the IBM-Maersk TradeLens platform, which aimed to use blockchain for tracking shipping across nations. The platform gained traction, with over 94 different participants including nations and shipping companies adopting TradeLens. However, the operational costs proved to be too high, and the platform was recently shut down

This brings us to ZK-Rollups.

Zero knowledge proofs can address all the issues faced by past enterprise blockchain attempts. Firstly, the private nature of ZK-Rollups allows enterprises to keep sensitive data private from competitors and the public while harnessing the power of immutable smart contracts. Another huge benefit is the cost savings and higher transactions per second offered by rollups, which would mean low costs for businesses using blockchain. Thirdly, because ZK-Rollups are becoming EVM compatible, enterprises would be able to interact with other public applications if required. Finally, enterprises can rely on decentralized consensus mechanisms to maintain the blockchain, providing much higher security for the ledger and eliminating the prohibitive cost of private blockchains.

Overall, I believe that ZK-Rollups are essential enabling technology for enterprise adoption of blockchain. This is one of the narratives I am keeping an eye on for the coming year.

Conclusion

In conclusion, the development of ZK-Rollups is a major breakthrough in the scaling solutions for Ethereum. Even though Optimistic Rollups have already shown their potential, ZK-Rollups offer several benefits that make them a more efficient, private, and scalable solution. With these advantages, ZK-Rollups could have significant implications for various applications, from decentralized exchanges to enterprise blockchain. As a result, ZK-Rollups could help drive the adoption of blockchain technology by making it more accessible, secure, and affordable for businesses and individuals. Overall, ZK-Rollups represent a promising step towards the realization of the full potential of blockchain technology, and should be monitored in it’s adoption and development.

Karim is a passionate crypto enthusiast, bitcoin miner, and musician with more than four years of experience in blockchain technology. He has been actively involved in the world of Web3 and digital assets, helping clients to achieve their goals as a consultant for SNGLR Digital. Karim is currently serving as a consultant and investment analyst at SNGLR Group, where he brings his expertise and insights to the table to help businesses and individuals navigate the complex world of blockchain and cryptocurrency.