Bài học 2

ZKSync Architecture

This module is about the architecture of zkSync, focusing on zkRollup technology, data availability and security, and the key components of the zkSync system. The content will provide an in-depth understanding of how zkSync operates at a technical level.

ZK Rollup Technology

As explained in the previous module, zkRollup is the technology behind zkSync. This Layer 2 scalability solution was designed to enhance Ethereum’s transaction throughput and reduce costs without compromising security.

ZkRollup works by aggregating multiple transactions off-chain into a single batch. This batch is then processed off-chain, and a cryptographic proof known as a zkSNARK (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) is generated to verify the correctness of the transactions. This proof is submitted to the Ethereum mainnet for verification, ensuring that the transactions are secure and valid without processing each one individually on-chain.

Comparison with Optimistic Rollups

Optimistic Rollups assume transactions are valid by default and only run computations to detect fraud if a challenge is raised by any party involved. While they reduce gas costs, they require a dispute period, which can delay finality and resolutions.

ZKRollups provides immediate finality and enhances security, as it eliminates the need for a dispute period. Generally, they are considered more secure and efficient but are also more complex to implement in terms of architecture.

The primary advantage of zkRollup technology is its ability to increase transaction throughput while maintaining the high security standards for side chains and the main chain.

On-Chain Data Availability and Security Measures

Data availability matters a lot, especially when it comes to ensuring the integrity and security of rollup systems like zkSync. In zkSync, the concept of state diffs is used to optimize data submission to Ethereum. Instead of posting detailed transaction data, zkSync submits state diffs, which represent changes in the blockchain’s state. This approach reduces the amount of data that needs to be submitted to the mainnet, thereby lowering gas costs.

zkSync has a technical architecture designed to enhance scalability and security for Ethereum transactions. This architecture has a number of components that work together to achieve high throughput and low transaction costs while maintaining the security of the Ethereum mainnet.

Elements of ZKSync Architecture


Source: @luozhu/BJWtCYpFi"">https://hackmd.io/@luozhu/BJWtCYpFi

Node Implementation

The zkSync node is responsible for receiving and processing transactions from users. It maintains the off-chain state and aggregates transactions into batches, that are then sealed and submitted on-chain. The node ensures that the transaction data is correctly processed and stored, facilitating the efficient operation of the zkRollup system.

ZK Circuits

Zero-Knowledge (ZK) circuits are mathematical constructs that represent the computation logic needed for verifiable proofs. In zkSync, these circuits define the rules for transaction execution within the EraVM (zkSync’s virtual machine). The circuits are designed to ensure that every transaction processed off-chain can be verified on-chain, thus maintaining the integrity and security of the system.

Prover

The prover is an important component that constructs cryptographic proofs (zk-SNARKs) for the transactions processed off-chain, to attest to the correctness of the transaction execution as they are submitted to the Ethereum mainnet for verification. The prover’s role helps ensuring that only valid transactions are included in the zkRollup, thus preventing fraud and ensuring data integrity.

EraVM

zkSync uses a specialized virtual machine called EraVM, which operates on a register-based architecture rather than the stack-based architecture of the Ethereum Virtual Machine (EVM). EraVM is optimized for generating zero-knowledge proofs, simplifying the process of verifying complex computations on-chain. This virtual machine is central to zkSync’s ability to efficiently process and verify transactions.

Proof Aggregation

zkSync utilizes proof aggregation techniques to enhance scalability. Simple proof aggregation involves verifying independent proofs collectively on Ethereum L1, reducing the frequency of settlements to conserve gas fees. Layered proof aggregation allows ZK chains to act as Layer 3 networks that settle their proofs onto an intermediary Layer 2 ZK chain, enabling faster inter-chain communication and atomic transactions. This modular approach ensures scalability and efficient verification across the network.

Sovereignty and Modularity

The architecture of zkSync is designed to be sovereign and modular, allowing developers to customize their ZK chains according to specific needs. This includes configuring transaction sequencing, data availability policies, and consensus mechanisms. The modular design ensures that developers have full control over their chains, enabling tailored solutions for various use cases while ensuring compatibility within the Ethereum ecosystem.

This comprehensive architecture enables zkSync to provide scalable, cost-effective, and secure solutions for a wide range of blockchain applications, from DeFi and NFT marketplaces to enterprise solutions and cross-chain interoperability.

Highlights

  • Detailed explanation of zkRollup technology and its benefits.
  • Comparison of zkRollup with other rollup technologies.
  • Explanation of data availability and security measures in zkSync.
  • Description of key components of zkSync architecture and their interactions.
Tuyên bố từ chối trách nhiệm
* Đầu tư tiền điện tử liên quan đến rủi ro đáng kể. Hãy tiến hành một cách thận trọng. Khóa học không nhằm mục đích tư vấn đầu tư.
* Khóa học được tạo bởi tác giả đã tham gia Gate Learn. Mọi ý kiến chia sẻ của tác giả không đại diện cho Gate Learn.
Danh mục
Bài học 2

