The scalability and efficiency issues of blockchain technology have been significantly improved through the introduction of scaling solutions such as zk Rollups and zk Compression. But what are the differences between the two? This article, written by Kyrian Alex and compiled, translated, and written by “Plain Language Blockchain,” explores the topic.
Over the years, the need for scaling solutions in blockchain technology has been a controversial topic. It is well-known that with the scaling of blockchain networks, the number of transactions per second (TPS) becomes a critical issue. Currently, major blockchains like Bitcoin and Ethereum do not have the capacity 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 an average of about 1,700 transactions per second. Without scaling solutions, blockchain cannot compete with traditional financial systems and achieve mass adoption.
So, what about the cost of actual transactions? The situation is the same. As more people use blockchain simultaneously, transaction fees become very high, making it impractical for small transactions, especially during peak times. For example, during the DeFi boom in 2020 and 2021, Ethereum gas fees skyrocketed, making even small transactions extremely expensive.
So, how do we solve this problem? We solve it by introducing scaling solutions.
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 network’s throughput, i.e., transactions per second (TPS), while maintaining or improving security, decentralization, and cost-effectiveness.
Scaling solutions are crucial for reducing transaction costs, enabling blockchain technology to be adopted by a wider range of users for everyday use. Slow transaction times and high fees diminish user experience, hinder new user adoption, and limit the availability 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 will explore how different networks address these challenges, particularly comparing zk Rollups on Ethereum and zk Compression on Solana. Both technologies aim to enhance scalability but achieve this goal in different ways, reflecting the unique design concepts and priorities of their respective ecosystems.
ZK Rollups are a Layer 2 scaling solution that moves the computation and state off-chain while bundling transaction data into batches stored on-chain, thereby increasing the scalability of the blockchain. They use cryptographic proofs called zero-knowledge proofs to prove the validity of these bundled transactions without revealing actual data. This enables faster and cheaper transactions on a sidechain while maintaining the security of the Ethereum mainnet.
How do they work? A sequencer processes transactions in batches off-chain. The sequencer generates a zk-SNARK (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) proof, which is a compact cryptographic proof that verifies the validity of the transactions without revealing all the details. The proof and transaction data are submitted to the Ethereum mainnet, where anyone can verify the proof to ensure the validity of the transactions. In case of disputes, anyone can submit the original transaction data for on-chain settlement, leveraging the strong security of Ethereum. Rollups include an encryption proof, specifically a zero-knowledge proof, to verify the correctness of bundled transactions. The Ethereum network only needs to verify this proof, not every transaction, greatly reducing the computational load. Transactions are grouped into Rollups off-chain. Zero-knowledge proofs are generated to confirm the validity of aggregated transactions. The proof and minimal digest data are submitted to the Ethereum mainnet for verification. Once successfully verified, the state on the Ethereum mainnet will be updated to reflect the Rollup transactions.
ZK Compression is a technology used on the Solana blockchain to reduce data storage costs. It only stores the “fingerprint” (hash) of compressed data on-chain while maintaining data privacy. The “ZK” in ZK Compression stands for zero-knowledge, indicating the privacy of compressed data is protected. This approach significantly reduces the amount of data that needs to be stored on-chain, lowering storage costs for developers.
How does ZK Compression work? ZK Compression reduces the cost of storing and maintaining data (such as account balances and smart contract storage) on Solana by utilizing zero-knowledge (ZK) technology. Here’s a breakdown of how it works:
Each account’s data is compressed into a unique hash value. This hash value includes not only the account’s information but also its position in the state tree, ensuring uniqueness. This hash value is stored in leaf nodes of the state tree.
The state tree is a data structure similar to a Merkle tree, where each node is the hash of its child nodes. The state tree aggregates all the account information and data, compressing it into a top-level hash called the state root.
The state root, as the top-level hash of the state tree, is stored on the blockchain. This root serves as a fingerprint of all data in the tree, ensuring integrity and completeness of all data.
Detailed account data is not stored directly on the blockchain. Instead, it is stored as call data in 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 the security and verifiability of even compressed data.
It is important to note that ZK Compression is not an L2 solution but an upgrade aimed at improving data storage efficiency on Solana. ZK Compression differs from L2 rollup solutions in that, in ZK Compression, transaction execution and state storage occur directly on the first layer (L1) chain, which is Solana.
The key difference lies in the location of execution and state management. In zk Rollups, these processes happen on an auxiliary chain separate from the Ethereum mainnet. This auxiliary chain regularly sends commitments and proofs to the main L1 chain. In contrast, ZK Compression keeps all execution and state within Solana itself, without the need for a separate chain.
This fundamental difference means that while zk Rollups move some processes to the second layer to enhance scalability, ZK Compression optimizes data storage directly on the main blockchain without establishing a separate layer for execution.
The differences between zk Rollups and zk Compression on Ethereum and Solana, respectively, fundamentally reflect their approaches to enhancing blockchain scalability and optimizing data storage:
zk Rollups: Transaction execution and state storage happen on an auxiliary chain separate from the Ethereum mainnet. This auxiliary chain regularly sends commitments and proofs to the Ethereum mainnet.
zk Compression: All transaction execution and state storage occur directly on the first layer (L1) chain, which is Solana. There is no separate auxiliary chain involved.
zk Rollups: Only cryptographic proofs and minimal digest data are submitted to the Ethereum mainnet for verification. This approach minimizes the computational load on the mainnet.
zk Compression: Only the “fingerprint” (hash) of compressed data and the corresponding ZK proofs are stored on the Solana blockchain. This significantly reduces the amount of data stored on-chain, lowering storage costs.
zk Rollups: Use zk-SNARK (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) proofs to ensure the validity of transactions without revealing detailed transaction data. This approach ensures privacy while maintaining the security 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 without revealing the content, thus protecting privacy.
zk Rollups: Considered Layer 2 scaling solutions as they move transaction execution and state management to a secondary chain, enhancing scalability and reducing costs on the mainnet.
zk Compression: Not classified as a Layer 2 rollup solution but rather an upgrade that directly improves data storage efficiency on Solana’s first layer chain. It optimizes storage costs without introducing a separate execution layer.
In conclusion, both of these scaling approaches emphasize the importance of a balanced approach to sustainable network growth while maintaining the core principles of blockchain networks.
In this regard, Solana has achieved significant advancements in adopting advanced scaling solutions, paving the way for widespread adoption and innovation in the blockchain industry.