Comparing Scalabilty Solutions: ZK Rollups on Ethereum vs ZK Compression on Solana

Advanced7/31/2024, 12:27:24 PM
This article compares two blockchain scaling solutions: Ethereum's ZK Rollups and Solana's ZK Compression. It explores their advantages and challenges in terms of technical implementation and application.

The early days of blockchain were filled with excitement. However, as more people started using it and transaction volumes shot up, a significant issue emerged: scalability. Alongside scalability issues were others like security and decentralization. This challenge known as the “blockchain trilemma”, suggests that it is difficult to achieve all three attributes simultaneously.

Bitcoin, the first blockchain, could only handle a few transactions per second, and Ethereum wasn’t much better. This led to a demand for solutions that could increase blockchain’s scalabilty.

This demand birthed ZK Proofs.

ZK Proofs as a Scaling Solution

“Zero-knowledge” was first introduced in a 1985 paper by Shafi Goldwasser, Silvio Micali, and Charles Rackoff titled “The knowledge complexity of interactive proof systems,” This paper explained zero-knowledge proofs, long before cryptocurrencies came into existence.

According to the paper,

A zero-knowledge proof is a way for one party (the prover) to prove to another party (the verifier) that a statement is true, without revealing any additional information other than the truth of that specific statement.

In other words, zero-knowledge principles ensure that no extra knowledge is transferred from the prover to the verifier apart from the statement being true.

A classic analogy to explain the concept of ZK Proofs is “Ali Baba’s Cave”:

Scenario: There’s a cave with two paths, A and B, that form a loop and meet at a locked door. Jane (the prover) knows the secret code to open the door, and Paul (the verifier) wants to be convinced that Jane knows the code without learning the code himself.

Process:

  1. Jane enters the cave and randomly chooses either path A or B.

  2. Paul waits outside, not knowing which path Jane took.

Source: Mighty Block

  1. Paul then enters the cave and calls out the path he wants Jane to return by (either A or B).

  2. If Jane knows the code, she can open the door and return via the chosen path.

  3. This process (1–5) is repeated multiple times to ensure that Jane isn’t just guessing correctly by chance.

If after many repetitions Jane consistently returns via the correct path, Paul can be confident that Jane knows the code without ever having learned the code himself.

ZK Proofs aim to ensure privacy and security, keeping sensitive information private while still allowing others to verify its authenticity. In simpler terms, ZK Proofs help keep important data safe while proving that it’s legit, without revealing the details.

The concept of ZK Proofs has also birthed the development of various advanced cryptographic techniques and applications such as ZK Rollups and ZK Compressions.

In 2018, an anonymous Barry Whitehat uploaded a GitHub repository called “roll_up,” which introduced the idea of rollups. Soon after, Ethereum’s creator, Vitalik Buterin, took this concept further and came up with zk-Rollups.

Zk-Rollups, short for zero-knowledge rollups, are layer-2 scaling solutions designed to boost Ethereum’s mainnet performance by scaling it up. They do this by moving computation and state storage off-chain.

Layer-2 is a secondary protocol built on top of a blockchain to enhance its scalability, speed, and reduce transaction fees.

On June 21, Light Protocol, a Solana-based privacy layer, announced that it had teamed up with the Solana development team, Helius Labs, to launch the testnet for their new “ZK Compression” scaling solution as means to significantly reduce on-chain computation costs.

While zk-Rollups and zk-Compression use the power of zero-knowledge proofs to optimize blockchain technology, they serve different purposes and are implemented in different ways.

Regardless, there have been ongoing debates and disses from the Ethereum and Solana communities about which is better.

For instance, an ETH community member called ZK compression “another L2”.

After this response from Mert (CEO of heliuslabs) to the tweet above, the Solana community fired back with a creative diss video targeting Ethereum.

The video featured a doctor treating an “ETH Maximysis” patient. A line from the video stated:

“It’s a common reaction faced by ETH Maxis. They can’t function without another layer. Layer 3! Layer 4!”

The ongoing rivalry between these blockchains is evident. Hence, this article aims to provide a clear and comprehensive comparison of their scalability solutions, highlighting each one’s unique features, differences, and practical use cases.

What are ZK Rollups?

At its core, ZK Rollups is a layer-2 scaling solution designed to improve the efficiency and scalability of blockchain networks.

The idea is simple: instead of processing each transaction directly on the main blockchain, ZK-Rollups bundle multiple transactions into a single proof. This consolidated proof is then submitted to the blockchain for verification.

Source: Datawallet

This approach significantly increases transaction throughput (the number of transactions the network can handle within a given period) without compromising network security.

To properly grasp this,

Picture yourself organizing a concert. Instead of letting each attendee enter one by one through a narrow gate (the main blockchain), which could cause congestion and delays, you implement a system where groups of attendees are verified together at checkpoints. Each group carries a single ticket that proves everyone in the group has been properly checked and admitted. This way, you maintain security and efficiency by reducing the blockage at the entrance.

