Mundus Security Technical Blog
Web3 New Tech Overviews

What is zkSync and How Does it Work?

What is Zksync
In the ever-evolving world of blockchain technology, scalability has always been a challenge. Ethereum, one of the most popular blockchain platforms, has faced issues with slow transactions and high gas fees due to its limited throughput. However, the emergence of layer 2 solutions has provided hope for addressing these challenges. One such solution is zkSync, a layer 2 blockchain protocol that aims to eliminate Ethereum's congestion and unlock its full potential. In this article, we will explore what zkSync is, how it works, its advantages over other layer 2 solutions, its ecosystem, and more.

Check out our website and please join our community!

Twitter

Telegram

Website

Looking for audit, let's talk

What is zkSync?

zkSync is a layer 2 solution designed to address Ethereum's scalability issues. It is built on the concept of zero-knowledge rollups, a scaling technology that allows for batching multiple transactions and submitting them to the Ethereum main chain as a single proof. This approach significantly increases the throughput of the Ethereum network while maintaining the same level of security.
The primary goal of zkSync is to provide a scalable and privacy-focused engine for Ethereum, enabling faster and cheaper transactions for both Ether and ERC20 tokens. By leveraging zero-knowledge proofs, zkSync ensures that transactions are secure and verifiable without revealing the underlying data.
zkSync logo

How does zkSync work?

At its core, zkSync separates ownership from computation, similar to other layer 2 solutions. The main chain of Ethereum holds the smart contracts and assets, while the off-chain component of zkSync handles the computation and storage. This separation allows zkSync to achieve high transaction rates while maintaining the security of the Ethereum main chain.
The zkSync protocol uses zero-knowledge proofs, specifically SNARKs (Succinct Non-Interactive Arguments of Knowledge), to verify the validity of transaction batches. These proofs provide cryptographic guarantees without revealing any sensitive information. In other words, zkSync can prove that a certain transaction is true without disclosing the details of the transaction itself.
To ensure the security of the protocol, zkSync follows a two-step process. First, the zkSync operator collects transactions and generates proofs for each batch. Then, the proofs are sent to the Ethereum main chain, where they are verified by smart contracts. Once the proofs are verified, the transactions are settled on the Ethereum main chain.

Advantages of zkSync

One of the key advantages of zkSync is its low gas fees. Gas fees on the zkSync L2 blockchain can be up to 100 times lower compared to Ethereum's mainnet, making it more affordable for users to transact and interact with decentralized applications (DApps) on the platform. This cost-effectiveness opens up new possibilities for micro-transactions and enhances the overall user experience.
Another significant advantage of zkSync is its high transaction throughput. With zkSync 2.0, the protocol aims to achieve a throughput of over 100,000 transactions per second once Ethereum's sharding technology is available. This level of scalability makes zkSync one of the most functional layer 2 solutions for Ethereum, allowing for mass adoption and widespread usage.
Additionally, zkSync offers smart contract interoperability, enabling developers to reuse existing Solidity code. This compatibility makes it easier for developers to build on top of zkSync and integrate their DApps with the protocol. Furthermore, zkSync supports atomic swaps and limit orders, which are crucial features for decentralized exchanges and trading platforms.

What is the difference between zkSync Lite vs zkSync Era?

zkSync has two protocols - zkSync Lite and zkSync Era. The first protocol is also known as version 1.0, but developers prefer not to use this comparison. Instead, the positioning was changed to reflect the transition of Ethereum and its updates to a new era. The main difference between the two protocols is that zkSync Era supports all EVM-based applications and dApps, while zkSync Lite only supports some. However, transactions in zkSync Lite are processed in a mainnet-like environment, which means users must pay with real money for all transactions. This limited the number of projects in the first version of the protocol, with only a few cross-chain bridges and DEXs, as developers focused on preparing the platforms for the mainnet.
zkSync Era features:
  • The introduction of a cross-chain bridge for the movement of tokens and the commencement of dApp trials;
  • The conclusion of safety audits, competitions, and Bug Bounty initiatives;
  • Enhanced utilities for developers including plugins, instructional resources, and templates for development;
  • Complete alignment of platforms and protocols with the Ethereum blockchain.

ZkSync is the most popular zk-rollup currently with more than $730 mlm in TVL combined

