Vitalik just lately had a really informative discuss zkEVMs, their differing types, and their relationship with Ethereum as a complete but I haven’t seen anybody right here discuss it (hyperlink me to a publish if I’m unsuitable, I’d admire a great learn)
This could be simply me, however I really feel like not many right here nonetheless totally perceive zkEVM and their completely different sort so let’s speak a bit about it, particularly from Vitalik’s perspective
To begin with, let’s deal with the various kinds of zkEVMs with their professionals and cons:
– Sort 1 (totally Ethereum-equivalent):
Sort 1 ZK-EVMs try to be totally and uncompromisingly Ethereum-equivalent.
Devs don’t must double-check the code after they migrate contracts. They’ll actually simply copy paste
Firstly, this creates a form of laziness for devs as a result of no matter whether or not there’s 100% equivalence or not, a great dev ought to at all times double-check their work
The second and extra necessary drawback is that this can be very sluggish in comparison with different varieties of zkEVMs. “Ethereum was not initially designed round ZK-friendliness, so there are lots of elements of the Ethereum protocol that take a considerable amount of computation to ZK-prove. Sort 1 goals to copy Ethereum precisely, and so it has no means of mitigating these inefficiencies” Vitalik concluded.
– Sort 2 (totally EVM-equivalent):
“Sort 2 ZK-EVMs try to be precisely EVM-equivalent, however not fairly “Ethereum-equivalent” Vitalik mentioned. This principally signifies that from a developer’s perspective, a Sort 2 zkEVM appears and acts precisely like Ethereum however with underlying minuet adjustments. These adjustments are there to make the event course of a lot simpler and very sooner than what Sort 1 zkEVM would provide.
That is the principle distinction. It principally there to resolve the principle difficulty of Ethereum being sluggish and inefficient however not altering the Ethereum code (a minimum of not fully)
Some folks would argue in opposition to this as they assume that solely equivalence is the correct approach to migrate good contracts however as of now, the Ethereum roadmap is targeted on these sort 2 zkEVMs as a result of they arrive very near complete equivalence (but not utterly 100%)
One of many main names to say who’s creating this kind 2 zkEVM proper is Polygon.
What I like about their zkEVM is that in contrast to others it’s at Bytecode-level. To shorten this and never get too technical, a Bytecode-level zkEVM goals to interpret EVM Bytecode. Polygon Hermez is at the moment bytecode equal. They run mentioned bytecode a customized zkASM of their very own. This allows direct compatibility with already current dApps. These dApps ought to be capable of run with none form of drawback since they’re utterly bytecode equal (not Ethereum equal although). This may be further work for the nodes to place in to validate and write the block that is not equal nevertheless it actually shouldn’t be an issue.
Scroll and Consensys are additionally engaged on Bytecode equal zkEVMs nonetheless they’re nonetheless a piece in progress (so is Hermez nevertheless it’s virtually executed 60% by way of).
The sort of zkEVM is way sooner than the primary sort we talked about. It’s greater than 99% equal to Ethereum so its secure to say that they’re virtually (however not fully) the identical which might make issues a lot simpler for devs to work with in comparison with the following sorts that I’ll discuss in a bit
Bear in mind how I mentioned that this kind is greater than 99% appropriate with Ethereum? Properly, that further 1% is modifications which might be there to enhance prover time.
The principle disadvantage nonetheless is that whereas these modifications do certainly enhance mentioned prover time, additionally they don’t remedy each drawback. The slowness from having to show the EVM as-is, with all the inefficiencies and ZK-unfriendliness inherent to the EVM, nonetheless stays.
– Sort 3 (virtually EVM-equivalent):
This kind is similar to the beforehand talked about sort 2 nonetheless it sacrifices much more equivalence in an effort to enhance prover instances much more
Quicker than the beforehand talked about
A Sort 3 ZK-EVM goals to be appropriate with ***most*** functions. They require very minimal rewriting for the remainder. Nevertheless, there’ll at all times be functions that should be utterly rewritten.
– Sort 4 (high-level-language equal)
The sort of EVM is arguably the most well-liked proper now with
What it principally means is that it takes a high-level coding language (like Vyper or Solidity) and principally transpile it all the way down to SNARK-friendly VM.
An in depth analogy could be discovering languages of comparable roots (Spanish and Portuguese) and translating one to a different.
A few of the main names that use one of these EVM are Zksync, Matterlabs, and Starkware.
Whereas these scaling options nonetheless use a sort 4 system, this doesn’t cease them from implementing EVM Bytecode sooner or later.
Extraordinarily quick prover instances.
“There’s quite a lot of overhead that you would be able to keep away from by not ZK-proving all of the completely different elements of every EVM execution step, and ranging from the higher-level code instantly” as Vitalik famous about one of these EVM” as Vitalik commented
The sort of EVM can’t compile down all kinds of functions. Which means that builders should rewrite A LOT of good contracts and code them again from scratch.
And that may be all! I actually assume that the Ethereum group ought to be as educated as attainable about this subject as a result of as I discussed in my earlier posts on this sub, the Ethereum blockchain itself won’t ever be low-cost and won’t scale by itself. The way forward for Ethereum is in L2s and rollups and extra particularly zero-knowledge rollups.