ZK Rollups enhances scalability by processing transactions off-chain and securing them with advanced cryptographic techniques like ZK-SNARKs or ZK-STARKs. This ensures that transactions are valid and private, thereby improving overall efficiency and security for users.

zk-SNARKs are zk proofs that provide succinct proofs (i.e. the proof size is short and efficient to verify). They are well-suited for applications where proof size and verification time are critical.

zk-STARKs are zk proofs that allow for larger and more complex proofs, making them suitable for applications like large-scale financial audits, data privacy, and verifying computations.

ZK Rollups is a perfect scaling solution for blockchain networks like Ethereum as they aggregate transactions off-chain into batches, reducing data posted directly to Ethereum.

How ZK Rollups Operate on Ethereum

ZK-rollups leverages cryptographic techniques to aggregate and validate transactions off-chain, thereby improving scalability and reducing costs on the Ethereum blockchain.

Source: Maple Block

Here’s a step-by-step explanation of how ZK-rollups operate:

  1. Transaction Aggregation: this involves users signing and submitting transactions to ZK-Rollup operators (sequencers), who aggregate them into batches.
  2. Off-chain Processing: transactions are processed off-chain, outside the Ethereum Mainnet (Layer 1).
  3. State Updates: After processing a batch of transactions, the ZK-Rollup operator computes a new state root for the rollup’s state.
  4. Validity Proofs: the ZK-Rollup operator then generates a validity proof, ensuring all transactions in the batch were executed correctly and followed the protocol’s rules.
  5. On-chain Verification: the ZK-Rollup operator submits the validity proof and the new state root to an on-chain Ethereum smart contract called the rollup contract, which verifies and updates its state accordingly.
  6. User Interaction: Users interact with the ZK Rollup by depositing tokens into the rollup contract on Ethereum Mainnet, initiating transactions within the rollup, and withdrawing tokens back to the Mainnet when needed.
  7. Exit Mechanism: To withdraw tokens from the ZK Rollup to Ethereum Mainnet, users submit a withdrawal request with a Merkle proof confirming their token ownership within the rollup’s state. Upon validation by the rollup contract, the tokens are transferred back to the user’s Ethereum address.

The Upsides of ZK Rollups

Here are some of the upsides of ZK Rollups:

  1. Increased Scalability: By bundling many transactions into a single batch, zk-rollups can handle thousands of transactions per second (TPS), significantly increasing the throughput compared to the base layer.
  2. Lower Fees: The cost per transaction is reduced as the gas fees are spread across many transactions within a rollup batch, making it more economical for users.
  3. Ethereum-Level Security: zk-rollups inherit the security of the Ethereum main chain because they post proofs (zk-SNARKs) to Ethereum, ensuring the validity of off-chain transactions.
  4. Reduced Data Load: By posting only succinct proofs to the main chain, zk-rollups significantly reduce the amount of data that needs to be processed and stored on the Ethereum blockchain.
  5. Enhanced Privacy: zk-rollups can offer improved privacy features. Zero-knowledge proofs can hide transaction details while still proving their validity, enabling private transactions on public blockchains.

The Downsides of ZK Rollups

While ZK Rollups offer many advantages, they also come with downsides and challenges.

Here are some of the downsides:

  1. Complexity: ZK-rollups are technically complex and require specialized knowledge to implement and maintain.
  2. Data Availability: Ensuring that data necessary to reconstruct the state is available on-chain is crucial. If data is not available, it can hinder the ability to validate and reconstruct the rollup state. Also, zk-rollups often rely on off-chain data storage, which can pose risks if the data is lost or becomes inaccessible.
  3. Computational costs: Generating zero-knowledge proofs (zk-SNARKs) is computationally intensive and requires significant processing power.
  4. Centralization Risks: There may still be centralization risks if the proving infrastructure is controlled by a few entities.

Current Use Cases of ZK Rollups

New ZK Rollup projects are emerging every day. Here are some of the to ZK-Rollup projects:

Source: Moralis

Projects like Starkware (which develops permissioned and tailor-made scaling L2), Aztec Network (building blockchain encryption using zkSNARKs), Argent (a non-custodial wallet integrated with zkSync) Immutable X (an NFT minting and trading platform) and Loopring (a zk-rollup exchange and payment protocol on Ethereum) all use ZK Rollups.

Here are the different ways ZK Rollups are used:

  1. In Decentralized Finance (DeFi): Helps users lend, borrow, and trade with lower gas costs.
  2. In Decentralized Exchanges (DEXs): facilitates quicker and more cost-effective token swaps while enhancing privacy.
  3. In Gaming and NFT: Enhances user engagement across digital platforms empowering scalable in-game economies and vibrant NFT marketplaces.
  4. In Payments: Facilitates fast and and low-cost microtransactions and cross-border payments.