zkSync Era TVL has reached $640 million and zkSync lite has reached $81 million in just 3 months.
zkSync market cap Era tvl
The closest project is dydx - perpetual exchange the most powerful open trading platform for crypto assets. It provides margin trading, borrowing, and lending of cryptocurrency.
layer 2 table -zksync top 10

Key differences of zkSync to PolygonZKEVM, Starknet, ZKSpace, Aztec

zkSync, developed by Matter Labs, is a ZK Rollup that uses zero-knowledge proofs to bundle multiple transactions into a single proof, which is then posted on the Ethereum mainnet. As of June 2023, it has a total value locked (TVL) of $646 million, making it one of the leading Layer 2 solutions. zkSync's technology is designed to be universal, meaning it can support any type of transaction or smart contract that can be executed on Ethereum.
PolygonZKEVM is another ZK Rollup solution that has a TVL of $42.4 million. It stands out due to its compatibility with Ethereum's EVM, which allows developers to port their existing Ethereum dApps without any code changes. This feature makes it a compelling choice for developers looking for an easy transition to Layer 2. The transaction fee could be paid in ETH and is also important to note that Polygon zkEVM supports Account Abstraction via ERC-4337, which will allow you to pay fees with any token transparently from a user's perspective.
Starknet, with a TVL of $67.29 million, is a universal Layer 2 solution built using StarkWare's zk-STARKs technology. Unlike zkSync and PolygonZKEVM, Starknet uses a different type of zero-knowledge proof, which doesn't require a trusted setup and offers better scalability. ZKSpace, another ZK Rollup solution, has a TVL of $22.92 million. It is designed to support tokens, NFTs, and AMM (Automated Market Makers), making it a versatile Layer 2 solution for various DeFi applications.
Lastly, Aztec, with a TVL of $6.34 million, is a ZK Rollup solution that focuses on privacy. It uses zk-SNARKs technology to provide private transactions on Ethereum, making it a unique Layer 2 solution in the privacy space. Aztec Labs developed Noir - the language of zero-knowledge proofs. You could find more details in our overview of LEO and NOIR language here:
Overall, while all of these solutions offer similar benefits such as scalability and low transaction fees, they differ in terms of their architecture, features, and use cases. Therefore it is important to consider all these factors when choosing the most suitable layer 2 solutions for your project.

Check out our website and please join our community!

Twitter

Telegram

Website

Looking for audit, let's talk

zkSync Ecosystem

The success of zkSync relies on its ecosystem of projects and developers. The zkSync ecosystem is diverse and vibrant, with numerous DApps and platforms built on top of the protocol. These projects cover various sectors, including decentralized finance (DeFi), non-fungible tokens (NFTs), wallets, bridges, and infrastructure.
Some of the notable projects in the zkSync ecosystem include:
SyncSwap
TVL: $69 million
https://syncswap.xyz/
SyncSwap is a decentralized exchange (DEX) on zkSync Era - Uniswap fork.
iZiSwap
TVL: $25.7 million
https://izumi.finance/
A next-generation DEX on BNB Chain to maximize capital efficiency with the innovative Discretized-Liquidity-AMM model
Velocore
TLV: $11.6 million
https://velocore.xyz/
Velocore is a low-slippage DEX on zkSync Era. Swap, farming, Lending, launchpad and vault. Building the essential blocks of DeFi on top of zkRollup technology.
You could find the full list here
These projects represent just a fraction of the zkSync ecosystem, which continues to grow and evolve. The diversity of applications built on zkSync demonstrates the protocol's versatility and its potential to revolutionize various sectors of the blockchain industry.

zkSync Token and Potential Airdrop

While zkSync does not currently have a native token, the protocol plans to introduce one. The native token will be a reward mechanism for zk-rollup operators and validators in the zkSync network. Additionally, zkSync users may be able to participate in an airdrop similar to the Optimism airdrop.
The introduction of a native token and the potential for an airdrop will further incentivize users to engage with zkSync and contribute to its ecosystem. It will also align the interests of stakeholders within the network and foster community participation and collaboration.

How to Use zkSync

