Zero-Knowledge Scaling: A Comparison of Solana’s zK Compression and Ethereum’s zK Rollups

Baheet
13 min readJul 7, 2024

--

Abstract:

As blockchain technology continues to evolve, scalability and efficiency have become critical components of its growth. This article delves into the world of zero-knowledge proof technology (zkps), exploring two innovative solutions: ZK Rollups and ZK Compression. While both utilize similar technology, they serve distinct purposes - ZK Rollups enhance Ethereum’s scalability, while ZK Compression reduces Solana’s storage costs. Through a comprehensive analysis of their architecture, technical differences, use cases, and performance, this article provides a detailed comparison of these solutions, shedding light on their potential to enhance the blockchain.

Table of contents

  1. Introduction
  2. Zk Rollups
  3. Zk Compression
  4. Comparison of Zk Rollup and Zk Compression
  5. Application and Usecases
  6. Conclusion

1. Introduction

The blockchain as you already know is a decentralised ledger that stores records of transactions in a secure and transparent way. Top blockchains process a whole lot of transactions every day. Ethereum for example processes over 1 Million transactions daily.

With the large volume of transactions coming into the Blockchain daily, there comes a need to answer an important question. How capable is the Blockchain to handle these transactions? How scalable is the Blockchain?

The Solana Blockchain is quite impressive in this aspect as it can handle transactions at a speed of 65,000 TPS (Transactions Per Second) theoretically. The Highest Recorded TPS on Solana is 7229 TPS. The Ethereum Blockchain on the other hand is very lacking, having a speed of just 119 TPS theoretically with the highest recorded TPS being 62.34 TPS . This shows that the powerful Ethereum Blockchain is less Scalable and can handle transactions 99% lesser than a Blockchain like Solana.

1.1. ROLLUPS

The Ethereum Blockchain’s scalability problem made developers start looking out for scalability solutions that would solve this problem. A lot of Scalability solutions like Sidechains, State Channels, Hard Forks, SEGWIT, Sharding and Rollups amongst others were developed in a bid to increase the rate at which the blockchain can handle transactions.

Of the scalability solutions, Rollups stands out as a secure, efficient and flexible approach to Ethereum Blockchain’s Scalability.
One thing that makes Rollups stand out amongst other scaling solutions is that it inherits the security of the main chain, thereby it doesn’t have to find means to secure itself.

Just picture it as your restaurant and separate kitchen being in the same compound, your restaurant’s security officers would also guard the kitchen at the same time.

We'll be taking a deep dive into a type of Rollup called Zk-Rollup for the purpose of this article.

2. zK Rollups

With the numerous transactions being done on Rollups, there is a need for Rollups to ensure those transactions are valid and not just batching and submitting them to the mother chain.

Zero-Knowledge Rollups aka Zk-Rollups are Rollups which prove the validity of their transactions through what we call Zk-Proofs (Zero knowledge proofs).

A Zero knowledge proof is a mechanism that proves that a transaction is valid and correct without revealing the content of the transaction itself.

Zk-Rollups on Ethereum batch transactions and bundles the Zk-Proof that shows the validity of those transactions together with it before sending it to the Ethereum chain. This way, the Ethereum chain can be rest assured that it's accepting valid transactions.

How Zk Rollup process transactions

Here is a step-by-step breakdown of how Zk-Rollups on Ethereum work:

  1. User Initiation: A user initiates a transaction. It could be a swap, buy/sell or any type of transaction.
  2. Batching Transactions: The transaction together with other multiple transactions are bundled together to reduce load on the main blockchain.
  3. ZK-Proof Generation: A special mathematical proof is created to confirm the validity of the transactions without revealing all the details.
  4. Data Availability Check: While details are hidden, data availability checks ensure the original data remains accessible if needed.
  5. Submission to Ethereum Chain: The bundled transactions and proof are submitted to the Ethereum Blockchain for finalisation.
  6. Verification and Finality: The Ethereum chain verifies the proof and settles the transactions, making them permanent.

ZK-Rollups rely on two main components to function:

  • On-chain Contracts: These are smart contracts deployed on the Ethereum blockchain itself. They handle critical tasks like:
    1. Storing rollup blocks (batches of transactions)
    2. Tracking deposits and withdrawals of funds
    3. Monitoring state updates coming from the ZK-rollup
  • Off-chain Virtual Machine (VM): This acts as the separate execution engine for the ZK-rollup. It's where the magic happens:
    Transactions are executed and processed
    The chain state (balances, accounts, etc.) is stored and updated