What is ZK Compression?

ZK compression is a primitive, created and launched by Light Protocol and Helius Labs. It reduces on-chain costs by using zero-knowledge proofs and compression to minimize the amount of data stored on-chain and thus the computation demand placed on Solana through transactions.

A primitive is a low-level cryptographic algorithm that is used as a foundation or building block by higher-level cryptographic algorithms.

To better grasp ZK Compression, understanding the unique architecture of Solana and the challenges it faces is important.

Understanding “Accounts” on Solana

Unlike Ethereum, where smart contracts and data are tightly coupled, Solana uses a model where data is stored in separate “accounts.” These accounts range from executable code to token balances.

Everything on Solana is an account.

While this model enables Solana’s high performance and parallel processing, it comes with a cost: validators must keep all active accounts in fast-access memory (RAM), which is expensive.

To prevent abuse and compensate validators, Solana implements a “rent” system where users must lock up SOL tokens to keep their accounts active, with the rent amount directly linked to the stored data’s size.

Source: 0XMert’s 𝕏

As Solana gained popularity, the cost of creating and maintaining these accounts became a significant barrier to scaling and so did the need for a solution — ZK Compression.

With the advent of ZK Compression, the cost of creating new Solana accounts is set to decrease significantly, potentially by “orders of magnitude”.

If something becomes cheaper by “orders of magnitude,” it means the cost or effort involved decreases dramatically, often by ten times or more compared to the previous amount.

This means that the creation of 100 compressed user accounts that hold and track crypto balances (also known as token accounts) will be 5,000 times cheaper than creating 100 regular token accounts.

Think of it this way: Compression involves squeezing something until it occupies less space. ZK compression applies this principle, where ‘ZK’ signifies that the privacy of the compressed data remains uncompromised.

In essence, ZK compression stores only the compressed data’s “fingerprint” (hash) on-chain. This approach reduces storage costs while preserving data privacy.

Contrary to what competitors say, ZK Compression is not a layer-2 chain on Solana; it’s an upgrade to improve Solana’s data storage and drastically reduce costs for developers.

How ZK Compression Operates on Solana

ZK Compression tackles this challenge head-on by allowing developers to compress multiple account states into a single on-chain account.

Source: 0xSumanth’s 𝕏

Here’s how it works:

  1. Account compression: Multiple account states are combined and hashed recursively into a compact 32-byte “state root.”
  2. On-chain and off-chain storage: A state tree is a binary Merkle tree that organizes data into a hierarchical structure, allowing for efficient verification of data integrity. This state root is stored on-chain, while the full account data is stored off-chain in the Solana ledger.
  3. Validating Proofs: Succinct zero-knowledge proofs confirm the existence of multiple compressed accounts within state trees, maintaining a constant 128-byte size​. When a transaction needs to access or modify the compressed data, it provides proof that the data corresponds to the on-chain state root.
  4. Verification: The proof is verified on-chain, enabling the transaction to proceed if it is valid.

The key innovation lies in the use of zero-knowledge proofs, specifically SNARKs (Succinct Non-interactive Arguments of Knowledge), to compress the Merkle proofs used in this process.

Source: 0xMert’s 𝕏

This compression reduces the proof size from potentially hundreds of bytes to a constant 128 bytes, regardless of the number of accounts being compressed.

This dramatic reduction in data size enables developers to work within Solana’s transaction size limits while still interacting with multiple compressed accounts in a single transaction.

The Upsides of ZK Compression on Solana Blockchain

These are the upsides of ZK Compression to the Solana ecosystem:

  1. Energy Efficiency: Reducing storage and computational requirements decreases the energy consumption associated with operations.
  2. Scalability: Solana’s data compression enables a higher volume of applications and transactions, enhancing overall scalability.
  3. Maintains Layer 1 Security: Unlike Layer 2 solutions, compressed data retains the full security benefits of Solana’s main chain.
  4. All-in-one environment: Developers can build and deploy applications within a single environment, eliminating the need to bridge between layers, which simplifies the building process.
  5. Reduced cost: Reduces data storage costs by minimizing on-chain storage requirements.
  6. Programmability: Compressed data remains fully compatible with Solana’s smart contracts, preserving its utility and programmability.

Downsides of ZK Compression on Solana Blockchain

These are the downsides of ZK Compression to the Solana:

  1. Computational Complexity: Generating zero-knowledge proofs is computationally intensive, which can lead to high costs and slower performance.
  2. Implementation Challenges: Developing and implementing ZK compression requires specialized knowledge in cryptography.
  3. Scalability Issues: While ZK compression aims to improve scalability, the computational requirements can sometimes offset these benefits, particularly in resource-constrained environments.
  4. Verification Overhead: Verifying zero-knowledge proofs, although generally less intensive than generating them, still requires computational resources. In some cases, this can introduce latency and impact the overall efficiency of the system.
  5. Economic Costs: The high computational demands translate to increased energy consumption and operational costs. This can make ZK compression less economically viable for certain applications.

