zkEVM - what's all the hype about
We cover the hottest story that's come out of the crypto world. Polygon dropped their version of a zkRollup on Ethereum with full EVM equivalence. Let's delve deeper into why this is a big deal
a quick recap of rollups
Before we begin, it’s helpful to pull back and recap what a zk rollup is. A rollup is a scaling solution for Ethereum that dramatically increases the throughput of the Ethereum chain, at lower costs.
It achieves this, by rolling up multiple transactions into a single transaction, that is recorded on-chain. This very act of rolling up of transactions gives it scalability, since far less information is required to be recorded on chain.
Here’s an analogy to help understand rollups:
Let’s say that you are a bank and people approach you for loans. Your bank, being a pragmatic and cautious lender, provides customers with a list of documentation to prove their credit-worthiness. And your bank staff verify these documents one-by-one to process the loan.
This is status quo with Layer 1 solutions. Naturally, this process is more expensive, and slower. But you have full confidence in your verifiers that the processed applications are accurate.
Naturally, your customers are frustrated at the pace of loan processing. They want a faster experience. So you devise two methods of scaling the throughput:
Optimistic - You tell your customers that we implicitly trust you. We’ll do some basic checks quickly, and you can self-attest your application. You provisionally approve the loan, but take 7 days to verify the documents. And if you find anything wrong, then you penalize the customer (and even ban them).
This is an optimistic rollup. It’s fast, but there is an implicit trust required in the system. Solutions like Arbitrum and Optimism are L2 scaling solutions on Ethereum that employ this method.Zero Knowledge - In this method, you devise an incredible cryptographic machine, that takes in all the documents as inputs, and constructs a cryptographic proof. This proof can only be generated if all the conditions for a loan are validated by the documents. Users can now go to the machine, and generate a proof, which they can then submit to get a loan.
You love this system, because you know that only legitimate customers can generate a proof, and that’s the only thing your validators need to process the loan.
Similarly, your customers love it as well - it increases the speed of processing (and it also provides a layer of privacy. The gory details of the users financial life is a little more protected from your bank’s validators).
so what is a zkEVM
At this point, scaling Ethereum’s throughput is a key goal to make decentralized applications cheaper and faster to use.
We’ve had optimistic rollups for a while (Arbitrum and Optimism), but the community consensus was always biased towards zk-based rollups as the main L2 scaling solution, the holy grail being a zkEVM.
A zkEVM is a effectively fully equivalent to the Ethereum Virtual Machine - which means that any contract that was built for Ethereum can be seamlessly retooled for the L2 rollup, simply by switching nodes to one on the rollup. Your contract will be executed on the L2, bundled up with other contracts, and recorded as a single transaction on the mainnet, and backed by a zk-proof.
This was big news last week as Polygon launched their new zk rollup, Hermez, during EthCC in Paris last week. Here is a link to their official announcement - https://blog.polygon.technology/the-future-is-now-for-ethereum-scaling-introducing-polygon-zkevm/.
the current landscape of zk rollups
While Polygon took a majority of the headlines with this announcement, there are a few other projects building in parallel (e.g. Scroll), there are three main names to watch for:
zkSync - zkSync is the OG when it comes to zk-based rollups. zkSync launched v1.0 in 2020, that supported rollups for payments. Since then, zkSync has verified over 10M transactions, at costs 1/100th of what it would have been on the Ethereum mainnet. Several popular applications including Gitcoin, Tally, Gnosis, Argent, execute on zkSync.
The limitation of v1 was that it was only available for payments. zkSync is working on v2.0, which is a general-purpose zkEVM that supports all contracts (beyond payments).zkSync has confirmed v2.0 launch on the mainnet in 100 days in a blog on Jul 20 - https://matterlabs.medium.com/100-days-to-mainnet-6f230893bd73
Incidentally, they announced this right after the Polygon zkEVM launch. And there was quickly some banter between them and Sandeep Naliwal. Check it out here on Twitter
@gluk64 @zksync I thought what i said was exactly zkEVM. But I wasn’t referring to zkSync in my post at all. zkSync is not even a part of zkEVM conversation yet as no code is opensource, no way to know. About the mainnet in <100 days, this is what you posted in 2021
Starknet - Starknet is the brainchild of Starkware, which is was founded by core Ethereum developers in 2017.
They use a type of zk proof called a STARK (Scalable Transparent Argument of Knowledge). We won’t get into details of this here, but Starkex (their engine to generate STARKs) has been around for 2+ years, and are being used by large projects such as dYdX, Sorare, Immutable, and DiversiFi, to generate STARKs that are recorded on-chain.
They are now working on StarkNet, their zkEVM solution, which is currently in alpha.
The one key difference is that StarkNet smart contracts are written in Cairo, while most contracts on Ethereum are written in Solidity, which does mean that the contracts do require some retooling to be migrated onto StarkNet.Polygon - Polygon Hermez, the new zkEVM, is now the hottest thing on the block. Hermez promises a zkEVM with 100% EVM equivalence, and natively supports contracts written in Solidity. Minimal retooling of contracts means that developers can easily switch over to the zkEVM by just pointing the contracts onto a new node.
Interestingly, Polygon’s zk leverages their plonky2 technology, which combines the power of recursive SNARKs and STARKs to generate an incrediby performant zk-proof generator.
Polygon has currently open-sourced their code, and will be launching their test net soon. They’ve also promised a lot more details and documentation on how to use in the coming days.
Given most smaller dapps use third-party services like Alchemy, Quicknode or Infura to manage their nodes, it’ll be interesting to see if it is indeed a button flip.
In summary, this has been a good week for Ethereum. Earlier in the week, the Goerli merge was reported successful, and a soft timeline for the mainnet merge has been set for mid-September. And with the launch (or planned launch) of multiple zkEVMs - the Holy Grail of scaling - the era of ethereum dominance is finally upon us.