When Ethereum entered the scene in 2015, blockchain’s potential expanded from the peer-to-peer transactions introduced by Bitcoin to the ability to build any kind of application on a decentralized network. Today, Ethereum has grown into a $47.5B (TVL) ecosystem of decentralized finance (DeFi) , games, digital art platforms, and more.
ZK Rollups are here to help Ethereum continue on this path to mass adoption of blockchain based apps by overcoming an inherent obstacle. The challenge lies in scalability. Before Rollups appeared at the scene, the network got congested during peak usage periods, which made transactions expensive and slow. So much the worse for blockchain based apps right? After all, who would want to play a game that’s expensive and slow? Luckily we have ZK Rollups, our rescuers!
Understanding ZK Rollups
Also known as validity Rollups, ZK Rollups are a class of Layer 2 (L2) solutions. L2’s generally aim at making transactions settled on Ethereum faster and cheaper. They do this by offloading the heavy computation associated with transaction execution from L1. Rollup solutions do this by executing many transactions off the main chain, batching them together, and then processing the batch on Ethereum as a single transaction.
You might be wondering how Ethereum operators know these many transactions executed on L2 are even legit? Well, the beauty with the heroes in this story, ZK Rollups, is there’s no need to actually trust the way they operate. After they execute and batch together many transactions, they produce a cryptographic proof—known as a “ZK proof”—that mathematically attests to the validity of the batch. They send that to L1 for verification along with the state difference that updates Ethereum regarding the new state of the L2. We’ll soon spell out exactly how this makes Ethereum transactions faster and cheaper, thus also broadening the landscape for innovative apps being built on blockchain.
For a deeper understanding of the way ZK Rollups operate, check out this blog post.
For the rest of you, let’s continue!
Cost reduction with ZK Rollups
So, how do ZK Rollups achieve massive reductions in fees? When you break up the way ZK Rollups process transactions, the factors that go into cost reduction are clear. ZK Rollups operate by:
- Offloading transaction execution: ZK Rollups handle the heaviest computation off L1, where the rollup’s operators don’t have to pay Ethereum gas fees (gas refers to Ethereum transaction fees) and computation and storage are cheap. Since operators pay less to execute transactions, they can afford to pass on the cost reduction to users in the form of lower transaction fees. And there’s no reason to worry about security since the outcome of all this computation is settled and finalized on Ethereum.
- Spreading L1 costs across many transactions: But what about the L1 costs the rollup operators do have to pay? After all, we said the execution is handled on L2, but a verifier on L1 has to validate the proof generated on L2. ZK Rollups slash costs even on that front too. L1 costs on Ethereum are fixed per transaction. Because ZK Rollups process thousands of L2 transactions on Ethereum at once, they spread the fixed L1 costs across those transactions. Once again, those cost savings can be passed onto users in the form of lower fees.
- Compressing data stored on L1: Thirdly, apart from batching transactions, ZK Rollups also reduce transaction fees by compressing the transaction data submitted to Ethereum. The state difference (“State Diff”), for example, isn’t an exhaustive registry of all the new transactions on the network, but only the differences between the previous and current state, thus minimizing the amount of data that needs to be processed and stored on Ethereum by canceling out redundancies.
Following Ethereum’s recent EIP-4844 upgrade, State Diffs can be sent to Ethereum not only as calldata but also as blobs, which reduces data availability (DA) costs of Rollups. You can read more about EIP-4844 in this blog post.
The bottom line is that ZK Rollups make transaction fees so cheap that they are practically negligible. For example, an in-app swap on Starknet can now be as low as $0.04! Using blockchain is just not costly anymore.
Faster transactions with ZK Rollups
After spelling out how ZK Rollups reduce transaction costs, it’s also important to realize the symbiotic relationship between “faster” and “cheaper”: Transactions costs are reduced just by increasing transaction throughput. Ethereum can only process about 15 transactions per second (TPS), so when demand is high, the network gets congested, and when the network gets congested, prices go up. ZK Rollups, like Starknet, make Ethereum uncloggable and very, very fast.
All the features mentioned above that result in cheaper transactions are also associated with higher TPS. The reason Ethereum has a throughput problem, to begin with, is its highly decentralized and inclusive nature. Ethereum blocks have to be small enough so that the smallest computer on the network can also participate in operating it. But ZK Rollups are a way to bypass this obstacle to scalability, as they take advantage of Ethereum’s decentralized and secure settlement base while processing multiple transactions off Ethereum and sending them for finalization as though they were a single transaction in a block. That’s basically a way of sneaking in several transactions in one!
So, both handling computations off L1 and compressing transaction data achieve faster transactions on Ethereum. But the story doesn’t end here. ZK Rollups continuously find innovative ways to make transactions even faster! Starknet v0.13.2, for example, has some new features, making everything go vroom vroom. Examples of these are “parallel execution” of transactions and “block packing,” which decouples block frequency from fixed L1 block submission fees, thus reducing block times. These new features put Starknet at a capacity to execute 250-500 tps!
Faster transactions allow for better user experience and innovative dApps that couldn’t be maintained onchain otherwise. One example is the fully onchain space strategy MMO hosted on Starknet, Influence, with its smooth and scalable gameplay. Another example is Paradex, a decentralized perpetual exchange built on Starknet, whose complex business logic demands an infrastructure with high tps. First relying on validity proofs for trust assumptions and only later on L1 consensus mechanisms makes a world of difference for seamless user experience. Thanks to ZK Rollups, any application you can imagine building onchain becomes feasible and user friendly.
Security and efficiency
As mentioned, although ZK Rollups take most computation off Ethereum, thus achieving faster and cheaper transactions, security isn’t compromised at all. That’s because ZK Rollups are an extension of Ethereum and rely on it as a settlement layer. This means all transactions executed by ZK Rollups are finalized on Ethereum by the disturbed work of nodes coming to an agreement through consensus mechanisms.
While all Rollups operate this way and rely on the base layer for security, ZK Rollups add another layer of security that Optimistic Rollups, for example, don’t. Optimistic Rollups operate under the assumption that transactions are valid, while adding the safeguard of allowing users to challenge the validity of executed transactions within a specified time period before finalization. Only then does their proof mechanism come into play with users challenging transaction results by commuting something known as a “fraud proof”.
ZK Rollups roll differently. They make use of their proof mechanism, aka “validity proofs,” from the get-go. While sending the new state diff to a Rollup contract on Ethereum, ZK Rollups also produce and send a validity proof to a different Rollup contract on Ethereum. A validity proof proves that the state diff sent to the base layer, is actually the outcome of all the required steps needed for validating and batching transactions. The contract containing the state diff will not accept the new state until it gets a thumbs up from the contract responsible for verifying the proof.
So, ZK Rollups offer faster transaction finality and better security than other Rollup solutions. State diffs are automatically accepted after a smart contract verifies validity proofs instead of users validating transactions to protect their funds. Thus, the scalability and security guarantees of validity proofs allow ZK Rollups to maintain the integrity of transactions while also enhancing efficiency.
Future implications
While Ethereum is still on a constant path to realizing its future use cases, there’s one bet we’re willing to make here and now: In the future, all Rollups on Ethereum will use validity proofs. This is not only our best bet, but it’s also what Vitalik Buterin envisions. As he said, this would require changes in infrastructure and prover optimization, but ZK Rollups are working hard to get everything up and running for the future ahead.
A future in which all Rollups on Ethereum use validity proofs is a future in which cheaper and faster transactions will usher in a whole host of innovative and, as of yet, unimaginable use cases and dApps onto the network.
Conclusion
ZK Rollups offer an effective solution to some of Ethereum’s inherent challenges, helping it follow through with its vision of enabling diverse applications on a decentralized network. They make transactions faster and cheaper while maintaining decentralization and security. By processing transactions off the mainchain and bundling them for efficient onchain validation, ZK Rollups significantly reduce fees and increase transaction throughput.
These benefits enhance user experience and open up new possibilities for innovative dApps. We encourage you to explore Starknet, and how it’s already transforming blockchain technology, paving the way for a more efficient and scalable future for Ethereum.