Use cases of ZK Compression

Here are some possible use cases of zk compression:

  1. DeFi Applications: DeFi protocols on Solana like Jupiter Exchange can utilize ZK compression to help reduce fees and speed up transaction times.
  2. Micropayments: In micropayment solutions like Code, zk compression would make payments more cost-effective and sustainable on the Solana network by reducing on-chain storage requirements for the many small transactions,
  3. Decentralized Networks: Protocols such as Helium, which provide decentralized wireless networks, cater to millions of users and devices. ZK compression plays a vital role in managing the vast amount of data generated by these networks without the need for intricate Layer 2 solutions.
  4. Gaming: ZK compression could optimize storage costs in games like Honeyland. All game assets, in-game items, and NFT metadata would cost less, thereby enhancing the overall user experience.

TL;DR: Comparing ZK Rollups and ZK Compression

Similarities

  1. Use of Zero-Knowledge Proofs: Both solutions leverage zero-knowledge proofs to validate and secure transactions off-chain.
  2. Scalability Enhancement: They aim to improve blockchain scalability by reducing on-chain transaction processing and data storage.
  3. Layer-2 Solutions: Both are considered layer-2 scaling solutions built on top of their respective blockchains to increase transaction throughput and reduce costs.

Differences

  1. Blockchain Platform: ZK Rollups operate on Ethereum, while ZK Compression is implemented on Solana.
  2. Primary Focus: ZK Rollups focus on aggregating and processing transactions off-chain to enhance scalability, whereas ZK Compression primarily aims to reduce on-chain storage costs through data compression.
  3. Implementation Approach: ZK Rollups bundle multiple transactions into a single proof for submission to Ethereum’s main chain, whereas ZK Compression compresses multiple account states into a single on-chain account on Solana.
  4. Proof Size: ZK Rollups use zk-SNARKs or zk-STARKs to generate succinct proofs, while ZK Compression utilizes zk-SNARKs to compress Merkle proofs into a constant size.
  5. Transaction Handling: ZK Rollups process transactions off-chain and periodically submit proofs to Ethereum, whereas ZK Compression handles compressed account data on-chain with verification using zero-knowledge proofs.

Use Cases

Current Use Cases for ZK Rollups

  1. DeFi Applications: Enhances decentralized finance protocols by reducing transaction fees and increasing transaction speed.
  2. Decentralized Exchanges (DEXs): Facilitates efficient token swaps while maintaining privacy.
  3. Gaming: Supports scalable in-game economies and NFT marketplaces with lower costs.
  4. Payments: Enables fast and low-cost microtransactions and cross-border payments.

Potential Use Case of ZK Compression

  1. DeFi Applications: Reduces fees and speeds up transactions for DeFi protocols on Solana.
  2. Micropayments: Makes small transactions more cost-effective and sustainable by minimizing on-chain storage.
  3. Decentralized Networks: Manages large volumes of data efficiently for decentralized wireless networks and IoT applications.
  4. Gaming: Optimizes storage costs for game assets and NFT metadata, enhancing user experience.

My Honest Opinion

Whether you’re suffering from Eth Maximysis, or you’re a staunch Solana believer like me, what matters most is using the blockchain that suits your needs at the given time.

I find that ZK Rollups are best suited for projects needing high security and benefiting from Ethereum’s established ecosystem as they provide a reliable method to scale Ethereum while preserving its decentralized structure.

On the other hand, with ZK Compression, Solana can handle more transactions without getting bogged down, even when SOL’s price goes up. Therefore, I believe that ZK Compression on Solana is perfect for applications that value speed, performance, and cost-efficiency.

Solana’s ability to support high-performance, cost-efficient decentralized applications (dApps) holds a futuristic appeal because speed and cost are crucial for the widespread adoption of blockchain technology.

In the end, both ZK Rollups and ZK Compression could help make transactions quicker, cheaper, and hence more scalable.

References

S. Goldwasser, S. Micali, and C. Rackoff, 1985. “The knowledge complexity of interactive proof systems

Helius.dev

zkCompression

Cointelegraph

Ethereum.org

Techopedia

Solanacompass.com

Disclaimer:

  1. This article is reprinted from @thelxlxan/scaling-solutions-zk-rollups-on-ethereum-vs-zk-compression-on-solana-3f0386c09007">[Lilian], All copyrights belong to the original author [Lilian]. If there are objections to this reprint, please contact the Gate Learn team, and they will handle it promptly.
  2. Liability Disclaimer: The views and opinions expressed in this article are solely those of the author and do not constitute any investment advice.
  3. Translations of the article into other languages are done by the Gate Learn team. Unless mentioned, copying, distributing, or plagiarizing the translated articles is prohibited.

