One of the most promising technologies within the Ethereum ecosystem is zkEVM or Zero-Knowledge EVM, a project that seeks not only to improve the performance of the Ethereum Virtual Machine, but also to make a huge technological leap that will result, not only in greater speed of operation but also in adding improvements that will protect our privacy when we interact with the smart contracts that are executed using this new EVM.
EThis project is promoted by the developers of zkSync, a company named Matter Labs that since 2018 has sought to build a unique scalability and privacy solution of its kind. In addition, because it is a free software type solution, it can be adapted to all projects derived from Ethereum, thus promoting the development of this ecosystem looking for new horizons.
zkEVM, the power of ZKP reaches smart contracts
To understand what zkEVM is, we must know the two technologies that this project seeks to unite. First of all, the acronym zk stands for the fact that this project uses the well-known Zero Knowledge Proofs or Zero Knowledge Proofs for its funtionability. This feature allows you to add unique functions focused on offering a more private environment to the execution of smart contracts that occur on the EVM and that are stored on the blockchain.
Let us remember that in each interaction that we carry out with a smart contract (eg when we make an exchange in Uniswap), this process generates a series of data that is stored in the Ethereum blockchain (or the network that we are using).
All this information is public and pseudo-anonymous, and can be verified and tracked at all times. Pseudo-anonymity in any case protects our privacy quite effectively, but it always leaves traces that others can use to track our activity and identify us in real life. With ZKP it is possible, not only to avoid this weakness, but at the same time we make cryptographic operations take up less space, are equally verifiable and auditable, in addition to opening the possibility to manage computing states in a much more effective and efficient way.
Now, if we unite the ZKPs and integrate them into the EVM, we have the ability to turn networks like Etheruem and derivatives into much more secure, powerful and scalable spaces, precisely the objectives that the zkEVM seeks to achieve:
- Reduce commissions on operations, due to the reduction in the computational cost of operations.
- Maintain trustless operation of networks implementing zkEVMs.
- Improve the privacy and security of the network where the zkEVM is deployed.
- Enable new technologies that can be applied to smart contracts. For example, the possibility of improving the experience of using NFT tokens or other advanced functions for other standards.
zk, a technology that changes everything
Now, let's explain some concepts in a little more depth before continuing:
What is zk?
When we see zk in the name of zkEVM, we should think as we have already mentioned in the ZKP or Zero Knowledge Proofs.
A Zero Knowledge Protocol, or ZKP, is an advanced cryptographic protocol used to create highly secure and anonymous distributed systems. ZKP protocols allow information to be shared and verified without revealing unnecessary data, thus maintaining a very high level of security.
Basically, this cryptography mechanism seeks to create a way to show the world that there is a secret, something so secret that only the person who has the secret in his possession knows exactly what it is.
But how do you show you have a secret without revealing it? Well, for this, ZKP uses a series of mathematical data that allow other people to verify that the secret actually exists and is in the possession of whoever claims to have it, but at no time is any information about said secret or its content revealed. , nor anything that allows the information given for verification to be related to the nature of the secret itself.
Thus, ZKP allows you to reveal a secret without actually revealing it, simply by offering a mathematical proof that the secret exists and that you can trust its reality. The good thing about this type of cryptography is that it is not only secure against current attacks, but also against future ones (ex: ZKP is resistant to quantum computing), as well as being computationally more efficient in terms of execution and space used by their cryptographic proofs. For this reason, many projects are interested in this type of technology to improve the efficiency, security and scalability of blockchain networks.
zk-Rollup, the evolution of Rollups
While ZKPs are extremely powerful, if we combine this power with Rollups, things radically change for the better. Rollups are a sidechain scalability technology that has a fairly simple operation. The idea is to group a series of transactions (eg: all the operations of a block) and from them generate a single transaction that is published on the mainnet of the network to which said sidechain is attached.
Thus, a rollups works like a transaction summary of operations that is published on a mainnet, while it is linked to a set of operations on a sidechain and where it can be verified in a clear and secure way. This is not a new technology, in fact, the Lightning Network uses a very similar system, since the operations of the LN channels end up being synthesized in a single operation within Bitcoin.
Rollups are very useful, but there is a problem: the cryptography currently used in blockchain (asymmetric cryptography) generates large proofs that are computationally inefficient and with some fungibility problems (eg: in optimistic rollups, it is possible to economically manipulate operations) .
Thus, with the aim of improving this technology, zk-Rollups were born, which not only have all the advantages of Rollups and ZKP, but also solve the security problems of some Rollup implementations.
Architecture and operation of the zkEVM
Now, achieving the process that allows the zkEVM to work is quite complex, one that the developers of Matter Labs have been working on since 2018.
Understanding how EVM works
First, let's review how normal EVM works: tWe have the smart contracts that are all these programs written in Solidity that we can see in the blockchain and software repositories of the DApps projects that we know. This code can be said to be what makes Dapps work, although that is not entirely correct. The EVM does not directly execute the Solidity language, because the EVM does not directly interpret the language.
Thus, we come to the second point, the compilation of smart contracts. Each smart contract written in Solidity (or compatible) is compiled and from this a bytecode is generated, a machine code that the EVM is capable of handling. This bytecode is known as the Smart Contract Bytecode, and is the prelude to the execution of smart contracts on the network.
Of course, this bytecode is made up of a series of OP_CODE or Operation Codes, which are precise instructions that the EVM has implemented and can execute to actually make the smart contracts work. This generated OP_CODE gives the precise instructions that the EVM must execute to do its job: allow us to use the Dapps or any operation within the network. This OP_CODE can be reviewed in detail within the specification found in the Ethereum Yellow Paper.
Finally, the nodes of the network, all of them with an EVM, execute that code, verify that everything is correct and add the transactions and states to the blockchain, leaving a clear consensus of them and a verifiable proof of such operations.
Enhancing the EVM with zkEVM
The above operation is what we can see in the EVM and its derivatives, and that includes the zkEVM. The most fundamental difference between EVM and zkEVM is that the latter generates a secure execution environment shielded against external agents, even if they belong to the same network.
For example, in the EVM a node operator can see the operations being performed. You can “see” them in the sense that it is possible to trace the input and output data of these operations, including their intermediate states. This is possible because the EVM has an open runtime environment, the cryptography used in the process is only there to protect certain sections of the code (such as addresses and token handling authorization).
But in zkEVM this changes radically. In a ZKP environment, we can see the input data, but this is not actually the actual data, but a series of data generated by ZKP cryptography. Thus, basically the data input is a series of data that allows the zkEVM to verify that what we say is true, but without ever revealing the real information that gave rise to that data.
This input data is accompanied by execution data and a series of token data, which the zkEVM aggregates. After grouping them, the zkEVM has everything necessary to apply the process that will allow it to know if the input data is correct, and if so, the zkEVM generates the status changes that indicate to the network that the smart contract has been executed and, In addition to that, tests are generated that indicate that such data and execution are correct.
In the end, depending on the zkEVM deployment (eg: it is native – L1, or it is inside a sidechain – L2), this data can be sent to the network nodes so that additional verification steps are executed, thus ending with the process.
Facilitating development
Now why bother to complicate the design of the EVM? Well, first of all, the zkEVM not only allows the execution of smart contracts to be more private, but also gives us the possibility of using the computational resources of the nodes more effectively.
zkEVM has been specially designed to be a sidechain solution, more specifically on zkSync and its famous zk-Rollups. This has three goals:
- Being sidechain, certain consensus processes can be relaxed to boost scalability. However, the sidechain connection is direct to L1, each transaction in the zkEVM generates unique and verifiable proofs that are recorded not only in the sidechain but also in L1 as a rollup. This seeks to maintain a high level of security while increasing scalability, not only with sidechains, but also in sharding.
- The programming language with zkEVM can evolve. While Solidity can be used by convention and compatibility, zkEVM can use other LLVM-compatible languages, and that includes languages like C/C++, Zinc (a development language and framework inspired by and built on top of Rust). This means that zkEVM can run more computationally efficiently by using node resources more directly, even with the ability to achieve parallelism.
3. It facilitates the development of ZKP applications, since the Zinc framework helps to safely generate ZKP applications for this VM.
Other projects on the horizon
Matter Labs' zkEVM is the project that started all this ZKP development on top of EVM, but other projects have already joined this initiative. For example, Polygon (MATIC) has also announced its own zkEVM solution, which is also known as Polygon Hermez, a project that was presented in March 2021. Of course, Polygon zkEVM works completely differently than Matter Labs' zkEVM.
Likewise, we have projects like Scroll or StarkNet, two projects focused on offering unique and powerful zk-Rollups solutions that seek to become first-rate scalability solutions for Ethereum and other compatible networks.
These are currently the largest and most developed projects, but surely we will see other projects of this nature come out and be presented to the world. In the end, the development of the blockchain seems unstoppable and projects like zkEVM demonstrate this very clearly.