Deep Dive on ZK on Solana vs Ethereum

Makinde Mercy

Researcher
Content Writer
Blog Writer

Table of contents

Chaos in Fine Dresses

It was my friend's 25th birthday party. Plans had been made, and friends had travelled from far away to celebrate with her. The large crowd that showed up proved she was popular and friendly. I was part of the organizing team, but we only planned to cater to 100 guests, with invites sent to selected friends and family.
At first, only 30 guests were present at the set time for the party. We were all dressed up for the occasion, including her and her family. In less than two hours, the venue filled up. We had no idea how it happened. At some point, I got worried because the number of guests far exceeded what we had budgeted for.
The worst part came like a young plant sprouting overnight. When it was time to share the food and souvenirs, the first round was given to the guests. However, we couldn't tell if some guests collected twice or not. All we knew was that 100 items couldn't reach all the initial guests.
If only I had known, I would have worn trousers and a shirt. But no, the guests who didn't get souvenirs started ranting soon after, causing chaos in our fine dresses.
Funny but not funny, this is the same scenario occurring in both Ethereum and Solana. In this article, you will learn about zkRollups as a scaling solution in Ethereum and ZK compression as data storage optimization in Solana, how they work, key comparisons, and their use cases.

Introduction zk Rollups on Ethereum

Before we dive deeply into zk Rollups, it is important to understand why they are in existence. In Blockchain technology, there is something called Blockchain Trilemma.
The Blockchain Trilemma is a significant challenge that every blockchain faces in achieving mass adoption. It refers to the difficulty of simultaneously optimizing three core components: decentralization, security, and scalability. Essentially, blockchains often have to make trade-offs between these elements based on their goals and priorities. For instance, Bitcoin and Ethereum prioritize security and decentralization, but this comes at the cost of limited scalability leading to sluggishness in transaction processes.

What are Rollups?

This trilemma has led to the development of various layer-2 scaling solutions, such as rollups, to address the scalability issue without compromising security and decentralization. Rollups work by processing transactions off-chain and then submitting a single batch of transactions to the main blockchain.
Picture rollups like this: Imagine a spreadsheet listing the number of students and food choices for each class. Instead of each student submitting their food choices directly to the school principal, the teacher of each class collects the students' food choices based on quantity. Then, the headmaster processes this information and submits it as a single document instead of several documents as seen below.
ClassNumber of StudentsNoodlesRicePasta Pry one10253 Pry Two204106 Pry Three131003
This approach significantly reduces the amount of data that needs to be processed by the principal(on-chain), thereby enhancing scalability while maintaining the security and decentralization of the underlying blockchain.

Types of Rollup

There are two types of Rollups, categorized based on how they validate transactions off-chain.
Optimistic Rollups
Optimistic Rollups, as the name suggests, assume that transactions are valid by default and only check for fraud if someone challenges a transaction within a certain period. For example, the servers trust that everyone in the party will give an honest order but have a security measure in place to verify and correct any discrepancies if someone raises a concern.
Examples of Optimistic Rollups: Optimism, Arbitrum.
zk Rollups
zk Rollups, on the other hand, use "zero-knowledge proofs" to prove each batch of transactions correct by having a validity proof submitted on-chain for every batch of transactions. For example, the servers are not just collecting the order from the guests but also verifying each order's accuracy before submitting them to the caterer, ensuring that all orders are correct without needing to rely on trust.
Examples Of zk Rollups: zkSync Era, StarkNet, Polygon zkEVM.

zk-Rollups On Ethereum

To understand zk Rollups more deeply, let's elaborate on the birthday party analogy. You are at your best friend's birthday party, which is bustling with guests. Everyone wants to get food from the caterer. Some servers collect all the orders, place a tag on each person to signify they have placed an order, and then go to the caterer to get all the food at once. This way, the caterer only has to process one large order instead of many small ones, making the process much more efficient.
zk Rollups, also known as zero-knowledge Rollups, are like the servers at that party. They are layer-2 scaling solutions that move computation and state off-chain into off-chain networks while storing transaction data on-chain on a layer-1 network (like Ethereum).
Think of them as the servers at the birthday party who take orders (multiple transactions) from the guests (users), validate and organize them before going to the caterer (processed off-chain), and then submit the order as a single batch. They work by bundling or "rolling up" multiple transactions into one batch, then processed off-chain. The key feature of zk Rollups is using zero-knowledge proofs to ensure the validity of these transactions instead of assuming just like the tag on the hands of the guest.

How do they work on the Ethereum network?