Comparing Scalabilty Solutions: ZK Rollups on Ethereum vs ZK Compression on Solana

Advanced7/31/2024, 12:27:24 PM
This article compares two blockchain scaling solutions: Ethereum's ZK Rollups and Solana's ZK Compression. It explores their advantages and challenges in terms of technical implementation and application.

The early days of blockchain were filled with excitement. However, as more people started using it and transaction volumes shot up, a significant issue emerged: scalability. Alongside scalability issues were others like security and decentralization. This challenge known as the “blockchain trilemma”, suggests that it is difficult to achieve all three attributes simultaneously.

Bitcoin, the first blockchain, could only handle a few transactions per second, and Ethereum wasn’t much better. This led to a demand for solutions that could increase blockchain’s scalabilty.

This demand birthed ZK Proofs.

ZK Proofs as a Scaling Solution

“Zero-knowledge” was first introduced in a 1985 paper by Shafi Goldwasser, Silvio Micali, and Charles Rackoff titled “The knowledge complexity of interactive proof systems,” This paper explained zero-knowledge proofs, long before cryptocurrencies came into existence.

According to the paper,

A zero-knowledge proof is a way for one party (the prover) to prove to another party (the verifier) that a statement is true, without revealing any additional information other than the truth of that specific statement.

In other words, zero-knowledge principles ensure that no extra knowledge is transferred from the prover to the verifier apart from the statement being true.

A classic analogy to explain the concept of ZK Proofs is “Ali Baba’s Cave”:

Scenario: There’s a cave with two paths, A and B, that form a loop and meet at a locked door. Jane (the prover) knows the secret code to open the door, and Paul (the verifier) wants to be convinced that Jane knows the code without learning the code himself.

Process:

  1. Jane enters the cave and randomly chooses either path A or B.

  2. Paul waits outside, not knowing which path Jane took.

Source: Mighty Block

  1. Paul then enters the cave and calls out the path he wants Jane to return by (either A or B).

  2. If Jane knows the code, she can open the door and return via the chosen path.

  3. This process (1–5) is repeated multiple times to ensure that Jane isn’t just guessing correctly by chance.

If after many repetitions Jane consistently returns via the correct path, Paul can be confident that Jane knows the code without ever having learned the code himself.

ZK Proofs aim to ensure privacy and security, keeping sensitive information private while still allowing others to verify its authenticity. In simpler terms, ZK Proofs help keep important data safe while proving that it’s legit, without revealing the details.

The concept of ZK Proofs has also birthed the development of various advanced cryptographic techniques and applications such as ZK Rollups and ZK Compressions.

In 2018, an anonymous Barry Whitehat uploaded a GitHub repository called “roll_up,” which introduced the idea of rollups. Soon after, Ethereum’s creator, Vitalik Buterin, took this concept further and came up with zk-Rollups.

Zk-Rollups, short for zero-knowledge rollups, are layer-2 scaling solutions designed to boost Ethereum’s mainnet performance by scaling it up. They do this by moving computation and state storage off-chain.

Layer-2 is a secondary protocol built on top of a blockchain to enhance its scalability, speed, and reduce transaction fees.

On June 21, Light Protocol, a Solana-based privacy layer, announced that it had teamed up with the Solana development team, Helius Labs, to launch the testnet for their new “ZK Compression” scaling solution as means to significantly reduce on-chain computation costs.

While zk-Rollups and zk-Compression use the power of zero-knowledge proofs to optimize blockchain technology, they serve different purposes and are implemented in different ways.

Regardless, there have been ongoing debates and disses from the Ethereum and Solana communities about which is better.

For instance, an ETH community member called ZK compression “another L2”.

After this response from Mert (CEO of heliuslabs) to the tweet above, the Solana community fired back with a creative diss video targeting Ethereum.

The video featured a doctor treating an “ETH Maximysis” patient. A line from the video stated:

“It’s a common reaction faced by ETH Maxis. They can’t function without another layer. Layer 3! Layer 4!”

The ongoing rivalry between these blockchains is evident. Hence, this article aims to provide a clear and comprehensive comparison of their scalability solutions, highlighting each one’s unique features, differences, and practical use cases.

What are ZK Rollups?

At its core, ZK Rollups is a layer-2 scaling solution designed to improve the efficiency and scalability of blockchain networks.

The idea is simple: instead of processing each transaction directly on the main blockchain, ZK-Rollups bundle multiple transactions into a single proof. This consolidated proof is then submitted to the blockchain for verification.

Source: Datawallet

This approach significantly increases transaction throughput (the number of transactions the network can handle within a given period) without compromising network security.

To properly grasp this,

Picture yourself organizing a concert. Instead of letting each attendee enter one by one through a narrow gate (the main blockchain), which could cause congestion and delays, you implement a system where groups of attendees are verified together at checkpoints. Each group carries a single ticket that proves everyone in the group has been properly checked and admitted. This way, you maintain security and efficiency by reducing the blockage at the entrance.

