UNDERSTANDING ZK-ROLLUPS ON ETHEREUM AND ZK COMPRESSION ON SOLANA

KENTO
9 min readJul 7, 2024

--

Crypto currency and blockchain technology emerged to solve problems that local finance industries couldn't. Due to increasing development and simultaneously increasing scalability, this technology has done more than just solving basic financial problems. It is with this problem-solving mindset that technologies such as Zk-Rollups and compression were developed.

The increasing scalability experienced is unfortunately not accompanied by the capacity of the network to handle it. Therefore, carrying out a transaction on either the Solana or Ethereum network is slower, time consuming and sadly, more expensive. 
For better understanding, the Ethereum network for example can currently process about 15-30 transactions per second (TPS) but it handles millions of transactions daily. In contrast, traditional financial technologies can handle thousands of transactions per second. 
Despite being closely related in their basic problem solving, Zk-Rollups and Compression have some differences. This article deeply explores Zk-Rollups and Zk Compression, thus highlighting their differences and similarities.
Let's get started.

INTRODUCTION TO ZK-ROLLUPS ON ETHEREUM

WHAT ARE ZK-ROLLUPS?

Zero-knowledge(Zk) Rollups are emerging layer 2 scaling solutions that take computation and state-storage off the main blockchain (i.e layer 1) allowing for faster transaction processing. Afterwards, the results are bundled for easy storage and recording on the main blockchain. By doing so, Zk-Rollups help decongest the main blockchain thereby significantly increasing the throughput of the mainnet.
Zk-Rollups can be likened to diversion that frees up traffic on a freeway. Thus, there is an easy flow of transactions on the main blockchain.
We will be seeing details of more in later sections.
For now, let us look at how Zk-Rollups work on the Ethereum network.

HOW DOES ZK-ROLLUPS WORK ON THE ETHEREUM NETWORK?

The Ethereum network serves as layer 1 for the Zk-Rollup. The Zk-Rollups is just an off-chain protocol that operates on the Ethereum network and moves computations off the Ethereum mainnet. 
The working process of Zk-Rollups can be divided into two: Zk-Rollups Architecture and Execution Process

ZK-ROLLUPS ARCHITECTURE
There are features of Zk-Rollups that allow it to operate the way it does. The overall state of Zk-Rollups is maintained by smart contracts on the Ethereum network.

FEATURES OF ZK-ROLLUPS

  • On-chain contracts: These are smart contracts deployed and run by the Ethereum mainnet. It is these on-chain contracts from the mainnet that handles deposits, withdrawals and tracks users transactions. In addition, Zero-knowledge Proof (ZKP), a verifier contract, verifies the transactions submitted by the block producers.
  • Off-chain Virtual Machine (VM): This is where the “off-chain” execution of transaction and state storage occurs. It serves as the “layer 2” of the Zk-Rollup. Just like on-chain contracts, they also use ZKPs to ensure that the computations on the VM are accurate and legitimate.

One could say that Zk-Rollups have a symbiotic relationship with the Ethereum mainnet. It relies on the mainnet for data, security and approval of a transaction. On the other hand, without Zk-Rollups transactions on the Ethereum mainnet will be congested and slow.