ZKSync Architecture

This module is about the architecture of zkSync, focusing on zkRollup technology, data availability and security, and the key components of the zkSync system. The content will provide an in-depth understanding of how zkSync operates at a technical level.

ZK Rollup Technology

As explained in the previous module, zkRollup is the technology behind zkSync. This Layer 2 scalability solution was designed to enhance Ethereum’s transaction throughput and reduce costs without compromising security.

ZkRollup works by aggregating multiple transactions off-chain into a single batch. This batch is then processed off-chain, and a cryptographic proof known as a zkSNARK (Zero-Knowledge Succinct Non-Interactive Argument of Knowledge) is generated to verify the correctness of the transactions. This proof is submitted to the Ethereum mainnet for verification, ensuring that the transactions are secure and valid without processing each one individually on-chain.

Comparison with Optimistic Rollups

Optimistic Rollups assume transactions are valid by default and only run computations to detect fraud if a challenge is raised by any party involved. While they reduce gas costs, they require a dispute period, which can delay finality and resolutions.

ZKRollups provides immediate finality and enhances security, as it eliminates the need for a dispute period. Generally, they are considered more secure and efficient but are also more complex to implement in terms of architecture.

The primary advantage of zkRollup technology is its ability to increase transaction throughput while maintaining the high security standards for side chains and the main chain.

On-Chain Data Availability and Security Measures

Data availability matters a lot, especially when it comes to ensuring the integrity and security of rollup systems like zkSync. In zkSync, the concept of state diffs is used to optimize data submission to Ethereum. Instead of posting detailed transaction data, zkSync submits state diffs, which represent changes in the blockchain’s state. This approach reduces the amount of data that needs to be submitted to the mainnet, thereby lowering gas costs.

zkSync has a technical architecture designed to enhance scalability and security for Ethereum transactions. This architecture has a number of components that work together to achieve high throughput and low transaction costs while maintaining the security of the Ethereum mainnet.

Elements of ZKSync Architecture


Source: @luozhu/BJWtCYpFi"">https://hackmd.io/@luozhu/BJWtCYpFi

Node Implementation

The zkSync node is responsible for receiving and processing transactions from users. It maintains the off-chain state and aggregates transactions into batches, that are then sealed and submitted on-chain. The node ensures that the transaction data is correctly processed and stored, facilitating the efficient operation of the zkRollup system.

ZK Circuits

Zero-Knowledge (ZK) circuits are mathematical constructs that represent the computation logic needed for verifiable proofs. In zkSync, these circuits define the rules for transaction execution within the EraVM (zkSync’s virtual machine). The circuits are designed to ensure that every transaction processed off-chain can be verified on-chain, thus maintaining the integrity and security of the system.

Prover

The prover is an important component that constructs cryptographic proofs (zk-SNARKs) for the transactions processed off-chain, to attest to the correctness of the transaction execution as they are submitted to the Ethereum mainnet for verification. The prover’s role helps ensuring that only valid transactions are included in the zkRollup, thus preventing fraud and ensuring data integrity.

EraVM

zkSync uses a specialized virtual machine called EraVM, which operates on a register-based architecture rather than the stack-based architecture of the Ethereum Virtual Machine (EVM). EraVM is optimized for generating zero-knowledge proofs, simplifying the process of verifying complex computations on-chain. This virtual machine is central to zkSync’s ability to efficiently process and verify transactions.

Proof Aggregation

zkSync utilizes proof aggregation techniques to enhance scalability. Simple proof aggregation involves verifying independent proofs collectively on Ethereum L1, reducing the frequency of settlements to conserve gas fees. Layered proof aggregation allows ZK chains to act as Layer 3 networks that settle their proofs onto an intermediary Layer 2 ZK chain, enabling faster inter-chain communication and atomic transactions. This modular approach ensures scalability and efficient verification across the network.

Sovereignty and Modularity

The architecture of zkSync is designed to be sovereign and modular, allowing developers to customize their ZK chains according to specific needs. This includes configuring transaction sequencing, data availability policies, and consensus mechanisms. The modular design ensures that developers have full control over their chains, enabling tailored solutions for various use cases while ensuring compatibility within the Ethereum ecosystem.

This comprehensive architecture enables zkSync to provide scalable, cost-effective, and secure solutions for a wide range of blockchain applications, from DeFi and NFT marketplaces to enterprise solutions and cross-chain interoperability.

Highlights

  • Detailed explanation of zkRollup technology and its benefits.
  • Comparison of zkRollup with other rollup technologies.
  • Explanation of data availability and security measures in zkSync.
  • Description of key components of zkSync architecture and their interactions.
Tuyên bố từ chối trách nhiệm
* Đầu tư tiền điện tử liên quan đến rủi ro đáng kể. Hãy tiến hành một cách thận trọng. Khóa học không nhằm mục đích tư vấn đầu tư.
* Khóa học được tạo bởi tác giả đã tham gia Gate Learn. Mọi ý kiến chia sẻ của tác giả không đại diện cho Gate Learn.