ZK Rollups enhances scalability by processing transactions off-chain and securing them with advanced cryptographic techniques like ZK-SNARKs or ZK-STARKs. This ensures that transactions are valid and private, thereby improving overall efficiency and security for users.

zk-SNARKs are zk proofs that provide succinct proofs (i.e. the proof size is short and efficient to verify). They are well-suited for applications where proof size and verification time are critical.

zk-STARKs are zk proofs that allow for larger and more complex proofs, making them suitable for applications like large-scale financial audits, data privacy, and verifying computations.

ZK Rollups is a perfect scaling solution for blockchain networks like Ethereum as they aggregate transactions off-chain into batches, reducing data posted directly to Ethereum.

How ZK Rollups Operate on Ethereum

ZK-rollups leverages cryptographic techniques to aggregate and validate transactions off-chain, thereby improving scalability and reducing costs on the Ethereum blockchain.

Source: Maple Block

Here’s a step-by-step explanation of how ZK-rollups operate:

  1. Transaction Aggregation: this involves users signing and submitting transactions to ZK-Rollup operators (sequencers), who aggregate them into batches.
  2. Off-chain Processing: transactions are processed off-chain, outside the Ethereum Mainnet (Layer 1).
  3. State Updates: After processing a batch of transactions, the ZK-Rollup operator computes a new state root for the rollup’s state.
  4. Validity Proofs: the ZK-Rollup operator then generates a validity proof, ensuring all transactions in the batch were executed correctly and followed the protocol’s rules.
  5. On-chain Verification: the ZK-Rollup operator submits the validity proof and the new state root to an on-chain Ethereum smart contract called the rollup contract, which verifies and updates its state accordingly.
  6. User Interaction: Users interact with the ZK Rollup by depositing tokens into the rollup contract on Ethereum Mainnet, initiating transactions within the rollup, and withdrawing tokens back to the Mainnet when needed.
  7. Exit Mechanism: To withdraw tokens from the ZK Rollup to Ethereum Mainnet, users submit a withdrawal request with a Merkle proof confirming their token ownership within the rollup’s state. Upon validation by the rollup contract, the tokens are transferred back to the user’s Ethereum address.

The Upsides of ZK Rollups

Here are some of the upsides of ZK Rollups:

  1. Increased Scalability: By bundling many transactions into a single batch, zk-rollups can handle thousands of transactions per second (TPS), significantly increasing the throughput compared to the base layer.
  2. Lower Fees: The cost per transaction is reduced as the gas fees are spread across many transactions within a rollup batch, making it more economical for users.
  3. Ethereum-Level Security: zk-rollups inherit the security of the Ethereum main chain because they post proofs (zk-SNARKs) to Ethereum, ensuring the validity of off-chain transactions.
  4. Reduced Data Load: By posting only succinct proofs to the main chain, zk-rollups significantly reduce the amount of data that needs to be processed and stored on the Ethereum blockchain.
  5. Enhanced Privacy: zk-rollups can offer improved privacy features. Zero-knowledge proofs can hide transaction details while still proving their validity, enabling private transactions on public blockchains.

The Downsides of ZK Rollups

While ZK Rollups offer many advantages, they also come with downsides and challenges.

Here are some of the downsides:

  1. Complexity: ZK-rollups are technically complex and require specialized knowledge to implement and maintain.
  2. Data Availability: Ensuring that data necessary to reconstruct the state is available on-chain is crucial. If data is not available, it can hinder the ability to validate and reconstruct the rollup state. Also, zk-rollups often rely on off-chain data storage, which can pose risks if the data is lost or becomes inaccessible.
  3. Computational costs: Generating zero-knowledge proofs (zk-SNARKs) is computationally intensive and requires significant processing power.
  4. Centralization Risks: There may still be centralization risks if the proving infrastructure is controlled by a few entities.

Current Use Cases of ZK Rollups

New ZK Rollup projects are emerging every day. Here are some of the to ZK-Rollup projects:

Source: Moralis

Projects like Starkware (which develops permissioned and tailor-made scaling L2), Aztec Network (building blockchain encryption using zkSNARKs), Argent (a non-custodial wallet integrated with zkSync) Immutable X (an NFT minting and trading platform) and Loopring (a zk-rollup exchange and payment protocol on Ethereum) all use ZK Rollups.

Here are the different ways ZK Rollups are used:

  1. In Decentralized Finance (DeFi): Helps users lend, borrow, and trade with lower gas costs.
  2. In Decentralized Exchanges (DEXs): facilitates quicker and more cost-effective token swaps while enhancing privacy.
  3. In Gaming and NFT: Enhances user engagement across digital platforms empowering scalable in-game economies and vibrant NFT marketplaces.
  4. In Payments: Facilitates fast and and low-cost microtransactions and cross-border payments.