Think of the on-chain contracts as the secure vault holding the keys and monitoring activity, while the off-chain VM is the high-speed processing center handling the transactions. They work together to ensure secure and efficient transaction processing.

Let's take a look at the benefits of Zk Rollups.

2.1. Benefits of Zk-Rollups on Ethereum

  1. Increased Scalability: By processing transactions off-chain, ZK-Rollups significantly improve transaction throughput compared to Ethereum’s mainnet. This translates to faster transaction processing times and lower fees for users. ZkSync, a roll up on Ethereum, can potentially reach over 2,000 TPS, while the max TPS ever recorded on Ethereum is 63.24 TPS.
  2. Enhanced Privacy: ZK-Rollups utilise zero-knowledge proofs, which verify the validity of transactions without revealing all the transaction data. This offers improved privacy for users compared to transactions processed directly on the Ethereum mainnet.
  3. Security: Even though transactions occur off-chain, ZK-Rollups inherit the security of the Ethereum blockchain. They achieve this by submitting cryptographic proofs back to the main chain that verify the validity of the processed transactions.
  4. Cost Effectiveness: Reduced strain on the mainnet due to off-chain processing can lead to significantly lower gas fees for users compared to Ethereum’s mainnet.

The average gas fee on ZkSync, a Zk-Rollup on Ethereum is around $0.02 while on the main Ethereum gas fee currently costs around $0.1 at base level, and this is very low. Ethereum is famed for its high gas fees. Between January 2021 and May 2022, Ethereum’s average gas fee range was around $40.

(Source: OxMadn’s Dune Dashboard)
(Source: Etherscan Gas Tracker)

5. EVM Compatibility: Certain ZK-Rollup designs are compatible with the Ethereum Virtual Machine (EVM), allowing developers to leverage existing Ethereum tooling and development experience when building applications on ZK-Rollups.

Even though zk Rollups seem like the perfect deal, it isn’t without its own limitations which we’ll be looking into.

2.2. Limitations of Zk Rollups

  1. Computational Complexity: Generating the cryptographic proofs at the heart of ZK-Rollups is computationally expensive and complex. This can be a bottleneck for scalability and potentially limit the number of transactions processed.
  2. EVM Compatibility Challenges: ZK-Rollups might not seamlessly interact with existing Ethereum smart contracts. This can make development on ZK-Rollups more complex, requiring rewriting contracts or using specialized tools like transpliers.
  3. Data Availability Concerns: ZK-Rollups rely on off-chain data storage for transaction details. If this data becomes unavailable, it could threaten the integrity of the entire rollup.
  4. Early Stage Technology: While ZK-Rollups are a promising innovation, they’re still under development. Their long-term security and stability need further evaluation through real-world use.

3. zK compression- introduction

The Solana Blockchain processes transactions at a very high rate (65,000 TPS theoretically) making it popularly known as the king of Scalability but storing these transactions on the Blockchain is becoming a problem.

Storing transactions on the Blockchain consumes space, therefore an amount has to be paid as rent. This rent becomes expensive overtime as transactions increase.

Light Protocol, in collaboration with Helius have developed a solution which allows the efficient storage of Blockchain transactions without sacrificing security and data integrity, it is called Zk-compression.