zk Rollups interact with the Ethereum network in a structured and efficient manner to enhance scalability while maintaining security and decentralization. Here’s a detailed breakdown of how they work:
Batching Transactions: Multiple transactions are aggregated into a single batch off-chain. This process involves collecting numerous individual transactions and combining them into one larger transaction. This reduces the number of transactions that need to be processed on the Ethereum mainnet.
Generating Proofs: A zero-knowledge proof (specifically, a zk-SNARK or zk-STARK) is generated to prove the validity of the entire batch of transactions. Zero-knowledge proofs allow one party to prove to another that a statement is true without revealing any information beyond the validity of the statement itself. This ensures that all transactions in the batch are valid without needing to process each transaction individually.
Submitting Proofs: The proof and a minimal amount of data are submitted to the Ethereum mainnet. This submission includes the zero-knowledge proof and some essential data required to verify the proof on-chain.
Verification: The Ethereum network verifies the proof, ensuring that all transactions in the batch are valid. This verification process is efficient and does not require the Ethereum network to process each transaction individually. Instead, it only needs to verify the zero-knowledge proof, which is computationally less intensive.
Updating State: Once the proof is verified, the state of the Ethereum blockchain is updated to reflect the transactions in the batch. This includes updating account balances, smart contract states, and other relevant data.
Data Availability: zk Rollups ensure that the data required to reconstruct the state is available on-chain. This is crucial for maintaining the security and decentralization of the network, as it allows anyone to verify the correctness of the state transitions.
By following these steps, zk Rollups significantly reduce the amount of data that needs to be processed and stored on-chain, leading to improved scalability and lower transaction costs. This makes Ethereum more efficient and capable of handling a higher volume of transactions without compromising on security or decentralization.

Introduction to zk Compression on Solana

To understand what ZK Compression is, imagine a birthday party with hundreds of guests. Instead of each guest going to the caterer individually, the servers take the guests' orders. This time, instead of showing the number of guests and a list of their food choices to the caterers, the servers verify and encode these details, reducing the amount of data given to the caterer and the data processing needed.
The caterer then decodes these details and verifies them. Once verified, the caterer prepares the food, serves it, and sends it out in batches to the guests. This technique reduces the amount of time the caterer needs to handle the data processing.
For example, The order looks like this
Row 1Row 2Row 3 245943891023
Let's decode the orders:
2459 = 2 plates of Rice, 4 plates of pasta, 5 plates of Chicken Soup, 9 plates of Lobster Sauce.
4389 = 4 plates of Rice, 3 plates of Pasta, 8 plates of Chicken Soup, 9 plates of Lobster Sauce.
1023 = 1 plate of Rice, no order for Pasta, 2 plates of Chicken Soup, 3 plates of Lobster Sauce.
ZK Compression can be likened to this technique. ZK Compression is a new primitive built on Solana that enables developers to build applications at scale. It is used on the Solana network to optimize data storage and transaction processing. This technology leverages zero-knowledge proofs to compress data, ensuring that only essential information is stored on-chain while maintaining the integrity and security of the transactions.
To elaborate, zero-knowledge proofs allow one party to prove to another that a statement is true without revealing any specific details about the statement itself. In the context of ZK Compression on Solana, the network can verify the validity of transactions without needing to store all the detailed data associated with each transaction. Instead, only the proof and the essential data are stored, significantly reducing the amount of data that needs to be processed and stored.
For instance, consider the caterer analogy. The caterer (Solana) doesn't need to know the exact number of people who ordered each specific dish (individual transactions). Instead, the caterer receives a compressed summary of the orders that have been verified for accuracy. This summary is much smaller in size compared to the full list of orders, making it easier and faster for the caterer to process and serve the food.
By using ZK Compression, Solana can handle a higher volume of transactions more efficiently. This not only speeds up the network but also reduces the storage requirements, making it more cost-effective for developers and users. Furthermore, the use of zero-knowledge proofs ensures that the security and integrity of the transactions are not compromised, even though less data is being stored on-chain.

Important of ZK Compression to the Solana Network

The importance of ZK Compression to the Solana Network lies in its ability to optimize data storage and transaction processing. By compressing data using zero-knowledge proofs, zk Compression ensures that only essential information is stored on-chain, significantly reducing the amount of data that needs to be processed and stored. This leads to faster transaction times and lower costs, enhancing the network's overall efficiency.
Also, ZK Compression maintains the integrity and security of transactions, ensuring that all data is accurate and verifiable without revealing unnecessary details. This makes it particularly valuable for data-intensive applications, IoT devices, and supply chain management, where efficient data handling and security are crucial. Zk Compression helps Solana scale effectively, supporting a wide range of applications while maintaining high performance and security.

