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, authored by Kyrian Alex and compiled, translated, and written by “Baihua Blockchain,” explores these differences.
Over the years, the need for scaling solutions in blockchain technology has been a topic of much debate. As blockchain networks expand, the number of transactions per second (TPS) becomes a critical issue. Major blockchains like Bitcoin and Ethereum currently have capacities that are insufficient to handle the transaction volume required for widespread adoption.
For example, Bitcoin processes about 7 transactions per second, while Ethereum processes about 15. In contrast, Visa averages around 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 reality is that as more people use blockchain simultaneously, transaction fees become very high. During the DeFi boom in 2020 and 2021, Ethereum gas fees skyrocketed, making even small transactions extremely expensive.
To address this problem, we introduce scaling solutions. Scaling solutions are technologies designed to improve 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., the number of transactions per second (TPS), while maintaining or improving security, decentralization, and cost-effectiveness.
Scaling solutions are crucial for reducing transaction costs, allowing blockchain technology to be more widely adopted and used in daily life. Slow transaction times and high fees diminish the user experience, hinder new user onboarding, 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 efficient scaling solutions.
Today, we will explore how different networks are tackling these challenges, specifically comparing zk Rollups on Ethereum and zk Compression on Solana. Both technologies aim to enhance scalability but achieve this goal in different ways, reflecting their respective ecosystem’s unique design principles and priorities.
ZK Rollups are a Layer 2 scaling solution that moves computation and state off-chain while bundling transaction data into batches stored on-chain, thereby increasing the scalability of the blockchain. They utilize cryptographic proofs called zero-knowledge proofs to prove the validity of these bundled transactions without revealing the actual data. This allows for faster and cheaper transactions on side chains while maintaining the security of the Ethereum mainnet.
How do they 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 transactions without revealing all the details. The proofs and transaction data are 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 the robust 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 rather than every transaction, significantly reducing the computational load. Transactions are grouped into Rollups off-chain. Zero-knowledge proofs are generated to confirm the validity of aggregated transactions. The proofs and minimal digest data are submitted to the Ethereum mainnet for verification. After successful verification, the state on the Ethereum mainnet is updated to reflect the Rollup transactions.
ZK Compression, on the other hand, 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 data privacy in the compressed data. 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 work? ZK Compression reduces the cost of state on Solana, which refers to the cost of storing and maintaining data (such as account balances and smart contract storage) on the blockchain, by leveraging zero-knowledge (ZK) technology.
Here’s a detailed breakdown of how it works:
– The data for 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, ensuring 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, which is the top-level hash value of the state tree, is stored on the blockchain. This root serves as the fingerprint of all data in the tree, ensuring the integrity and completeness of all data.
– Detailed account data is not directly stored on the blockchain. Instead, it is stored as call data in the more cost-effective 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 the compressed data, ZK Compression utilizes zero-knowledge proofs (ZK-proofs). These proofs verify the accuracy and completeness of the data without revealing its actual content, ensuring that even the compressed data remains secure and verifiable.
It’s 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 transaction execution and state storage occur directly on the first layer (L1) chain, which is Solana.
The key distinction lies in the location of execution and state management. In zk Rollups, these processes occur on an auxiliary chain separate from the Ethereum mainnet. The auxiliary chain periodically sends commitments and proofs to the main L1 chain. In contrast, ZK Compression keeps all execution and state on 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 execution layer.
The differences between zk Rollups and zk Compression on Ethereum and Solana, respectively, fundamentally lie in their approaches to enhancing blockchain scalability and optimizing data storage:
– zk Rollups: Transaction execution and state storage occur on an auxiliary chain separate from the Ethereum mainnet. The auxiliary chain periodically 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 involvement of a separate auxiliary chain.
– 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 corresponding ZK proofs are stored on the Solana blockchain. This significantly reduces the amount of data stored on-chain, thereby lowering storage costs.
– zk Rollups: Utilize zk-SNARK (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) proofs to ensure the validity of transactions without revealing detailed transaction data. This method ensures privacy on the Ethereum mainnet while maintaining security.
– 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 its content, thus preserving privacy.
– zk Rollups: Considered as 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 an upgrade aimed at improving data storage efficiency on Solana. It optimizes storage costs without introducing a separate execution layer.
In conclusion, both these scaling approaches emphasize the importance of balancing the sustainable growth of the network while adhering to the core principles of blockchain technology.
In this regard, Solana has made significant strides in adopting advanced scaling solutions, paving the way for widespread adoption and innovation in the blockchain industry.