To understand Zk-compression, imagine you have a huge library filled with books (Solana's blockchain). Storing all these books takes up a lot of space. Zk-compression is like having a magic shrinking machine for your library.

You put each book in the machine, and it shrinks it down to a tiny summary that captures the most important information. This summary is like the fingerprint of the book. To ensure that the summary is valid and correct, your machine also generates a proof to back up each summary.

Now you only need to store these tiny summaries and proofs in the expensive library shelves thereby taking lesser space and the actual books can be kept in a cheaper storage room off-site. I bet you also agree that this is amazing!

But Despite the enthusiasm surrounding this new development, some experts in the crypto space still argue that ZK compression is more akin to a layer-2 (L2) solution, rather than a standalone technology

The Solana team will eventually realise they have built an effective L2 feature, which is positive as long as they are honest about it — said Adam Cochran

3.1. How does Zk-Compression work?

Zk-compression tackles the challenge of storage limitations on the Solana blockchain by combining compression techniques with zero-knowledge proofs (ZKPs). Here's a deeper dive into its workings:

1. Account Compression

When a user or developer chooses to utilize zk-compression, the data within their Solana account undergoes a compression process. This significantly reduces the size of the data, making it more efficient to store.

There are various compression algorithms that can be employed, depending on the specific data type within the account. Common techniques include dictionary encoding, run-length encoding, and Huffman coding.

The compressed data essentially becomes a condensed representation of the original account information.

2. Generating Zero-Knowledge Proofs (ZKPs)

After compression, zk-compression utilizes zero-knowledge proofs to ensure the integrity of the compressed data. These proofs are cryptographic mechanisms that allow verifying a statement's truthfulness without revealing the underlying information itself.

In the context of zk-compression, the statement being proven is that the compressed data (represented by a state root) accurately reflects the original, uncompressed account data.

Popular ZKP systems used for zk-compression include zk-SNARKs (Zero-Knowledge Succinct Non-interactive Argument of Knowledge) and zk-STARKs (Zero-Knowledge Scalable Transparent Arguments of Knowledge).

These systems generate cryptographic proofs that are much smaller than the original data itself.

3. Storing State Roots and Proofs

The core outcome of zk-compression is a pair of elements:

  • State Root: This is a unique cryptographic hash of the compressed account data. It acts like a fingerprint that captures the essence of the compressed data without revealing the actual content.
  • ZK Proof: This is the cryptographic proof generated by the ZKP system, demonstrating that the state root accurately represents the original account data.

These two elements, the state root and the ZK proof, are what get stored on the Solana blockchain. They are significantly smaller than the original uncompressed data, leading to substantial storage savings.

The compressed data itself resides in a cheaper off-chain storage solution within the Solana ecosystem.

4. Verification Process

Whenever there's a need to verify the integrity of the compressed data (e.g., during a transaction), validators or users can leverage the state root and the corresponding ZK proof.

The ZKP system is used to verify the proof. If the verification succeeds, it confirms that the state root accurately reflects the original account data, even though the actual compressed data wasn’t directly accessed on-chain.

3.2. Benefits of zK compression

  1. Reduced Storage Costs: By storing only the state roots and ZK proofs on-chain, zk-compression significantly reduces storage requirements and costs.

Light Protocol claims a massive cost reduction for creating user accounts on Solana. According to them, creating 100 compressed accounts (for holding and tracking crypto balances) will be 5,000 times cheaper than using the standard method.

Mert Mumtaz, from Helius Labs, puts this in perspective with a real-world example:

Imagine sending an airdrop to 1 million users. Traditionally, this storage cost would be over $260,000. With zk-compression, it becomes just $50 - a staggering 5,200x decrease.

Since everything on Solana relies on accounts, zk-compression has the potential to significantly improve the scalability of the entire network.

2. Improved Scalability: This technique helps Solana scale by enabling more data to be stored without bloating the on-chain storage, paving the way for handling a higher transaction volume.

3. Security: ZKPs ensure the integrity of the compressed data, maintaining the security of the Solana blockchain.

4. Comparison of Zk Rollup and Zk Compression

4.1. Technical differences:

  • Zk Rollups utilize zero-knowledge proofs to batch transactions on layer 2, while Zk Compression uses advanced compression algorithms to reduce data size on layer 1.
  • Zk Rollups rely on the security of the underlying layer 1 blockchain, whereas Zk Compression relies on the efficiency of the compression algorithm.

4.2. Composability

  • zk-Rollups may fragment liquidity and present challenges to permissionless composability compared to applications on the same base layer.
  • zk-Compression allows Solana programs to mix and match compressed and regular states.

4.3. Performance

  • Throughput: Zk Rollups can process multiple transactions in a single batch, while Zk Compression enables more data storage without increasing block size.
  • Gas fees: Zk Rollups reduces gas fees for layer 2 transactions, while Zk Compression reduces storage costs for developers.

Solana Summer, Teams are shipping
SOL price goes up. Like a summer heat But you’re unbothered, happy, refreshed because your costs as a builder on Solana stay low thx to zk compression. Scale Anything.

Source: original tweet Tweethttps://x.com/swen_sjn/status/1806345178292093375?s=19
  • Storage efficiency: Zk Compression enables more efficient data storage, while Zk Rollups do not directly impact storage efficiency.
  • Latency: Zk Rollups reduce transaction processing times, while Zk Compression enables faster data transmission.
  • Data size: Zk Compression significantly reduces data size, while Zk Rollups do not directly impact data size.

Zk Rollups on Ethereum and Zk Compression on Solana cater to different scaling needs, with Zk Rollups focusing on layer 2 scaling and Zk Compression prioritizing layer 1 efficiency.

With zk Rollups, execution, and state is on an ancillary chain — it just sends periodic commitments and proofs posted to the main L1 — Micah Casella, senior research analyst at Messari

By understanding their differences and use cases, I believe developers can choose the most suitable and efficient solution for their Dapps.

In summary, it seems to really come down to where execution is conducted and state is located. In zK Compression, it’s all on Solana — Micah Casella, senior research analyst at Messari

5. Application and Usecases

Both Zk Rollups and Zk Compression have various applications and use cases across different industries.

5.1. zK Rollup

  • Gaming and NFTs: Current transaction speeds and fees make smooth gameplay and in-game economies challenging, especially for microtransactions involving NFTs. Zk-rollups enable faster transaction confirmation times and lower fees, making NFT purchases and in-game economies more viable.Immutable X (IMX) sorare and Mythical Games are example of projects that have integrated this.
  • ZKSync is another application of zK Rollup that leverages the power of zero-knowledge proofs to revolutionize Ethereum scalability, enabling decentralized applications to achieve high throughput and low transaction costs.
  • Supply Chain Management: Traditional supply chain tracking is often opaque and lacks real-time visibility. Counterfeiting is also a major concern. Zk-rollups can securely record product movement and verify authenticity while maintaining data privacy for sensitive information.For example VeChain (not purely zk-rollup, but explores zk proofs)
  • Loopring is a decentralized exchange protocol that utilizes ZK-Rollups to increase the scalability and privacy of its trading platform. It hopes to enhance throughput of the Ethereum blockchain and reduce transaction costs to offer higher performance, liquidity, and security for traders and liquidity providers.
  • StarkNet implements ZK-Rollups to bolster scalability on the Ethereum blockchain by processing large batches of transactions off-chain. It is commonly used as a scaling solution for decentralized finance protocols.
  • Polygon CDK is an open-source framework designed for developers to build and deploy ZK-powered Layer 2 blockchains on Ethereum. It also helps in transitioning existing L1 chains into Ethereum L2s.

New protocols are constantly emerging to leverage the power of zk-rollups on Ethereum. The space is rapidly evolving, and we can expect even more innovative use cases to develop in the future.

5.2. zK Compression

Since zK compression is a new development on Solana, it doesn’t really have a solid Usecases and track record like zK Rollup but here are some potential use case and application:

  • DeFi: Expect lower fees and faster transaction speeds for DeFi activities like lending, borrowing, and trading on Solana. This could attract more users and fuel DeFi growth.
  • NFT Efficiency: Zk-compression can significantly reduce storage costs for NFTs, especially those with complex data. This could make NFT storage on Solana more affordable and enable scalable NFT marketplaces.
  • Smoother Gaming: Faster loading times and lower transaction fees for in-game items could significantly enhance the gaming experience of Solana, especially for fast-paced games.
  • Broader Blockchain Use: By making on-chain data storage cheaper, zk-compression opens doors for innovative applications that require significant data storage without breaking the bank.

zK compression harnesses Solana’s exceptional capabilities in fast transaction processing, offering a unique approach to scaling while preserving performance and cost-effectiveness.

6. Conclusion

The two technologies, zk-Rollups and zk-Compression, show great promise in enhancing blockchain scalability and performance. While zk-Rollups have a proven track record, currently utilized in decentralized exchanges, zk-Compression is a novel approach with the potential to substantially reduce storage costs on the Solana network, offering an exciting new frontier for blockchain optimization.

Personally, I think the conflict here is on whether zk compression is an L2 solution or not but mere looking at the design it’s clear that zK compression is not an L2 and the whole operation happens on Solana without the need for sidechains or any other alternatives. The only off-chain component is the indexer.

Here is a post that helps you understand this better

Original Tweet https://x.com/CabronElBufon/status/1804671457085345876?s=19

References

--

--