|
| 1 | +--- |
| 2 | +title: ZKsync Era Protocol |
| 3 | +description: Learn about ZKsync Era and the differences from Ethereum |
| 4 | +--- |
| 5 | + |
| 6 | +ZKsync Era is a Layer 2 scaling solution designed to enhance Ethereum's scalability without compromises. |
| 7 | +This document provides an overview of ZKsync Era's rollup mechanism, explaining the main idea and how it contributes to a more scalable, |
| 8 | +secure, and user-friendly blockchain ecosystem. |
| 9 | + |
| 10 | +## What is a Rollup? |
| 11 | + |
| 12 | +A rollup is a blockchain scalability solution that processes and stores transaction data off-chain |
| 13 | +while ensuring the data's integrity and availability on the main chain. |
| 14 | +By doing so, rollups significantly increase transaction throughput without compromising security. |
| 15 | +There are primarily two types of rollups: Optimistic Rollups and Zero-Knowledge (zk) Rollups. |
| 16 | +ZKsync Era utilizes the latter, leveraging cryptographic proofs for security and efficiency. |
| 17 | + |
| 18 | +## How and why it works? |
| 19 | + |
| 20 | +Ethereum's decentralized network has limited transaction throughput because its capacity doesn't scale with the number of validators. |
| 21 | +In essence, each validator performs the same job of validating each processed transaction, creating a bottleneck. |
| 22 | +In contrast, in Web2 scalability improves with the addition of more servers, |
| 23 | +as the network's capacity to handle requests increases linearly with each new server. |
| 24 | + |
| 25 | +The concept of a rollup addresses the blockchain scalability issue by moving computation off-chain |
| 26 | +and only sending the result of these computations back to Ethereum. |
| 27 | +ZK rollups, in particular, submit a validity proof alongside the execution result, |
| 28 | +making the validation of a zk proof significantly cheaper than re-executing each transaction. |
| 29 | + |
| 30 | +### The Data Availability (DA) Problem |
| 31 | + |
| 32 | +A crucial aspect of ensuring the integrity and security of rollups is addressing the Data Availability (DA) problem. |
| 33 | +If the state of the rollup is unknown to observers of Ethereum, |
| 34 | +then in scenarios where the validators (centralized or decentralized) stop processing, |
| 35 | +it becomes impossible to make state transitions without relying on a trusted validator. |
| 36 | +However, if the data is always available to observers, it's feasible to restore the state and continue processing the network |
| 37 | +even if the trusted validator ceases its operation. |
| 38 | +This link provides further details on the Data Availability problem: [Ethereum Data Availability](https://ethereum.org/en/developers/docs/data-availability/). |
| 39 | + |
| 40 | +### ZK proof |
| 41 | + |
| 42 | +Zero-Knowledge Proofs (ZKPs) offer a method to execute verifiable programs, wherein it's cheap to verify a zk proof on-chain. |
| 43 | +In the context of ZKsync, ZKPs allow for the confirmation of the correctness of transaction execution without re-executing them. |
| 44 | + |
| 45 | +ZK circuits are out of the contest's scope. |
| 46 | +However, there is an ongoing [live bug bounty program on Immunefi](https://immunefi.com/bounty/zksyncera/) |
| 47 | +open to anyone interested in identifying vulnerabilities within this domain. |
| 48 | + |
| 49 | +## ZKsync Era components |
| 50 | + |
| 51 | +ZKsync Era protocol consists of the following critical components: |
| 52 | + |
| 53 | +- **Node Implementation**: This component is responsible for receiving transactions from users and processing them. |
| 54 | + It maintains the off-chain state and handles the aggregation of transactions into batches as well as sends sealed batches onchain. |
| 55 | +- **ZK Circuits**: These circuits are intricate mathematical constructs that represent verifiable computation logic. |
| 56 | + They are responsible for determining what can be verified as a valid proof. |
| 57 | + Specifically for ZKsync, these circuits define the computation rules for EraVM execution, thats also defines how transactions are executed. |
| 58 | +- **Prover**: The prover constructs the cryptographic proofs that attest to the correctness of the transactions processed off-chain. |
| 59 | + These proofs can be verified later on Ethereum, ensuring that only valid transactions are accepted. |
| 60 | +- **Smart Contracts**: These contracts are the on-chain component of the zkRollup. |
| 61 | + They are responsible for verifying the proofs submitted by the prover and updating the Ethereum blockchain's state accordingly. |
| 62 | + Additionally, they facilitate interactions between Ethereum and ZKsync, such as deposits, withdrawals, and cross-layer messaging. |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | +While this contest primarily focuses on the smart contracts side of ZKsync Era, |
| 67 | +understanding the interaction between different components can be beneficial. |
| 68 | +For additional context or insights, consider exploring these resources: |
| 69 | + |
| 70 | +- **Node Implementation**: https://github.com/matter-labs/zksync-era |
| 71 | +- **ZK Circuits**: https://github.com/matter-labs/era-zkevm_circuits |
| 72 | + |
| 73 | +## The ZK Chain |
| 74 | + |
| 75 | +The ZK Chain is the continuation of Ethereum's rollup centric roadmap. |
| 76 | +Ethereum provides security via DA and verification of proofs, but the question of execution is left to the rollups. |
| 77 | +In order to have the best UX, it is necessary to solve interoperability and the free flow of assets between chains. |
| 78 | +We do this via the Shared Bridge Contract on L1 which stores Ether and ERC20 tokens for all ZK Chains (implementing custom bridges is still possible). |
| 79 | +This upgrade will allow hyperbridging between ZK Chains in the next major upgrade. |
| 80 | +The chains will be able to trust each other due to the fact that they are managed by the same STM contract, using the same VM and proof system. |
| 81 | +In the future more upgrades will follow, as this is still a topic under heavy research. |
| 82 | + |
| 83 | +- For more details watch this video on [How the ZK Stack will power the Internet of Value](https://www.youtube.com/watch?v=BxpKa-S2m34). |
0 commit comments