1

According to the zkSync docs

While most of the primitive EVM opcodes can be supported out of the box (i.e. zero-value calls, addition/multiplication/memory/storage management, etc), some of the opcodes are not supported by the VM by default and they are implemented via “system contracts” — these contracts are located in a special kernel space, i.e. in the address space in range [0..2^16-1], and they have some special privileges, which users’ contracts don’t have. These contracts are pre-deployed at the genesis and updating their code can be done only via system upgrade, managed from L1.

This sounds similar to EVM-style precompile contracts.

The EVM also offers a set of more advanced functionalities through precompiled contracts. These are a special kind of contracts that are bundled with the EVM at fixed addresses, and can be called with a determined gas cost.

Are these essentially the same? If so, why not use the same name?

1 Answer 1

1

According to the zkSync AI Bot:

The difference between zkSync system contracts and EVM precompiles lies in their roles and how they are integrated within the zkSync architecture:

System Contracts:

System contracts in zkSync are special contracts deployed at predefined addresses and are integral to the zkSync ecosystem. They are called by the Bootloader and have special permissions compared to normal user contracts. These contracts handle specific functionalities that are essential for the operation of the zkSync network, such as the transformation of input data into a format expected by the zk-circuit, and simulating operations with Ether through contracts like L2EthToken and MsgValueSimulator. System contracts are designed to be easier to audit and maintain, shifting some responsibilities from the cryptographic layer to a more manageable smart contract layer.

EVM Precompiles:

EVM precompiles are a set of predefined, special-purpose contracts in the Ethereum network that provide efficient implementations of computationally intensive operations. In zkSync, these include operations like cryptographic hash functions (e.g., keccak256, sha256) and elliptic curve operations (e.g., ecadd, ecmul). Unlike system contracts, precompiles do not have special permissions and are called by users rather than the system. The behavior and gas costs of these precompiles when invoked via delegatecall may differ from those on Ethereum, reflecting their optimized integration within the zkSync environment.

In summary, while both system contracts and precompiles serve critical roles in enhancing the functionality and efficiency of the network, system contracts are more deeply integrated into the core operations of zkSync, possessing special permissions and responsibilities, whereas precompiles provide essential computational services accessible by users.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.