Written by Kyrian Alex
Translation: Blockchain in Vernacular
The need for scaling solutions in blockchain technology has long been a hotly debated topic. It is well known that as blockchain networks scale, transactions per second (TPS) becomes a critical issue. Currently the capacity of major blockchains like Bitcoin and Ethereum is not sufficient to handle the transaction volume required for widespread adoption.
For example, Bitcoin processes about 7 transactions per second, while Ethereum processes about 15. In comparison, Visa processes about 1,700 transactions per second on average. Without scaling solutions, blockchain cannot compete with traditional financial systems and achieve mass adoption.
So what if we look at the actual cost of the transaction?
This is also true in practice… As more and more people use a blockchain simultaneously, transaction fees become prohibitively expensive, hindering users during peak hours and making tiny transactions impractical. For example, during the DeFi boom in 2020 and 2021, Ethereum’s gas fees soared, making even small transactions extremely expensive.
So, how do we solve this problem? We solve this problem by introducing a scaling solution.
Scaling solutions are technologies designed to increase the capacity and efficiency of blockchain networks to handle higher transaction volumes. The main goal of scaling solutions is to increase the throughput of the network, i.e. the number of transactions per second (TPS), while maintaining or improving security, decentralization, and cost-effectiveness.
Scaling solutions are critical to reducing transaction costs, enabling blockchain technology to be accepted by a wider range of users and used for daily use. Slow transaction times and high fees degrade the user experience, discourage new users from joining, and limit the usability of decentralized applications (DApps).
To attract and retain users, blockchain networks must provide seamless, fast, and cost-effective transactions, which can be achieved through effective scaling solutions.
Today, we’ll explore how different networks are addressing these challenges, specifically comparing zk Rollups on Ethereum and zk Compression on Solana. Both technologies aim to improve scalability, but they achieve this goal in different ways, reflecting the unique design philosophies and priorities of their respective ecosystems.
1. What are ZK Rollups?
ZK Rollups is an L2 scaling solution that increases the scalability of blockchain by migrating computation and state off-chain while packaging transaction data into batches and storing them on-chain.
They use cryptographic proofs called zero-knowledge proofs to prove the validity of these bundled transactions without revealing the actual data, which enables faster and cheaper transactions on the sidechain while the Ethereum mainnet remains secure.
How do they work?
A sequencer batches transactions off-chain.
The Sequencer generates a zk-SNARK (Succinct Non-cryptographic Argument of Knowledge) proof, which is a compact cryptographic proof that verifies the validity of a transaction without revealing all the details.
The proof and transaction data are submitted to the Ethereum mainnet, where anyone can verify the proof, ensuring the validity of the transaction. In the event of a dispute, anyone can submit the original transaction data for on-chain settlement, which leverages Ethereum's strong security. Rollup includes a cryptographic proof (specifically, a zero-knowledge proof) that verifies the correctness of the bundled transactions. The Ethereum network only needs to verify this proof instead of each transaction, greatly reducing the computational load. Transactions are grouped into Rollups off-chain. A zero-knowledge proof is generated to confirm the validity of the aggregated transaction. The proof and minimal summary data are submitted to the Ethereum mainnet for verification. Upon successful verification, the state on the Ethereum mainnet is updated to reflect the Rollup transaction.
2. What is ZK Compression?
ZK Compression is a technology used on the Solana blockchain to reduce data storage costs by storing only the “fingerprint” (hash) of compressed data on-chain while maintaining the privacy of the data.
The "ZK" in ZK Compression stands for zero knowledge, indicating that the privacy of compressed data is protected. This approach helps significantly reduce the amount of data that needs to be stored on-chain, thereby reducing storage costs for developers.
How does ZK Compression fully work?
ZK Compression reduces state costs on Solana by leveraging zero-knowledge (ZK) technology, which refers to the cost of storing and maintaining data (such as account balances and smart contract storage) on the blockchain.
Here’s a detailed breakdown of how it works:
The data of each account is compressed into a unique hash value. This hash value includes not only the account information, but also its position in the state tree to ensure its uniqueness. This hash value is stored in the leaf node of the state tree.
The state tree is a data structure similar to a Merkle tree, where each node is the hash of its children. The state tree summarizes all account information and data, compressing it into a top-level hash value called the state root.
The state root is the top-level hash of the state tree, stored on the blockchain. This root acts as a fingerprint for the entire state tree, ensuring the integrity and completeness of all data in the tree.
Detailed account data is not stored directly on the blockchain. Instead, it is stored as call data in the cheaper Solana ledger space. Only the state root and some basic metadata are stored on-chain, significantly reducing storage costs while maintaining data security.
To ensure the integrity and authenticity of compressed data, ZK Compression uses zero-knowledge proofs (ZK-proofs). These proofs verify the accuracy and integrity of the data without revealing its actual content, ensuring that even compressed data remains secure and verifiable.
Please note that ZK Compression is not an L2 solution, but rather an upgrade designed to make data storage on Solana more efficient.
ZK Compression differs from L2 rolling solutions because in ZK Compression, transaction execution and state storage occurs directly on the layer 1 (L1) chain, i.e. on Solana.
The key difference is where execution and state are managed. In zk Rollups, these processes occur on a secondary chain that periodically sends commitments and attestations to the main L1 chain. In contrast, ZK Compression keeps all execution and state on Solana itself, rather than on a separate chain.
This fundamental difference means that while ZK Rollups offload some processes to a second layer to enhance scalability, ZK Compression optimizes data storage directly on the main blockchain without creating a separate layer for execution.
3. The difference between the two
The key difference between zk Rollups and zk Compression on Ethereum and Solana lies fundamentally in their approach to enhancing blockchain scalability and optimizing data storage:
1) Execution and state management:
Zk Rollups: Transaction execution and state storage occur on an auxiliary chain, separate from the Ethereum mainnet. This auxiliary chain periodically sends commitments and proofs to the Ethereum mainnet.
zk Compression: All transaction execution and state storage happens directly on the first layer (L1) chain, i.e. on the Solana chain. There are no separate auxiliary chains involved here.
2) On-chain data processing:
zk Rollups: Only cryptographic proofs and minimal summary data are submitted to the Ethereum mainnet for verification. This approach minimizes the computational load on the mainnet.
zk Compression: Store only the “fingerprint” (hash) of the compressed data and the corresponding ZK proof on the Solana blockchain. This significantly reduces the amount of data stored on-chain, thereby reducing storage costs.
3) Privacy and Integrity:
zk Rollups: Use zk-SNARK (Succinct Non-cryptographic Argument of Knowledge) proofs to ensure the validity of transactions without revealing detailed transaction data. This approach ensures security while protecting the privacy of the Ethereum mainnet.
zk Compression: Combines data compression and ZK proofs to optimize blockchain storage while mathematically proving the integrity of compressed data. It ensures that the decompressed data matches the original data while not revealing the content, thereby protecting privacy.
4) Nature of the solution:
Zk Rollups: are considered as a second layer (L2) scaling solution because they offload transaction execution and state management to a secondary chain, enhancing scalability and reducing costs on the mainnet.
zk Compression: Not classified as a second-layer rolling solution, but rather an upgrade that improves data storage efficiency directly on Solana’s first-layer chain. It optimizes storage costs without introducing a separate execution layer.
4 Conclusion
Taken together, both scaling methods highlight the importance of a balanced approach to ensuring sustainable network growth while maintaining the core principles of a blockchain network.
In this regard, Solana has made significant achievements in adopting advanced scaling solutions, paving the way for widespread adoption and innovation in the blockchain industry.