EXECUTION PROCESS
Here is a step-by-step follow-up of the execution process of Zk-Rollups on the Ethereum network.

  • Firstly, the users submit transactions to the Zk-Rollup operators. These operators collect and execute multiple transactions and bundle them up to be included in the next batch.
  • Afterwards, the operators submit the batched data to the on-chain contracts from the Ethereum mainnet. This data is passed as a “calldata”. By doing so, there is a reduction in gas fee.
  • The “Merkle tree” represents a state of layer 2 accounts and balances in the Zk-Rollup state. A Merkle tree is a tree with leaf nodes that is a representative of a cryptographic hash node each. It is used for a faster verification of blockchain data and transfer of this data from one node to another.
    The operator node creates two Merkle roots: a batch root and a new state root.
  1. The Batch root contains all the transactions in a bundled batch. This root is transferred to the Zk-Rollup contract for verification of the transactions in the batch without the involvement of the Ethereum mainnet.
  2. The New state root on the other hand is only generated by the operator node when the state of the rollup changes as a result of the newly executed transactions. The operator node then computes and submits this new state root to the on-chain contract.
  • After submission to the on-chain contract, the state of the rollup’s Merkel tree after a new state root is generated must be verified by the operator. To do this, the Zk-Rollup operator has to provide the Ethereum mainnet with a validity proof. The validity proof is simply a cryptographic hash which verifies the correctness of a transaction. Validity proofs are also called zero-knowledge proofs because they allow the operator to verify the correctness of a data without actually revealing the data itself.
    Thus, through validity proofs, operators can verify off-chain transactions without the involvement of the Ethereum mainnet.
    There are two forms of validity proofs:
  1. ZK-STARK (Zero-knowledge Scalable Transparent Argument of Knowledge).
  2. ZK-SNARK ((Zero-Knowledge Succinct Non-Interactive Argument of Knowledge).

Although each has its own unique features, they both verify the correctness of off-chain data quickly in Zk-Rollups regardless of the size.

Source: https://messari.io/report/the-onchain-economics-of-zk-rollups

ADVANTAGES OF ZK-ROLLUPS

  • It prioritizes users' privacy by using validity proofs instead of exposing transactional data.
  • It reduces the cost of storing data.
  • It significantly improves the TPS by processing data off-chain.
  • It has good and efficient security protocols as it uses the Ethereum network.

DRAWBACKS OF ZK-ROLLUPS

  • It involves a significant amount of technical cryptographic computations which might be difficult to implement.
  • Due to its reliability on the Ethereum mainnet, Zk-Rollups may be subject to any drawbacks from the Ethereum network. For example, restrictions or congestion on the Ethereum mainnet can affect Zk-Rollups.
  • They could potentially increase the risk for an attack if they are not correctly implemented or configured.

ZK-ROLLUPS Current USE CASES

  • KYC and AML (Anti-Money Laundering) processes employ Zk-Rollups to allow users verify their identity without revealing private data. This has been seen in various industries and startups to ensure privacy protected identity checks.
  • Immutable X, a leading NFT marketplace uses Zk-Rollups to reduce the cost of storing NFTs. By using Zk-Rollups, they increased the TPS for minting and trading NFTs.
  • In DeFi industry, Loopring utilises Zk-Rollups solutions thereby offering uses an increased throughput, low-cost and fast DeFi related transactions.
  • Potentially, Medicalchain can implement Zk-Rollups into the healthcare system. Considering the sensitivity of medical records, this will enable a safer storage. In addition, numerous healthcare providers can have access to these records without exposing patient's private data.

INTRODUCTION TO ZK COMPRESSION ON SOLANA

WHAT IS ZK COMPRESSION?

Zero-knowledge (ZK) compression is a primitive developed and introduced by the Solana (SOL) blockchain that allows data to be compressed and stored on the Solana network. Therefore, it allows applications on the Solana network to scale.
In June 2024, Light Protocol and Helius Labs launched this cutting-edge technology. Upon launch, the Zk compression was officially released as a layer 1 scalability technology. Understandably so, as it is basically an algorithm used as a foundation for other similar cryptographic algorithms.

https://x.com/LightProtocol/status/1804241026334548366?t=VNUb1jYf3CFtD6q4c2PGbQ&s=19

HOW DOES ZK COMPRESSION WORK ON THE SOLANA NETWORK?

There are two processes that mediate the operation on Zk compression on the Solana network.

  • Compression: Solana network is a decentralized blockchain that allows developers to store data in data storage units called “accounts”. However, to store data in an account, users have to pay a certain amount of SOL, referred to as “rent”. Logically, the amount of rent is determined by the size of the data to be stored. Another problem with scalability. With this compression technology, developers can compress the on-chain state of tokens or account data and store them. The rest of the data can then be stored in off-chain storage units which are cheaper. This reduces the cost of storing state roots on-chain by order of magnitude while maintaining the security and integrity of Solana “layer 1”.
  • Zero-knowledge Proofs: Zk compression protocol uses validity proofs like Zk-Rollups which cryptographically ensures the correctness and validity of the compressed state.

FEATURES OF ZK COMPRESSION

Here are the core features of Zk compression protocol:

  • Minimal state cost: Allows for scalability of apps to millions of users by storing on-chain state on cheaper account space.
  • L1 security and performance: It guarantees the same magnitude of security and performance as the Solana “layer 1”.
  • Composable: It allows for interaction between other states, programs and applications on the Solana network.

ADVANTAGES OF ZK COMPRESSION

  • It operates on the “layer 1” blockchain level which allows developers to compress their on-chain state.
  • It is a highly scaling solution. It reduces costs by up to 5,000 times.
  • It uses validity proofs just like Zk-Rollups.
  • It protects users' privacy like Zk-Rollups.
  • It does not require high technical cryptographic computations.

DRAWBACKS OF ZK COMPRESSION

  • Part of users data is stored on an off-chain protocol.
  • It has a transaction size limit of 1232 bytes. Transactions bigger than this size will fail.
  • The use of a “layer 1” blockchain poses the risk of congestion.
  • In a situation where there is congestion, users are asked to increase their priority fees.

ZK COMPRESSION USE CASES

Zk compression is a novel technology. Therefore, it hasn't seen a lot of use cases.
During the launch, however, the CEO of Helius Labs, Mert Mumtaz explained that Zk compression will reduce the cost of storage 5,000 times. 
Highlighting a use case he used, he said,
“Take an airdrop to 1,000,000 users. This today would cost over $260,000 for state alone. Now, it’s $50 — 5,200x cheaper.“
With this in mind, it can be foreseen that Zk compression will see a lot of use cases in gaming, NFT marketplaces and projects, Web3 platforms and so on.

ZK-ROLLUPS VS ZK COMPRESSION

Both technologies have emerged to solve problems that come with overwhelming scalability. However, there are some ways in which they differ from on another. Here are some key peculiarities that make them distinct.

  • Zk-Rollups are built on Ethereum while Zk compression is a primitive Solana-based technology.
  • Zk compression operates and executes its processes on the main “layer 1” chain. Zk-Rollups, on the other hand, operates on the “layer 2” chain. However, it is interwoven with the mainnet.
  • Concerning the operational method, Zk compression uses a compression algorithm that simply “compresses” data on-chain thus reducing the cost of storage. With Zk-Rollups, the operator bundles data into batches that are then transferred as calldata on the Ethereum mainnet.
  • Zk-Rollups can carry out security checks without involving the Ethereum mainnet while ZK compression relies on the Solana network for its security.

The launch of the Zk compression protocol, sparked a lot of critical reviews from blockchain experts and developers. While some sang its praises, others outrightly disregarded it. 
Ryan Berckmans an Ethereum investor said, "Their new product is actually an L2. L2s are a winning model”.
With this statement in mind, here are some of the similarities:

  • They are both scaling solutions.
  • They have a mainnet layer from which they both rely on.
  • They both use validity proofs for security.
  • By using validity proofs, they both ensure privacy by protecting user data.

CONCLUSION

While both technologies are promising, Zk compression is more promising in my opinion.
The main reason for this is the ease of usage that Zk compression presents. The age we live in is full of individuals that are not favored by time to fully grasp the intricacies of Zk-Rollups. 
Also, a greater population of developers and users of these technologies are modern generation individuals. These individuals are used to automation and Zk compression is closer to that than Zk-Rollups.
Finally, the novel technology presented by Solana through Zk compression gives room for more innovation and emergence of improved scaling solutions in the near future.

REFERENCES

https://ethereum.org/en/developers/docs/scaling/zk-rollups/

https://bitquery.io/blog/understanding-zk-rollups

https://www.antiersolutions.com/demystifying-zk-rollups-working-use-cases-top-projects-more/#five

https://www.zkcompression.com/learn/core-concepts/limitations

https://www.zkcompression.com/

https://www.techopedia.com/zk-compression-on-solana-explained-new-era-of-l1-scalability

--

--