Comparing zk-Rollups on Ethereum and zk-Compression on Solana 🧑💻
ABSTRACT
The appropriate, effective and efficient use of cryptographic protocols contributes to many new advances based on real-world privacy protection. One of the most important cryptographic protocols is zero-knowledge proofs. Zero-knowledge proofs have recently become important for decentralized systems, especially in the context of privacy. Whether it is electronic voting, e-cash, e-auctions or anonymous credentials, In many decentralized systems, zero knowledge interval proofs are used as building blocks.
This article provides an in-depth comparison between zk Rollups on Ethereum and zk Compression on Solana, two cutting-edge technologies designed to enhance blockchain scalability and performance. zk Rollups are layer 2 scaling solutions that improve Ethereum’s throughput by moving computation and state storage off-chain, batching transactions, and using cryptographic proofs to ensure data integrity. zk Compression, on the other hand, is a new primitive on Solana that reduces state costs by compressing on-chain data while preserving security and performance through minimal state storage and the use of zero-knowledge proofs.
The comparison highlights key differences in architecture, implementation, performance, scalability, and developer ecosystem. zk Rollups excel in providing robust security and high throughput by leveraging Ethereum’s mainnet for data availability and state verification. Conversely, zk Compression offers superior cost efficiency and scalability by storing only essential state information on Solana’s cheaper ledger space, making it ideal for applications requiring high-frequency transactions and large-scale data handling.
The article concludes that zk Compression on Solana is more promising due to its significant cost savings, enhanced scalability, seamless composability, and advanced cryptographic security features. These advantages position zk Compression as a future-proof solution, capable of supporting the next generation of decentralized applications with higher efficiency and lower operational costs.
INTRODUCTION
Introduction to zk Rollups on Ethereum
1. Definition and Functionality
— What are zk Rollups?
— How do they work on the Ethereum network?
— Advantages and limitations
2. Technical Details
— Batch processing and validity proofs
— Interaction with Ethereum Mainnet
— Components: smart contracts, off-chain VM, state maintenance
— Security aspects and data availability
Introduction to zk Compression on Solana
1. Definition and Functionality
— What is zk Compression?
— How does it function on the Solana network?
— Advantages and limitations
2. Technical Details
— State cost reduction
— Minimal state cost, execution, and data availability on Solana L1
— Components: compressed accounts, state trees, validity proofs
— Composability and integration with existing Solana programs
Key Differences between zk Rollups and zk Compression
1. Architecture and Implementation
— Data handling and transaction processing
— Security models and cryptographic proofs
— Interaction with their respective L1 networks
2. Performance and Scalability
— Throughput and latency
— Cost efficiency and gas fees
— Handling large datasets and high transaction volumes
3. Development and Ecosystem
— Developer tools and community support
— Compatibility with existing infrastructure
— Adoption and use cases
Use Cases
1. zk Rollups on Ethereum
— Current use cases: DeFi, NFT platforms, DApps
— Potential future applications
2. zk Compression on Solana
— Current use cases: high-frequency trading, gaming, large-scale applications
— Potential future applications
Conclusion
1. Comparative Summary
— Strengths and weaknesses of zk Rollups and zk Compression
— Suitability for different types of applications
2. Personal Perspective
— Which technology is more promising and why
— Future outlook for zk Rollups and zk Compression
Introduction to zk Rollups on Ethereum
Definition and Functionality
Zero-knowledge rollups (zk Rollups) are a layer 2 scaling solution for Ethereum designed to increase the network’s throughput by moving computation and state storage off-chain. By bundling multiple transactions into a single batch and submitting a summary to the Ethereum mainnet along with cryptographic proofs (validity proofs), zk Rollups can process thousands of transactions efficiently. This method ensures that only essential data is posted on-chain, significantly reducing congestion and gas fees while maintaining high security standards.
Zero-knowledge rollups (ZK-rollups) bundle (or ‘roll up’) transactions into batches that are executed off-chain. Off-chain computation reduces the amount of data that has to be posted to the blockchain. ZK-rollup operators submit a summary of the changes required to represent all the transactions in a batch rather than sending each transaction individually. They also produce validity proofs to prove the correctness of their changes. [1]
The ZK-rollup’s state is maintained by a smart contract deployed on the Ethereum network. To update this state, ZK-rollup nodes must submit a validity proof for verification. As mentioned, the validity proof is a cryptographic assurance that the state-change proposed by the rollup is really the result of executing the given batch of transactions. This means that ZK-rollups only need to provide validity proofs to finalize transactions on Ethereum instead of posting all transaction data on-chain like optimistic rollups.
There are no delays when moving funds from a ZK-rollup to Ethereum because exit transactions are executed once the ZK-rollup contract verifies the validity proof. Conversely, withdrawing funds from optimistic rollups is subject to a delay to allow anyone to challenge the exit transaction with a fraud proof.
ZK-rollups write transactions to Ethereum as calldata
. calldata
is where data that is included in external calls to smart contract functions gets stored. Information in calldata
is published on the blockchain, allowing anyone to reconstruct the rollup’s state independently. ZK-rollups use compression techniques to reduce transaction data—for example, accounts are represented by an index rather than an address, which saves 28 bytes of data. On-chain data publication is a significant cost for rollups, so data compression can reduce fees for users. [2]
Technical Details
zk Rollups achieve their efficiency through batch processing and validity proofs. Operators of zk Rollups bundle transactions off-chain, execute them, and generate a succinct cryptographic proof to verify the correctness of the batch. This proof is then submitted to an on-chain smart contract, which updates the Ethereum state accordingly. Key components of zk Rollups include smart contracts for state maintenance, an off-chain virtual machine (VM) for executing transactions, and data availability mechanisms to ensure the integrity of the state.
A ZK-rollup chain is an off-chain protocol that operates on top of the Ethereum blockchain and is managed by on-chain Ethereum smart contracts. ZK-rollups execute transactions outside of Mainnet, but periodically commit off-chain transaction batches to an on-chain rollup contract. This transaction record is immutable, much like the Ethereum blockchain, and forms the ZK-rollup chain.
The ZK-rollup’s core architecture is made up of the following components:
On-chain contracts: As mentioned, the ZK-rollup protocol is controlled by smart contracts running on Ethereum. This includes the main contract which stores rollup blocks, tracks deposits, and monitors state updates. Another on-chain contract (the verifier contract) verifies zero-knowledge proofs submitted by block producers. Thus, Ethereum serves as the base layer or “layer 1” for the ZK-rollup.
Off-chain virtual machine (VM): While the ZK-rollup protocol lives on Ethereum, transaction execution and state storage happen on a separate virtual machine independent of the EVM. This off-chain VM is the execution environment for transactions on the ZK-rollup and serves as the secondary layer or “layer 2” for the ZK-rollup protocol. Validity proofs verified on Ethereum Mainnet guarantee the correctness of state transitions in the off-chain VM.
ZK-rollups are “hybrid scaling solutions” — off-chain protocols that operate independently but derive security from Ethereum. Specifically, the Ethereum network enforces the validity of state updates on the ZK-rollup and guarantees the availability of data behind every update to the rollup’s state. As a result, ZK-rollups are considerably safer than pure off-chain scaling solutions, such as sidechains, which are responsible for their security properties, or validiums, which also verify transactions on Ethereum with validity proofs, but store transaction data elsewhere.
Introduction to zk Compression on Solana
Definition and Functionality
zk Compression is a novel scaling primitive on Solana that allows developers to compress on-chain state, drastically reducing state costs while preserving the security and performance of the Solana L1. By storing minimal state information on-chain and leveraging cheaper ledger space for the bulk of data, zk Compression achieves cost efficiency and scalability without compromising on security.
Technical Details
The core of zk Compression lies in its ability to minimize state costs. Regular accounts and data are stored in a compressed format, which is both cost-effective and secure. The system utilizes compressed accounts, state trees, and zero-knowledge proofs to ensure data integrity. This setup allows for seamless integration with existing Solana programs, providing a scalable solution for applications requiring high-frequency transactions and large-scale data handling.
ZK compressed state is stored in compressed accounts. Compressed accounts are similar to regular Solana accounts but with four main differences:
Key Differences
Each compressed account can be identified by its hash
Each write to a compressed account changes its hash
An
address
can optionally be set as a permanent unique ID of the compressed accountAll compressed accounts are stored in sparse state trees. Only the tree’s state root (small fingerprint of all compressed accounts) is stored in the on-chain account space.
These differences allow the protocol to store states as calldata in the less expensive Solana ledger space instead of costly on-chain account space.
To understand the similarities and differences between Solana’s regular account model and compressed accounts, let’s first look at compressed accounts with Program-Derived Addresses (PDAs).
We will not make a mistake if we list the working logic of zk compression step by step.
Core Concepts (Working Logic) of ZK Compression
Compressed Account Model
The compressed account model is designed to store state more efficiently on Solana by using compressed accounts. These accounts occupy less on-chain space and reduce state costs significantly.
Compressed PDA Accounts
Like regular accounts, each compressed PDA account can be identified by its unique persistent address, represented as 32 bytes in the format of a PublicKey
. Like PDAs, compressed account addresses don't belong to a private key; rather, they're derived from the program owning them.
The compressed PDA account layout is similar to Solana’s regular PDA account layout: Data, Lamports, Owner, and an address field. The data field stores the program state. Notice the enshrined AccountData structure: Discriminator, Data, DataHash:
The Anchor framework reserves the first 8 bytes of a regular account’s data field for the discriminator. This helps programs distinguish between different program-owned accounts. The default compressed account layout is opinionated in this regard and enforces a discriminator in the Data field. You can ignore the dataHash field for now; we cover its importance for ZK Compression later. [3]
State Trees
State trees are binary Merkle trees that organize data into a structure where each node is a hash of its children. This ensures efficient cryptographic verification of account states.
The hash of each compressed account is stored as a leaf in such a state tree:
Note that each compressed account hash includes the Public Key of the State tree’s respective on-chain account (State tree hash
) and the compressed account's position in the tree (leafIndex
). This ensures that each account hash is globally unique.
Each state tree has a corresponding on-chain State tree account that stores only the tree’s final root hash and other metadata. Storing the final tree root hash on-chain allows the protocol to efficiently verify the validity of any leaf (compressed account) in the tree. The raw state can thus be stored as calldata in the much cheaper Solana ledger space while preserving the security guarantees of the Solana L1. [4]
Validity Proofs
Validity proofs are succinct zero-knowledge proofs that verify the integrity of the compressed state without revealing the underlying data. These proofs ensure that all state transitions are correct and secure.

