Zero-knowledge Ethereum Virtual Machine (zkEVM)

Gepubliceerd op 18 juni 2023 om 09:05

Polygon (Matic) indicated in 2022 that it will launch the zero-knowledge Ethereum Virtual Machine. This is a layer 2 solution that specifically focuses on improving scalability. Transaction costs would decrease and users can have their transactions processed faster.


The Ethereum Virtual Machine (EVM)?
Before we can cover the zero-knowledge Ethereum Virtual Machine, we need to find out what exactly the EVM is. The EVM is a system used by many developers to create decentralized applications for the Ethereum blockchain. Any developer or node can download the EVM onto their computer. The EVM will then download the entire blockchain and will always keep the most recent version on its computer. Developers can run their application on Ethereum network from their computer using the EVM.

It is extremely important that the EVM continuously updates its version. This is because new blocks are added to the blockchain. These blocks have a major impact on the operation of the application that needs to run on the EVM. The great thing is, is that if any events occur within the application, then this event is stored on the blockchain. Developers can thus track events to have their applications tested and further developed.

Zero-knowledge Ethereum Virtual Machine (zkEVM)?
The zkEVM is a layer 2 scaling solution that specifically focuses on improving scalability. Despite being developed by Polygon, the zkEVM is fully compatible with smart contracts. ZkEVM can interoperate with smart contracts, wallets and developer tools running on Ethereum.

Ethereum suffers from a major scalability problem. At one point, users had to pay hundreds of dollars in transaction fees. They often had to wait an hour before their transaction was processed and stored on the blockchain. zkEVM is designed to solve this problem.

Zk-proof
The zkEVM uses the zero-knowledge protocol. This is also referred to as the zk-proof. With zk-proof, multiple transactions are bundled together after which they are stored on the blockchain/mainchain. This ensures that less space is needed, so transactions can be processed faster and cheaper.

After the transactions are processed via the zk-proof, the transaction is stored on the mainchain/blockchain. In most cases, the transactions are not processed here. Instead, they are processed on the sidechain or other network. This is because this is the place where transactions can be processed faster.

Then multiple transactions are bundled into one transaction. This means that the cost is shared by all transactions bundled by the zk-proof. Suppose the transaction fee is $100, and 1000 transactions are bundled, then everyone pays only $0.10.

How does EVM work?
When a developer decides to modify the smart contract (of the application), the 'state' of the blockchain is modified. By this, we mean that the EVM retrieves the latest version of the blockchain. Changing the state is called the 'state transition'. What is a state transition?

The bytecode of the smart contract is loaded from the EVM and is then executed by the nodes in the EVM. All nodes receive the same data and the result should also be the same at each node. If the result is different, then the nodes cannot execute the transaction.

A lot of communication takes place between the blockchain and the EVM. These 'EVM Opcodes' communicate with the different parts of the EVM and extract data from the blockchain, then process it in the EVM's memory.

The data that was moved to the EVM is now executed, after which the transition is complete. This remains entirely the same until another transaction is executed.

How does zkEVM work?

zkEVM works in principle in the same way as the EVM. With the zkEVM, a few extra operations take place to ensure that the data is better controlled:

  • It checks if the communication between the different components is correct. If data is sent, this data must be exactly the same on arrival. With zkEVM, an extra check is made on this.
  • Checks ensure that everything is done correctly and that data from the blockchain actually matches data in the EVM.
  • The zkEVM checks whether the bytecode being loaded is the correct code and comes from the correct address.

ZkEVM deepdive

Execution environment
An application is basically a smart contract. In this environment, the smart contract of the zkEVM are practically executed. 

Proving circuit
In the proving circuit, the zero-knowledge proofs are developed that check the validity of the transactions from the execution environment (is the execution of the smart contract valid?) This is an extremely important part because it checks that all the data of the smart contract is actually valid and that no one is changing the data inappropriately. All data goes into the proving circuit, after which a zk-proof is generated. This generates a 'proof' that serves as proof of validity.

Verifier contract
The proofs, or outcomes of the transactions, are moved to a smart contract on Ethereum's layer 1 blockchain. The input (which is used to create the proof) and the proof itself are stored in the verifier contract. 

The merge

Ethereum is in the process of upgrading to Ethereum 2.0. The blockchain is expected to transition to Proof-of-Stake (PoS) on September 19, 2022 (the merge was succesful in 2022!) Prior to this, the Ethereum blockchain used the Proof-of-Work (PoW). 

The merge is to ensure that the Ethereum blockchain moves to a different consensus mechanism making the blockchain more scalable (PoW to the PoS). If this all works out, then it is expected that users will have to pay less transaction fees and they will have to wait less time for their transaction to be processed. (the merge was succesful in 2022!)

The big question is whether this transition will produce the intended results. That would remain to be seen as many new blockchains have been developed that are much faster than Ethereum, such as Solana (SOL), Radix (XRD) and Fantom (FTM).

Would a successful upgrade of Ethereum 2.0 mean the end of scaling solutions like zkEVM? Probably not. Many developers now develop their applications on a scaling solution, such as Polygon and zkEVM. Also, many users choose to run their transactions on these scaling solutions. There is little chance that this will disappear. And that would only be good for Ethereum. The more often people use zkEVM, the more often Ethereum's blockchain will be used. After all, all transactions performed by layer 2 scaling solutions are stored on Ethereum's blockchain. This in turn makes the Ethereum blockchain even more popular to develop applications on. These kinds of solutions will continue to be needed as long as Ethereum suffers from scalability problems. 

Reactie plaatsen

Reacties

Er zijn geen reacties geplaatst.