Using zkSync is relatively straightforward. Users must connect their browser-based wallet to the zkSync wallet to get started. The official zkSync wallet supports many web3-compatible wallets, including Metamask, Ledger, Trezor, and Coinbase Wallet. Once connected, users can fund their zkSync account and activate it.
With a funded and activated account, users can then transfer funds to other zkSync accounts or explore the zkSync ecosystem. The zkSync ecosystem offers a wide range of DApps and services, including decentralized exchanges, yield optimization platforms, NFT marketplaces, and more. Users can leverage zkSync's scalability and cost-effectiveness to enhance their blockchain experience and interact with various applications seamlessly.
You can find the guide here.

zkSync Roadmap

The future of zkSync looks promising, with several exciting developments on the horizon. The protocol aims to continue improving its scalability and functionality to meet the growing demand for layer 2 solutions. Here are some key milestones on the zkSync roadmap:
  • zkSync 2.0: With the release of zkSync 2.0, the protocol plans to achieve a throughput of over 100,000 transactions per second by leveraging sharding technology. This significant increase in scalability will position zkSync as one of the most efficient layer 2 solutions for Ethereum.
  • Tokenomics and Staking: zkSync intends to introduce a native token to incentivize validators and operators in the network. The token will also serve as a staking mechanism, allowing users to participate in the consensus and security of the zkSync network.
  • EVM Compatibility: zkSync is working on enhancing its compatibility with the Ethereum Virtual Machine (EVM). This compatibility will enable developers to build general-purpose applications using existing Solidity code, further expanding the zkSync ecosystem and attracting more developers to the platform.
  • HyperBridges: zkSync plans to introduce HyperBridges, a layer 3 hyperchain that will offer even greater scalability and tokenomics. This development will further solidify zkSync's position as a leading layer 2 solution and open up new possibilities for decentralized applications and services.
The zkSync team is actively working on these developments, collaborating with the community and conducting security audits to ensure the reliability and robustness of the protocol. As zkSync continues to evolve, it will play a vital role in accelerating the mass adoption of blockchain technology and empowering users with fast, secure, and cost-effective transactions.

How to deploy EVM-based Smart Contract on zkSync

Most DeFi and NFT projects don't require extensive code changes. In the initial version, the compiler will automatically replace calls to SHA256 and Keccak256 with a hash function that works well with circuits. While there are a few other cryptographic primitives that are currently unsupported, such as ecrecover and the cryptographic precompiles, rest assured that the development team is actively working on them.
To keep up with the latest updates and known bugs in zkSync, you can check out the list here
Excitingly, you have full interaction capabilities with smart contracts and the zkSync network through their Web3 API and Ethers SDK.
  • For "read" requests, any web3-compliant framework in any programming language will seamlessly work with additional optional zkSync L2 specific functionality. Check full docs here
  • For "write" requests, like sending transactions, you should note that there are fundamental differences between L1 and L2. As a result, you will need to add some extra code. For example, zkSync supports paying fees in any token, so when sending a transaction, users will need to choose the token they prefer to pay the fees with.
When it comes to submitting transactions and interacting with smart contracts, users will sign an EIP712 message with a hash of the calldata. Since EIP712 is based on a native Ethereum signature, all wallets, even hardware wallets, will work without any extensions required. If you are seeking a possible solution for multi-wallet conflicts, EIP-6963 is something you should look into.
If you are looking for support with deployment, check out our proprietary service: Deployment Check. We would be happy to discuss any of your security and deployment requests. Let's talk

Conclusion

In conclusion, zkSync is a layer 2 blockchain protocol that aims to address Ethereum's scalability challenges. By leveraging zero-knowledge rollups, zkSync provides a scalable and privacy-focused engine for Ethereum, enabling faster and cheaper transactions. With its low gas fees, high transaction throughput, and compatibility with existing Ethereum infrastructure, zkSync offers a compelling solution for users and developers alike.
The zkSync ecosystem is vibrant and diverse, with numerous projects and applications built on top of the protocol. From decentralized exchanges and yield optimization platforms to NFT marketplaces and infrastructure projects, the zkSync ecosystem is driving innovation and pushing the boundaries of what is possible in the blockchain industry.
As zkSync continues to evolve and achieve new milestones, it is poised to play a significant role in the future of blockchain technology. With its commitment to security, scalability, and interoperability, zkSync is well-positioned to accelerate the mass adoption of crypto and empower individuals with greater control over their financial sovereignty. For layer 2 smart contract audit queries, feel free to get in touch with us today!

Check out our website and please join our community!

Twitter

Telegram

Website

Looking for audit, let's talk