Discover more from Superfluid
zkEVMs: Unlocking the next frontier
zk-rollups have tremendous potential to scale Ethereum for the masses, but this isn't possible without zkEVMs...
Welcome to all the new subscribers over the last month! You can read my last article on NFTs x DeFi here.
Stay up to date with Superfluid by subscribing here:
The Merge. Everyone’s talking about it. It’s meant to unlock the next frontier for the Ethereum network and it’s finally meant to happen sometime in September.
A lot of people think the shift from Proof-of-Work will increase the scalability of ETH’s network and make it cheaper to use. Unfortunately, at this stage that’s all fake news.
However, the Merge does lay strong groundwork for better scalability in the future. Moving to a Proof-of-Stake consensus mechanism is a requisite for future upgrades such as sharding which will allow ETH as an L1 to increase its transaction throughput. In the interim, we’ve got optimistic and zero-knowledge rollups which I’ve discussed before here.
In that article, I broke down the differences in the mechanics of each rollup. In essence, zk-rollups are far superior in the long term due to their fast transaction confirmation times. However, they are currently quite tricky for dApp developers to integrate as there is some difficulty for zk-rollups to be EVM-compatible.
Why? Let’s break this down, and explore some new developments that have happened over the last couple of weeks and what it means for broader crypto adoption.
A quick run-down on EVMs
To strip it back, Virtual Machines are often used to simulate different operating systems to provide an isolated environment for testing or development. They can be spun up quickly and destroyed just as easily.
The Ethereum Virtual Machine (EVM) works differently from a standard VM. It allows anyone to execute EVM bytecode (i.e., a set of instructions) in a distributed manner as each Ethereum node runs an EVM instance. The bytecode is then executed by the EVM and is used to create smart contracts. Smart contracts are then deployed to the blockchain and executed by the EVM.
The EVM is stack-based meaning it sequentially executes bytecode instructions. These instructions can interact with the global state of the EVM that holds all ETH addresses and account balances. However, each transaction requires a large amount of memory and processing power which makes it difficult to run large-scale applications on Ethereum, without gas costs soaring.
Basically, any dApp that is built in an EVM-compatible manner can be ported back to the ETH network with ease. As such, Layer 1 chains such as Avalanche, Binance Smart Chain and Fantom are all EVM compatible meaning that dApps that are built on those blockchains should be able to interact with the ETH network as well.
Breaking down zkEVM architecture
High gas costs and low transaction capacity leads us towards needing rollup technology to scale the ETH network. As previously mentioned, there are two types of rollups: Optimistic and Zero-Knowledge.
Optimistic rollups use a dispute period to ensure transaction truthfulness as opposed to using complex computations like zk-rollups. As a result, they are easier to implement and were the first to come to market through Arbitrum and Optimism. Moreover, Optimistic rollups were largely EVM compatible from the get-go meaning existing EVM-compatible dApps are able to adopt Optimistic rollups easily.
For zk-rollups, EVM compatibility is harder. In the short term, zk-rollups were only practically applicable for simple transfer of tokens rather than smart contract execution. However, with the advent of zkEVM tech developed by Polygon, Matter Labs and Scroll, it seems like it might be possible to conduct more complex operations using zk-rollups.
The zkEVM is a modification to the standard EVM that allows for greater privacy and security whilst executing smart contracts. As the name suggests, zkEVMs use zero-knowledge proofs to obscure transactions and smart contracts from nodes on the network. This makes it harder for malicious actors to gain insights and exploit smart contract vulnerabilities, whilst increasing the scalability of the ETH network.
zkEVMs are unique in their architecture. Since each computation processed has three main components, the zkEVM creates individual proofs to verify each part. These include:
Bytecode Access: A check to confirm whether the correct code was run from the correct address
Computation: A check to determine whether the instruction (opcode) was processed correctly
Read-write operations: A check to confirm whether the program fetches the correct values and writes the values to the stack correctly
In addition, the zkEVM is divided into three parts:
Execution environment: Ensures that the piece of code is able to execute to completion
Proving Circuit: Verifies that the smart contract is executed in the zkEVM
Verifier Contract: Verifies the correctness of computations executed in the zkEVM
It’s quite clear that the architecture of a zkEVM is designed to ensure that each step of the execution process is verified and checked to ensure correctness. This will hopefully result in a robust transaction layer that is able to exponentially improve upon existing Optimistic Layer 2 solutions.
So……. wen zk?
zkEVMs are clearly valuable given their ability to ensure that each transaction is legitimate beyond doubt with a high level of scalability. For example, Polygon Hermez, which is Polygon’s implementation of the zkEVM is able to process over 2,000 transactions in a single batch through its Hermez API. This is then sent through to the Ethereum blockchain as 1 transaction.
In total, each block on ETH can take up to 15 of these rollups, meaning that the total capacity of each block is roughly 30,000 transactions. At the moment, this is at 70 transactions per block or 30 transactions per second. At this capacity, zk-rollups will allow ETH to process more transactions per second compared to Visa which does 1,700 transactions per second.
However, Optimistic rollups are here and available now. Whilst adoption for optimistic rollups hasn’t been amazing, it’s also not insignificant with over USD$1.4bn in total value locked (i.e. staked). Moreover, adoption of technology is not always driven by what execution is superior, but also by network effects and community drive. Interestingly, Vitalik states that he “personally would much rather trust $10 million of my own money to an EVM Optimistic rollup than to an EVM ZK rollup for at least the next couple of years.” However advises that “in the long term ZK rollups are, I think, going to be everything. And so, my advice to teams like Optimism and Arbitrum is that I think they should start zk-ifying themselves fairly soon”
Alternatively, dApps could potentially move across to their own chains on Cosmos, following in the footsteps of dYdX. A large part of the reasoning behind this move is to be able to control the mechanics of the chain. For example, dYdx’s network has no trading gas fees and is able to completely host its orderbook on-chain which requires a minimum of 1,000 TPS. For some dApps that have such a high TPS requirement, building on top of their own chain makes sense, however, if it is not properly secured, can make the protocol vulnerable to exploits. Moreover, there are no network effects gained from building on their own chain.
Ultimately, whilst zk-rollups will help unlock enormous potential and utility for the Ethereum network, it remains to be seen whether this will be fully utilised by worthwhile dApps. Personally, I hope that it will allow developers to test and iterate on ideas quicker as they are not completely bound by slow transaction speeds and the inability to release useable products into the market.
What do you think zkEVMs will enable in the future? Let me know on Twitter!
Make sure to subscribe now to not miss the next article.
Thanks for reading and see you next time!