Lifecycle of a Transaction
The lifecycle of a transaction involves reading or writing to compressed accounts, submitting validity proofs, and updating state trees. Each transaction specifies the compressed accounts involved and proves the validity of their states.
Limitations
Before using ZK Compression to scale your application state, you should consider the limitations of compressed accounts:
Limitations of zk Compression include increased transaction size and compute unit usage, which can lead to higher costs and potential scalability challenges during peak network usage.
You may prefer the account not to be permanently compressed if:
The account gets updated very frequently within a single block (e.g., shared liquidity pools in a DeFi protocol)
You expect the lifetime number of writes to the same account to be very large (>>1000x)
The account stores large amounts of data, and you need to access a large part of it (>1kb) inside one on-chain transaction.
Key Differences between zk Rollups and zk Compression
Architecture and Implementation,
zk Rollups on Ethereum
- Data Handling and Transaction Processing: zk Rollups batch transactions off-chain and submit summarized data to Ethereum with cryptographic proofs. This method reduces on-chain data but requires periodic mainnet interaction for validation.
- Security Models and Cryptographic Proofs: zk Rollups use zk-SNARKs or zk-STARKs for validity proofs, ensuring transaction integrity without revealing individual transaction details. These proofs verify off-chain state transitions, providing robust security.
- Interaction with Ethereum L1: zk Rollups are tightly coupled with Ethereum’s L1, relying on it for security, data availability, and state verification. The on-chain smart contracts manage state updates and validate proofs, making the system secure but dependent on Ethereum’s network conditions.
zk Compression on Solana
- Data Handling and Transaction Processing: zk Compression focuses on reducing on-chain state costs by compressing data and storing minimal state information on-chain. The bulk of the data is stored in Solana’s cheaper ledger space, significantly reducing expenses.
- Security Models and Cryptographic Proofs: zk Compression employs zk-STARKs to ensure data integrity. These proofs are quantum-resistant and do not require a trusted setup, enhancing the system’s security and future-proofing it against quantum attacks.
- Interaction with Solana L1: zk Compression seamlessly integrates with Solana’s L1, leveraging its efficient ledger space for cost-effective data storage. The system maintains high throughput and low latency, handling large transaction volumes without significantly increasing on-chain data.
Performance and Scalability
zk Rollups on Ethereum
- Throughput and Latency: zk Rollups achieve high throughput by batching transactions and reducing on-chain data. However, they still face latency issues due to periodic mainnet interactions for proof validation.
- Cost Efficiency and Gas Fees: zk Rollups reduce gas fees by minimizing the data posted on-chain. Nevertheless, the need to periodically interact with Ethereum’s mainnet can lead to higher costs during peak network usage.
- Handling Large Datasets: zk Rollups can manage large datasets efficiently, but their reliance on Ethereum’s mainnet for state validation and data availability can introduce bottlenecks during high traffic periods.
zk Compression on Solana
- Throughput and Latency: zk Compression provides superior scalability by minimizing on-chain state costs and leveraging Solana’s efficient ledger space. This approach ensures high throughput and low latency, even with a large number of users and transactions.
- Cost Efficiency and Gas Fees: zk Compression drastically reduces costs by storing only essential state information on-chain. The protocol’s use of cheaper ledger space enables applications to scale economically without incurring high expenses.
- Handling Large Datasets: zk Compression excels in handling large datasets due to its efficient data compression techniques and minimal on-chain storage. This makes it ideal for applications requiring extensive data handling and high-frequency transactions.
Development and Ecosystem
zk Rollups on Ethereum
- Developer Tools and Community Support: zk Rollups benefit from Ethereum’s extensive developer tools and vibrant community. Developers have access to a wide range of resources, making it easier to build and deploy zk Rollup solutions.
- Compatibility with Existing Infrastructure: zk Rollups are compatible with existing Ethereum infrastructure, allowing developers to integrate them into existing DApps and platforms seamlessly.
- Adoption and Use Cases: zk Rollups are widely adopted in decentralized finance (DeFi), non-fungible token (NFT) platforms, and various decentralized applications (DApps). Their ability to process large transaction volumes with reduced gas fees makes them ideal for high-throughput applications.
zk Compression on Solana
- Developer Tools and Community Support: zk Compression leverages Solana’s composability and integration capabilities, offering a versatile and efficient solution for developers. The ecosystem provides robust support and resources for building zk Compression-based applications.
- Compatibility with Existing Infrastructure: zk Compression integrates seamlessly with Solana’s existing infrastructure, allowing developers to build sophisticated applications that leverage both compressed and uncompressed states.
- Adoption and Use Cases: zk Compression is particularly suited for high-frequency trading, gaming, and applications demanding large-scale data handling. Its cost efficiency and scalability make it a promising solution for developers looking to build applications that can handle significant user and transaction volumes.
Conclusion of Key Differences
In summary, zk Rollups on Ethereum and zk Compression on Solana offer unique strengths and weaknesses. zk Rollups excel in security and throughput, making them suitable for applications requiring high transaction volumes and robust security. On the other hand, zk Compression shines in cost efficiency and scalability, particularly for applications needing to manage large-scale data and high-frequency transactions. While both technologies are promising, zk Compression on Solana may have a slight edge for applications requiring massive scalability and cost efficiency due to its advanced cryptographic security features and minimal state costs.
Use Cases
zk Rollups on Ethereum
Currently, zk Rollups are widely used in decentralized finance (DeFi), non-fungible token (NFT) platforms, and various decentralized applications (DApps). Their ability to process large volumes of transactions with reduced gas fees makes them ideal for applications requiring high throughput and security.
zk Compression on Solana
zk Compression is particularly suited for high-frequency trading, gaming, and applications that demand large-scale data handling. Its cost efficiency and scalability make it a promising solution for developers looking to build applications that can handle a significant number of users and transactions.
Conclusion
Comparative Summary
zk Rollups on Ethereum and zk Compression on Solana both offer unique strengths and weaknesses. zk Rollups excel in security and throughput, making them suitable for applications requiring high transaction volumes and robust security. zk Compression, on the other hand, shines in cost efficiency and scalability, particularly for applications needing to manage large-scale data and high-frequency transactions.
Personal Perspective
While both technologies are promising, zk Compression on Solana may have a slight edge for applications requiring massive scalability and cost efficiency. However, Solana’s zk Compressive is more useful and I personally think I prefer it due to some reasons:
1. Cost Efficiency: zk Compression significantly reduces state costs by leveraging cheaper ledger space on Solana rather than the more expensive on-chain account space used by zk Rollups on Ethereum. For example, the creation cost for a 100-byte PDA account using zk Compression is approximately 0.00001 SOL, which is 160 times cheaper than a regular account. Similarly, creating 100 token accounts costs around 0.00004 SOL with zk Compression, compared to 0.2 SOL without it. This drastic reduction in cost allows applications to scale economically, making zk Compression particularly attractive for developers looking to minimize expenses while maintaining high performance.
2. Performance and Scalability: zk Compression provides superior scalability by reducing the amount of data stored on-chain. The protocol only stores the state roots (small fingerprints of all compressed accounts) on-chain, while the underlying data resides in the cheaper Solana ledger space. This approach ensures that the system can handle a large number of users and transactions without significantly increasing on-chain data, thereby maintaining high throughput and low latency. In contrast, zk Rollups, while efficient, still require periodic posting of batch summaries and validity proofs on the Ethereum mainnet, which can introduce bottlenecks and higher costs during peak usage.
3. Data Availability and Security: zk Compression maintains the security and performance guarantees of Solana’s L1 by storing minimal state information on-chain and using zero-knowledge proofs to ensure the integrity of the compressed state. The system employs a binary Merkle tree structure to organize data, allowing for efficient cryptographic verification of all compressed accounts. This setup ensures that the security and integrity of the data are preserved without the need for extensive on-chain storage, which is a critical limitation of zk Rollups that rely heavily on the Ethereum mainnet for data availability and state verification.
4. Composability and Integration: Solana programs can seamlessly integrate zk Compression, mixing and matching between compressed and regular on-chain state. This composability allows for atomic interaction with multiple programs, accounts, and compressed accounts, enhancing the flexibility and utility of zk Compression. Developers can build sophisticated applications that leverage both compressed and uncompressed states, providing a versatile and efficient solution that zk Rollups struggle to match due to their more rigid architecture and reliance on off-chain computation.
5. Future-proof and Quantum Resistance: zk Compression leverages zk-STARKs (Zero-Knowledge Scalable Transparent Argument of Knowledge), which are inherently resistant to quantum computing attacks. This makes zk Compression more future-proof compared to zk-SNARKs used in many zk Rollup implementations, which rely on elliptic curve cryptography susceptible to quantum attacks. Additionally, zk-STARKs do not require a trusted setup, eliminating the risks associated with multi-party computation ceremonies needed for zk-SNARKs, thereby enhancing the overall security and trustworthiness of the system.
Conclusion: zk Compression on Solana represents a more promising technology than zk Rollups on Ethereum due to its superior cost efficiency, scalability, data availability, composability, and security features. By leveraging cheaper ledger space, minimal state costs, and advanced cryptographic techniques, zk Compression provides a robust and scalable solution that can handle the demands of modern decentralized applications. Its future-proof design and seamless integration capabilities make it an attractive choice for developers aiming to build scalable, cost-effective, and secure blockchain applications.