What is ZK Compression?

ZK compression is a primitive, created and launched by Light Protocol and Helius Labs. It reduces on-chain costs by using zero-knowledge proofs and compression to minimize the amount of data stored on-chain and thus the computation demand placed on Solana through transactions.

A primitive is a low-level cryptographic algorithm that is used as a foundation or building block by higher-level cryptographic algorithms.

To better grasp ZK Compression, understanding the unique architecture of Solana and the challenges it faces is important.

Understanding “Accounts” on Solana

Unlike Ethereum, where smart contracts and data are tightly coupled, Solana uses a model where data is stored in separate “accounts.” These accounts range from executable code to token balances.

Everything on Solana is an account.

While this model enables Solana’s high performance and parallel processing, it comes with a cost: validators must keep all active accounts in fast-access memory (RAM), which is expensive.

To prevent abuse and compensate validators, Solana implements a “rent” system where users must lock up SOL tokens to keep their accounts active, with the rent amount directly linked to the stored data’s size.

Source: 0XMert’s 𝕏

As Solana gained popularity, the cost of creating and maintaining these accounts became a significant barrier to scaling and so did the need for a solution — ZK Compression.

With the advent of ZK Compression, the cost of creating new Solana accounts is set to decrease significantly, potentially by “orders of magnitude”.

If something becomes cheaper by “orders of magnitude,” it means the cost or effort involved decreases dramatically, often by ten times or more compared to the previous amount.

This means that the creation of 100 compressed user accounts that hold and track crypto balances (also known as token accounts) will be 5,000 times cheaper than creating 100 regular token accounts.

Think of it this way: Compression involves squeezing something until it occupies less space. ZK compression applies this principle, where ‘ZK’ signifies that the privacy of the compressed data remains uncompromised.

In essence, ZK compression stores only the compressed data’s “fingerprint” (hash) on-chain. This approach reduces storage costs while preserving data privacy.

Contrary to what competitors say, ZK Compression is not a layer-2 chain on Solana; it’s an upgrade to improve Solana’s data storage and drastically reduce costs for developers.

How ZK Compression Operates on Solana

ZK Compression tackles this challenge head-on by allowing developers to compress multiple account states into a single on-chain account.

Source: 0xSumanth’s 𝕏

Here’s how it works:

  1. Account compression: Multiple account states are combined and hashed recursively into a compact 32-byte “state root.”
  2. On-chain and off-chain storage: A state tree is a binary Merkle tree that organizes data into a hierarchical structure, allowing for efficient verification of data integrity. This state root is stored on-chain, while the full account data is stored off-chain in the Solana ledger.
  3. Validating Proofs: Succinct zero-knowledge proofs confirm the existence of multiple compressed accounts within state trees, maintaining a constant 128-byte size​. When a transaction needs to access or modify the compressed data, it provides proof that the data corresponds to the on-chain state root.
  4. Verification: The proof is verified on-chain, enabling the transaction to proceed if it is valid.

The key innovation lies in the use of zero-knowledge proofs, specifically SNARKs (Succinct Non-interactive Arguments of Knowledge), to compress the Merkle proofs used in this process.

Source: 0xMert’s 𝕏

This compression reduces the proof size from potentially hundreds of bytes to a constant 128 bytes, regardless of the number of accounts being compressed.

This dramatic reduction in data size enables developers to work within Solana’s transaction size limits while still interacting with multiple compressed accounts in a single transaction.

The Upsides of ZK Compression on Solana Blockchain

These are the upsides of ZK Compression to the Solana ecosystem:

  1. Energy Efficiency: Reducing storage and computational requirements decreases the energy consumption associated with operations.
  2. Scalability: Solana’s data compression enables a higher volume of applications and transactions, enhancing overall scalability.
  3. Maintains Layer 1 Security: Unlike Layer 2 solutions, compressed data retains the full security benefits of Solana’s main chain.
  4. All-in-one environment: Developers can build and deploy applications within a single environment, eliminating the need to bridge between layers, which simplifies the building process.
  5. Reduced cost: Reduces data storage costs by minimizing on-chain storage requirements.
  6. Programmability: Compressed data remains fully compatible with Solana’s smart contracts, preserving its utility and programmability.

Downsides of ZK Compression on Solana Blockchain

These are the downsides of ZK Compression to the Solana:

  1. Computational Complexity: Generating zero-knowledge proofs is computationally intensive, which can lead to high costs and slower performance.
  2. Implementation Challenges: Developing and implementing ZK compression requires specialized knowledge in cryptography.
  3. Scalability Issues: While ZK compression aims to improve scalability, the computational requirements can sometimes offset these benefits, particularly in resource-constrained environments.
  4. Verification Overhead: Verifying zero-knowledge proofs, although generally less intensive than generating them, still requires computational resources. In some cases, this can introduce latency and impact the overall efficiency of the system.
  5. Economic Costs: The high computational demands translate to increased energy consumption and operational costs. This can make ZK compression less economically viable for certain applications.