How does it function on the Solana network?

ZK Compression on Solana functions by optimizing data storage and transaction processing through the use of zero-knowledge proofs.
According to Zk-compression: this is the breakdown.
Here’s a detailed breakdown in simple terms:
Data Collection: Think of this step like a server at a party collecting orders from multiple guests. In zk Compression, data is gathered from various transactions or sources. This step ensures that all necessary information is collected before moving on to the next phase.
Data Encoding: Once the data is collected, it is encoded. This is similar to compressing a large file into a smaller zip file on your computer. The encoding process reduces the size of the data, making it more manageable and easier to handle. This compressed format is what will be submitted on-chain.
Zero-Knowledge Proofs: After encoding, zero-knowledge proofs are generated. These proofs are like a secret handshake that confirms the data is correct without revealing all the details. They allow the network to verify the accuracy and validity of the compressed data without having to go through each transaction.
On-Chain Submission: The next step is submitting the compressed data and the zero-knowledge proofs to the Solana blockchain. This submission is streamlined to include only the essential information needed to verify the data. By doing this, the amount of data stored on-chain is significantly reduced, which helps in maintaining efficiency and speed.
Verification and Decoding: Once the data is on-chain, the Solana network uses zero-knowledge proofs to verify the integrity and accuracy of the data. This step is crucial as it ensures that the data has not been tampered with and is correct. After verification, the data can be decoded back into its original form and used as needed for various applications.

Key differences between zk Rollups and zk Compression on Ethereum and Solana

Key differences between zk Rollups and zk Compression on Ethereum and Solana, respectively
Purpose
Implementation
Layer-1 vs. Layer-2
Transaction Costs
Data Handling
Scalability
Security
Flexibility

Use Cases

zk Rollups on Ethereum

DeFi Applications: zk Rollups significantly enhance the scalability of decentralized finance platforms. By reducing transaction costs and increasing throughput, they enable more users to participate in DeFi activities such as lending, borrowing, and trading without experiencing network congestion or high fees e.g. zkSync Paymaster.
NFT Marketplaces: zk Rollups facilitate faster and cheaper transactions for buying, selling, and trading non-fungible tokens. This improvement is crucial for NFT marketplaces where quick and cost-effective transactions can enhance user experience and drive higher volumes of trading activity. e.g Immutable
Gaming: In the realm of blockchain-based games, zk Rollups support high-frequency transactions. This capability is essential for games that require rapid in-game transactions, such as buying items, trading assets, or participating in multiplayer events, ensuring a smooth and responsive gaming experience. E.g. StarkNet Gaming SDKs and Immutable X.

zk Compression on Solana

Data-Intensive Applications: zk Compression optimizes storage and processing for applications that handle large amounts of data. This includes decentralized storage solutions where efficient data compression can reduce storage costs and improve retrieval times, making it easier to manage and access vast datasets. e.g
IoT Devices: For Internet of Things devices connected to the Solana network, zk Compression ensures efficient data transmission and storage. This is particularly important for IoT ecosystems where devices generate continuous streams of data that need to be securely and efficiently processed and stored on the blockchain.
Supply Chain Management: In supply chain applications, zk Compression streamlines data management and verification processes. Minimizing the data footprint and ensuring the integrity of compressed data, allows for more efficient tracking, verification, and management of goods as they move through the supply chain, enhancing transparency and reducing the risk of errors or fraud.
Token Airdrops: zk Compression significantly reduces the cost of airdropping tokens to a large number of wallets. For instance, airdropping tokens to a million wallets on Solana would typically cost over $260,000, but with zk Compression, the cost drops to $50, making it 5200 times cheaper.
NFT Projects: On Solana, creating multiple NFTs involves creating multiple accounts, which can be costly due to storage requirements on validator nodes. Zk Compression allows developers to combine many accounts into one, reducing costs significantly by storing the data more efficiently on the ledger and using cryptographic links for integrity.
Some projects like Drip, Helium, and Hivemapper utilize ZK compression in their Applications.

Conclusion

Both zk Rollups on Ethereum and zk Compression on Solana offer significant advancements in blockchain technology. zk Rollups enhance Ethereum's scalability, making it suitable for high-transaction applications like DeFi and gaming. zk Compression on Solana optimizes data storage and processing, crucial for data-intensive applications and NFT projects etc.

References

Partner With Makinde
View Services

More Projects by Makinde