Scalability and efficiency issues in blockchain technology have been significantly improved through the introduction of expansion solutions such as zk Rollups and zk Compression. But what are the differences between the two? This article, written by Kyrian Alex and compiled and translated by “Plain Language Blockchain,” explores the topic.
Title: The Differences Between zk Rollups and zk Compression
Introduction:
Scalability has been a controversial topic in the blockchain industry for a long time. As blockchain networks expand, the number of transactions per second (TPS) becomes a critical issue. Major blockchains like Bitcoin and Ethereum currently lack the capacity to handle the transaction volume required for widespread adoption. For example, Bitcoin processes approximately 7 transactions per second, while Ethereum processes around 15. In contrast, Visa averages around 1,700 transactions per second. Without expansion solutions, blockchain cannot compete with traditional financial systems and achieve mass adoption.
Furthermore, as more people use blockchain simultaneously, transaction fees become exorbitant, particularly during peak periods, hindering users and making small transactions impractical. For example, during the boom of DeFi in 2020 and 2021, Ethereum’s gas fees skyrocketed, making even small transactions extremely expensive.
To address these issues, expansion solutions have been introduced to increase the capacity and efficiency of blockchain networks, allowing for higher transaction volumes. The main goal of these expansion solutions is to increase the network’s throughput, i.e., TPS, while maintaining or improving security, decentralization, and cost-effectiveness. These solutions are crucial in reducing transaction costs, making blockchain technology more accessible for everyday use. Slow transaction times and high fees hinder user experience, deter new users, and limit the availability of decentralized applications (DApps).
One such expansion solution is zk Rollups, which is a Layer 2 solution on Ethereum. It moves computation and state off-chain while bundling transaction data into batches stored on-chain, thereby improving the scalability of the blockchain. It utilizes cryptographic proofs called zero-knowledge proofs to prove the validity of these bundled transactions without revealing actual data. This allows for faster and cheaper transactions on sidechains while maintaining security on the Ethereum mainnet.
How does zk Rollups work? A sequencer processes transactions in batches off-chain. The sequencer generates zk-SNARK (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) proofs, which are compact cryptographic proofs that verify the validity of the transactions without revealing all the details. The proofs and transaction data are then submitted to the Ethereum mainnet, where anyone can verify the proofs, ensuring the validity of the transactions. In case of disputes, anyone can submit the original transaction data for on-chain settlement, leveraging Ethereum’s robust security. Rollup includes an encryption proof, specifically zero-knowledge proof, to verify the correctness of the batched transactions. The Ethereum network only needs to verify this proof, rather than each individual transaction, significantly reducing computational load. Transactions are grouped into Rollups off-chain. Zero-knowledge proofs are generated to confirm the validity of the aggregated transactions. The proofs and minimal digest data are submitted to the Ethereum mainnet for verification. Once successfully verified, the state on the Ethereum mainnet is updated to reflect the Rollup transactions.
On the other hand, 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 protection of privacy in compressed data. This approach significantly reduces the amount of data that needs to be stored on-chain, reducing 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 the Solana blockchain by utilizing zero-knowledge (ZK) technology. Each account’s data is compressed into a unique hash value, which includes not only the account’s information but also its position in the state tree to ensure uniqueness. This hash value is stored in the 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 account information and data, compressing it into a top-level hash value called the state root. The state root, as the fingerprint of the entire state tree, ensures the integrity and completeness of all the data in the tree. Detailed account data is not stored directly on the blockchain. Instead, it is stored in cheaper Solana ledger space as call data. 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 completeness 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. Unlike zk Rollups, where transaction execution and state storage occur on a secondary chain separate from the Ethereum mainnet, zk Compression performs all transaction execution and state storage directly on the first layer (L1) chain, which is Solana itself. The key difference lies in the location of execution and state management. In zk Rollups, these processes occur on an auxiliary chain that periodically sends commitments and proofs to the main L1 chain. In contrast, zk Compression keeps all execution and state on Solana itself without a separate chain.
In summary, zk Rollups and zk Compression represent different approaches to enhancing blockchain scalability and optimizing data storage on Ethereum and Solana, respectively. While zk Rollups are considered Layer 2 expansion solutions that move transaction execution and state management to a secondary chain, zk Compression directly optimizes data storage on the main blockchain layer of Solana.
These two expansion methods emphasize the importance of a balanced approach that ensures the sustainable growth of blockchain networks while maintaining their core principles. In this regard, Solana has achieved significant advancements in adopting advanced expansion solutions, paving the way for widespread adoption and innovation in the blockchain industry.