Use cases of ZK Compression

Here are some possible use cases of zk compression:

  1. DeFi Applications: DeFi protocols on Solana like Jupiter Exchange can utilize ZK compression to help reduce fees and speed up transaction times.
  2. Micropayments: In micropayment solutions like Code, zk compression would make payments more cost-effective and sustainable on the Solana network by reducing on-chain storage requirements for the many small transactions,
  3. Decentralized Networks: Protocols such as Helium, which provide decentralized wireless networks, cater to millions of users and devices. ZK compression plays a vital role in managing the vast amount of data generated by these networks without the need for intricate Layer 2 solutions.
  4. Gaming: ZK compression could optimize storage costs in games like Honeyland. All game assets, in-game items, and NFT metadata would cost less, thereby enhancing the overall user experience.

TL;DR: Comparing ZK Rollups and ZK Compression

Similarities

  1. Use of Zero-Knowledge Proofs: Both solutions leverage zero-knowledge proofs to validate and secure transactions off-chain.
  2. Scalability Enhancement: They aim to improve blockchain scalability by reducing on-chain transaction processing and data storage.
  3. Layer-2 Solutions: Both are considered layer-2 scaling solutions built on top of their respective blockchains to increase transaction throughput and reduce costs.

Differences

  1. Blockchain Platform: ZK Rollups operate on Ethereum, while ZK Compression is implemented on Solana.
  2. Primary Focus: ZK Rollups focus on aggregating and processing transactions off-chain to enhance scalability, whereas ZK Compression primarily aims to reduce on-chain storage costs through data compression.
  3. Implementation Approach: ZK Rollups bundle multiple transactions into a single proof for submission to Ethereum’s main chain, whereas ZK Compression compresses multiple account states into a single on-chain account on Solana.
  4. Proof Size: ZK Rollups use zk-SNARKs or zk-STARKs to generate succinct proofs, while ZK Compression utilizes zk-SNARKs to compress Merkle proofs into a constant size.
  5. Transaction Handling: ZK Rollups process transactions off-chain and periodically submit proofs to Ethereum, whereas ZK Compression handles compressed account data on-chain with verification using zero-knowledge proofs.

Use Cases

Current Use Cases for ZK Rollups

  1. DeFi Applications: Enhances decentralized finance protocols by reducing transaction fees and increasing transaction speed.
  2. Decentralized Exchanges (DEXs): Facilitates efficient token swaps while maintaining privacy.
  3. Gaming: Supports scalable in-game economies and NFT marketplaces with lower costs.
  4. Payments: Enables fast and low-cost microtransactions and cross-border payments.

Potential Use Case of ZK Compression

  1. DeFi Applications: Reduces fees and speeds up transactions for DeFi protocols on Solana.
  2. Micropayments: Makes small transactions more cost-effective and sustainable by minimizing on-chain storage.
  3. Decentralized Networks: Manages large volumes of data efficiently for decentralized wireless networks and IoT applications.
  4. Gaming: Optimizes storage costs for game assets and NFT metadata, enhancing user experience.

My Honest Opinion

Whether you’re suffering from Eth Maximysis, or you’re a staunch Solana believer like me, what matters most is using the blockchain that suits your needs at the given time.

I find that ZK Rollups are best suited for projects needing high security and benefiting from Ethereum’s established ecosystem as they provide a reliable method to scale Ethereum while preserving its decentralized structure.

On the other hand, with ZK Compression, Solana can handle more transactions without getting bogged down, even when SOL’s price goes up. Therefore, I believe that ZK Compression on Solana is perfect for applications that value speed, performance, and cost-efficiency.

Solana’s ability to support high-performance, cost-efficient decentralized applications (dApps) holds a futuristic appeal because speed and cost are crucial for the widespread adoption of blockchain technology.

In the end, both ZK Rollups and ZK Compression could help make transactions quicker, cheaper, and hence more scalable.

References

S. Goldwasser, S. Micali, and C. Rackoff, 1985. “The knowledge complexity of interactive proof systems

Helius.dev

zkCompression

Cointelegraph

Ethereum.org

Techopedia

Solanacompass.com

Disclaimer:

  1. This article is reprinted from @thelxlxan/scaling-solutions-zk-rollups-on-ethereum-vs-zk-compression-on-solana-3f0386c09007">[Lilian], All copyrights belong to the original author [Lilian]. If there are objections to this reprint, please contact the Gate Learn team, and they will handle it promptly.
  2. Liability Disclaimer: The views and opinions expressed in this article are solely those of the author and do not constitute any investment advice.
  3. Translations of the article into other languages are done by the Gate Learn team. Unless mentioned, copying, distributing, or plagiarizing the translated articles is prohibited.
Start Now
Sign up and get a
$100
Voucher!