ZKsync Chains
ZKsync chains represent a sophisticated layer of blockchain architecture called a rollup cluster, consisting of parallel-running chains that achieve consensus and finality on Ethereum's Layer 1 (L1) through a shared bridge.
ZKsync chains are fully interoperable within the Elastic Network, facilitating seamless interactions across chains.
ZKsync chains operate with a shared bridge contract on Ethereum's L1 and include native bridges between individual rollups, enhancing the overall interoperability and efficiency of the network. Key features of ZKsync chains include:
- Trustless Validating Bridges: Ensures that rollups within the ZKsync protocol are interconnected without requiring additional trust layers.
- Asset Transfers: Interoperability simplifies the transfer of assets, including burning and minting mechanisms, across the ecosystem.
- Unified Governance: Leveraging a shared governance framework on L1, the ecosystem can coordinate updates or respond collectively to vulnerabilities, much like a traditional blockchain network would handle a fork.
- Security and Trust: All ZKsync chains must utilize the standardized ZK-engine to maintain consistent security and operational standards, ensuring that trust and security are derived directly from L1.
Development and Deployment
ZKsync chains can be developed and deployed by anyone, fostering a diverse and open ecosystem. However, for a ZKsync chain to remain trusted and fully interoperable within the Elastic Network, it must utilize the ZKsync Stack. This requirement ensures consistency in execution and security across different instances of ZKsync chains.
Modular Implementation
ZKsync chains are designed to be modular, meaning developers can select different components of their blockchain systems or implement their own, with the exception of the zkEVM core. This modular approach allows for customization and flexibility in blockchain development while maintaining core standards necessary for network security and interoperability.
How Interop Works
Interop, or interoperability, is a way to communicate and transact between two ZKsync Stack chains. It is made possible by smart contracts that verify transactions across chains using Merkle proofs.
It allows you to:
- Observe messages: Track when an interop message (think of it as a special event) is created on the source chain.
- Send assets: Transfer ERC20 tokens and other assets between chains.
- Execute calls: Call a contract on a remote chain with specific calldata and value.
With interop, you automatically get an account (a.k.a.
aliasedAccount
) on each chain, which you can control from the source chain. - Execute bundles of calls: Group multiple remote calls into a single bundle, ensuring all of them execute at once.
- Execute transactions: Create transactions on the source chain, which will automatically get executed on the destination chain, with options to choose from various cross-chain Paymaster solutions to handle gas fees.
You can learn more about how interoperability works and how to use it in the ZKsync Connect documentation.
Proof Aggregation
Proof aggregation is a critical component in scaling blockchain technologies, allowing for the efficient verification of transactions across multiple chains.
For ZKsync chains, proof aggregation is done via the Gateway.
Gateway
Gateway is a hub for ZKsync chains proof aggregation. It is part of the critical infrastructure enabling interop between ZKsync chains.
Gateway enables ZKsync chains to have:
- Fast interop: Interchain communication requires quick proof generation and verification. The latter can be very expensive on L1. Gateway provides an L1-like interface for chains, while giving a stable price for compute.
- Cheaper Fees: Proof aggregation can reduce costs for users, if there are multiple chains settling on top of the same layer. It can reduce the costs of running a Validium even further.
Once planned upgrades for Gateway are complete, only a lightweight consensus mechanism will be needed, reducing the computational overhead.
Chain Customizations
The ZKsync Stack offers several customization options for developers looking to tailor a ZKsync chain to specific needs or create entirely new blockchain architectures. This modular approach allows for significant flexibility in configuring transaction sequencing, data availability policies, and privacy features.
Sequencing transactions
- Centralized sequencer - Utilizes a single operator to quickly confirm transactions, ideal for high-frequency trading (HFT) but requires trust in the operator’s reliability and integrity.
- Decentralized sequencer - Employs a consensus algorithm to determine transaction inclusion, enhancing security and decentralization but potentially at the cost of higher latency. It can be any algorithm, so developers can reuse existing implementations (e.g. Tendermint or HotStuff with permissionless dPoS).
- Priority queue - Allows transactions to be submitted directly via an L2 or L1 priority queue, enhancing censorship resistance, particularly useful for governance protocols. It’s worth noting that the priority queue will always be available as an escape-hatch mechanism (even if a centralized or decentralized sequencer is employed), to protect users against censorship by a malicious sequencer.
- External protocol - Offers freedom to integrate any external sequencing protocols, providing further flexibility and potential integration with existing systems. External protocols such as Shared Sequencers and Shared Builders can be used.
Custom Base Tokens
The ZKsync Stack supports using ERC20 tokens as the base token for chain fees instead of ETH. This enables ZKsync chains to use tokens like USDC or custom community tokens as the base currency for transactions.
Data Availability (DA)
Data Availability (DA) is a critical component in ensuring the security and functionality of ZKsync chain. It governs how transaction data is managed and made accessible, impacting everything from user privacy to transaction speed and cost. Below, we detail the various DA options available to developers using the ZKsync Stack, each tailored for specific security, privacy, and scalability needs.
zk-Rollup
zk-Rollup is the recommended DA policy for most ZKsync chain. It ensures that the values of every changed storage slot are published as calldata (or blobs, depending on what's cheaper) on Ethereum's Layer 1 (L1). This approach benefits from:
- Amortization of Costs: Changes that net to zero are not posted, reducing unnecessary data and saving costs.
- Inherited Security: Adopts the full security and censorship-resistance properties of Ethereum, providing robust protection against potential attacks.
Validium
A validium offers a more flexible architecture ideal for enterprise applications that require both auditability and confidentiality. Its key characteristics are:
- Controlled DA: The hosting organization controls data availability. Although the funds held in validiums are secure against theft, they can be frozen if the data becomes unavailable. This scenario would not only lock users out of their assets but also potentially damage the reputation and operational status of the hosting organization.
- User-Level Privacy: ZKsync Prividium enables user-level privacy while giving the chain operator full visibility. Because the host organization controls data availability, it has the power to restrict access.
- Lower Cost: Validiums offer flexibility for operators to save costs when they don't require a high level of security (e.g. a gaming chain).
zkRollup (Self-hosted)
zkRollup (Self-hosted) represents an innovative approach where users manage their own data:
- User-hosted Data: Users store all relevant data for their accounts, significantly enhancing privacy and reducing on-chain data requirements.
- Minimal Data Footprint: Potentially reduces the data footprint to as little as 5 bytes per user interaction, drastically scaling potential.
- Complex Implementation: While offering tremendous benefits, this option requires sophisticated technical solutions to manage user interactions smoothly and securely.
Privacy
ZKsync chains support various methods to enhance privacy:
- Validium Mode: Naturally provides privacy as long as the data is kept confidential by the operator.
- Privacy Protocols: Specialized L3 protocols like Aztec or Tornado can be integrated to provide user-level privacy while benefiting from ZKsync Era’s features like account abstraction.
- Self-hosted Rollups: Represent a long-term solution for privacy and scalability, where users manage their data and confirm state transitions off-chain.