Ethereum: Understanding ZKSync “system agreements” and evm PreCompiles
In the introduction and implementation of intelligent contracts in the Ethereum network, developers need to choose between two popular approaches: ZK-Syted (ZS) system contracts and EVM-pre-compilation. In this article, we deepen the differences between the two approaches and explore when both are suitable.
What are the ZKSync system contracts?
The ZKSynched Systems are a new standard for the introduction of the Ethereum Smart, which was introduced in June 2021. They aim to improve the performance and safety of Z -sync deployment by implementing a more efficient and solid way to complete the code in Blockchain.
This is how it works:
- ZS contracts use EVM (Ethereum virtual machine) under the hood, as do other Ethereum contracts.
However, the ZS contracts have an additional layer of abstraction. They are essentially pre -composed configurations containing all the necessary codes that are performed in the block chain.
- When the developer wants to introduce a contract for ZK-Syntched, they can use a tool such as ZKSync or hardhat to create a ZS contract configuration from their code.
What are the EVM preliminary compilations?
EVM PreComiles, also known as “system contracts”, are similar to ZK-Sync system contracts, but instead operate on EVM. They allow developers to assemble and introduce Ethereum smart contracts directly into the block chain without a separate assembly process.
This is how it works:
- When the developer wants to enable the contract, they can use a web3.js or truffel -like tool to create an EVM pre -complian from their code.
- The preComile is then stored in a decentralized storage solution, such as an inter -planetary file system (IPFS).
- To complete the contract in the block chain, the developer must link the ZS contract configuration with a tool such as ZKSync or hardhat.
Main Differences:
Here are the most important differences between ZK-System agreements and EVM-SEWs:
And and the ZK-Sync system contracts EVM PreCompiles (System Contracts)
And — | — | — |
And
performance | Requires a separate assembly process Works on EVM
And
Code abstraction | Additional layer of abstraction built on agreement From EVM under the bonnet
And
Recording Requirements | Requires separate storage solutions (eg ZS contracts) | No need for separate storage solutions
When to choose ZK -Synthem contracts?
ZK-Sync contracts are a good choice when:
- You want more control in the performance environment and the abstraction of the code.
- Your agreement requires additional features or optimization that cannot be achieved with EVM pre -compensation.
When to choose EVM pre -compensation (system contracts)?
EVM PreCompiles (system contracts) are a good choice when:
- You need to install the contract directly in the block chain without a separate assembly process.
- Your contract is small and requires minimal optimization.
In summary, although both ZK synchronized system contracts and EVM preferences can be used to implement the Ethereum Smart, they have clear differences in the performance, code abstract and storage requirements. By understanding these differences, developers can choose an approach that best meets their needs and goals.
Leave a Reply