*Forward the Original Title‘How ZKP and ZK-Rollups help solve the scalability problem: a review of the zkSync blockchain’
In this article, we’ll explain what Zero-knowledge proof technology is and talk about a popular blockchain — zkSync: how transactions work in zkSync and the main differences from the Ethereum Virtual Machine (EVM). Also discuss the advantages and disadvantages of this blockchain, which we believe could have a promising future.
ZkSync is a second-level blockchain (Layer 2 — L2) for Ethereum, designed to address the issues of high fees and limited throughput (Transactions Per Second — TPS) on the Ethereum network. This platform employs ZK-Rollup technology, which uses Zero-Knowledge Proofs (ZKP) to batch multiple transactions off the main network (L1). Only the cryptographic proofs of the transactions’ correctness and their compressed data are sent to L1, significantly enhancing efficiency and reducing costs.
Developed by Matter Labs, zkSync is announced as a fully open source (100% open source) product, managed by the community. According to Cryptorank, the project has already attracted attention, raising investments of $458 million. In the long term, Matter Labs aims to create a comprehensive ecosystem. Currently, two blockchains are operational: zkSync Lite, which processes payments in ETH and ERC20 tokens, and zkSync Era, supporting full-fledged smart contracts. Future plans include launching a hyperchain system (L3), ensuring high security. Matter Labs’ goal is to scale the technology to a level that will attract the next billion blockchain users.
ZkSync represents a new approach to solving the scalability problem known as the blockchain trilemma. This project, like other Layer 2 (L2) solutions, seeks to find a balance between security, scalability, and decentralization in blockchain networks.
Ethereum focuses on security and decentralization, emphasizing its status as a peer-to-peer protocol with nodes distributed around the world. For the latest information on node distribution, refer to NodeWatch.
To maintain decentralization in the network, each node must verify all transactions. This inherently slows down the network. Moreover, under high network load, transactions can become quite expensive and require significant time to process.
The main task for increasing the TPS of the Ethereum network without increasing the load on the nodes was the introduction of Sharding in combination with the transition to PoS (Proof of Stake) consensus. This involved dividing validators into subgroups to process separate segments of the network, thereby reducing the overall load and increasing throughput. However, the community has focused on Layer 2 solutions, considering their rapid development.
In addition to the idea of implementing Sharding in Ethereum, other scalability solutions have emerged, such as:
As well as technologies based on Zero-Knowledge Proofs (ZKP), including:
More detailed information can be found here.
Although Sharding is still under development, the Dencun hardfork is planned for early 2024, which will implement Proto-Danksharding. This intermediate step is aimed at improving Layer 2 solutions, making data storage on L1 more economical. Thus, Proto-Danksharding promises to reduce transaction costs on L2, as a step towards a full-fledged Sharding solution.
At first glance, L2 blockchains may seem similar, as their main task is to increase the number of transactions outside of L1 while delegating the role of security guarantor to L1. Developers of such blockchains often claim that their solutions are the fastest, most reliable, and simplest. In reality, each approach to scaling has its nuances, and inevitable compromises regarding transaction speed, security level, or degree of decentralization. Fully centralized solutions are also common. All these aspects bring us back to the fundamental issues of the blockchain trilemma.
In this article, key criteria for evaluating protocols used in Layer-2 solutions are proposed. They include:
Important! The article is written by Matter Labs and, in my opinion, some things are “stretched” in favor of zkRollup (since there is a clear conflict of interest), but that’s not so important, the main thing is to see what differences exist between Layer-2 protocols.
Below I will provide a table, and here I will briefly describe its contents.
With performance, it’s straightforward. TPS (Transactions Per Second) indicates the network’s throughput, and in the context of scaling, it’s the most crucial parameter.
Economic aspects:
Below is a comparative table of the main ZKP-based solutions:
For a more detailed understanding of Zero-Knowledge Proofs (ZKP), I recommend referring to this article in our blockchain-wiki, created by developers for developers with a love for proofs and deep dives into details.
The operation of ZK-Rollups can be represented at a high level as follows:
In the context of zkSync’s architecture, the process looks like this:
Validators in ZK-Rollups play a key role, packing transactions into blocks and generating Zero-Knowledge Proofs for them. A feature of the system is that validators physically cannot steal funds. The most significant potential harm they can cause is a temporary halt of the network.
Note: In zkSync Era, the role of validators is performed by operators.
Developers of zkSync highlight the following guarantees of their architecture:
Transactions in zkSync Era go through several key states, different from the usual Rollup confirmations in L1:
In addition to the block number, transactions in zkSync also display the package number. Originally, parameters such as block.number, block.timestamp, and blockhash were taken from L1. However, after an update, these values will now be obtained from L2. Despite this, developers plan to provide methods for accessing data from L1.
Compatibility of L2 solutions based on ZKP with Ethereum is a complex task. This is because Ethereum was not originally designed for optimal interaction with ZKP. As a result, in developing such systems, a compromise must be found between performance and scalability potential on the one hand, and compatibility with Ethereum and EVM on the other. Vitalik Buterin’s article “The different types of ZK-EVMs” discusses these aspects in detail and highlights different levels of compatibility.
zkSync chose one of the most challenging paths, aiming for high performance but with limited compatibility with both Ethereum and EVM. To obtain bytecode compatible with zkEVM, the LLVM project is used with a suite of proprietary compilers and optimizers. In the case of Solidity and Yul, after the standard solc compiler, the code undergoes several more stages before becoming zkEVM bytecode. The diagram below illustrates all the stages of this process (described in more detail here):
Important! Optimizations in zksolc are supported.
Bytecode specifically compiled for EVM is not compatible with zkEVM. This means that the addresses of identical smart contracts in Ethereum and zkSync will differ. However, developers plan to solve this problem in the future.
One of the significant advantages of this approach is independence from specific programming languages. In the future, zkSync developers promise to add support for languages like Rust and C++. It is important that the delay in updates and the integration of innovations between high-level compilers (e.g., solc) and platform compilers (e.g., zksolc) is minimal. Initially, there was an idea to create their own programming language, Zinc, but at the moment, the team is focused on supporting more popular programming languages.
The issue of compatibility of zk-compilers with existing development and debugging tools for Solidity and Vyper smart contracts is significant. Current development platforms such as Remix, Hardhat, and Foundry do not support zk-compilers out of the box, creating difficulties in working with them. However, solutions are being developed that promise to ease the migration process of projects and adaptation to new technologies.
Vitalik Buterin’s article mentions that Ethereum will likely strive to improve compatibility with ZKP at the protocol level over time. Similarly, L2 solutions with ZKP will adapt for better compatibility with Ethereum. As a result, in the future, the differences between these systems may become almost imperceptible, ensuring a smoother integration and transition for developers.
Important! The protocol is actively being developed; always refer to the latest version of the documentation!
zkEVM differs from EVM and despite developers’ efforts to hide these differences “under the hood,” there are important features to consider when writing smart contracts:
For a deep understanding of working with zkEVM, it is recommended to study the documentation, including the section “Security and best practices”.
Account abstraction in zkSync offers several key advantages over ERC-4337:
The infrastructure of zkSync Era is rapidly gaining momentum and already includes dozens of protocols: Bridges, DeFi, infrastructure protocols, and more. (The current list can be viewed here).
Another advantage is compatibility with Ethereum wallets, such as MetaMask or TrustWallet.
The zkSync protocol began its development with the launch of zkSync Lite, aimed only at transfers of ether and ERC-20 tokens, without the capability of deploying full-fledged protocols. This stage was an important step in development but only preceded the arrival of zkSync Era — a full-fledged L2 solution for Ethereum, which theoretically can be adapted for other L1 blockchains as well. However, zkSync’s ambitions don’t stop there, as the development plans include the launch of so-called hyperchains.
Hyperchains, or “fractal scaling,” consist of ZKP networks, each forming its own blocks and proofs. These proofs are then collected together and posted on the main L1 network. Each of these networks is a complete copy of the entire system and can be considered its “fractal”.
The uniqueness of hyperchains is that they can be created and deployed independently. To maintain consistency and compatibility, each hyperchain must use a common zkEVM engine, part of the ZK stack (with zkSync Era acting as the first hyperchain). This allows hyperchains to inherit their security from L1, ensuring their reliability and eliminating the need for additional trust and security measures.
Hyperchains represent an innovative approach to scaling blockchain networks, reducing the load on the main network and increasing transaction processing speed. Key aspects of this approach include:
More about all this can be found here.
The zkSync protocol looks very promising and has great potential, although at present, launching on this blockchain is still associated with a number of risks that need to be considered. Developing for zkSync is currently more challenging than for blockchains that are much more compatible with EVM and the EVM development stack. However, perhaps in the future, this difference will become insignificant or disappear altogether.
*Forward the Original Title‘How ZKP and ZK-Rollups help solve the scalability problem: a review of the zkSync blockchain’
In this article, we’ll explain what Zero-knowledge proof technology is and talk about a popular blockchain — zkSync: how transactions work in zkSync and the main differences from the Ethereum Virtual Machine (EVM). Also discuss the advantages and disadvantages of this blockchain, which we believe could have a promising future.
ZkSync is a second-level blockchain (Layer 2 — L2) for Ethereum, designed to address the issues of high fees and limited throughput (Transactions Per Second — TPS) on the Ethereum network. This platform employs ZK-Rollup technology, which uses Zero-Knowledge Proofs (ZKP) to batch multiple transactions off the main network (L1). Only the cryptographic proofs of the transactions’ correctness and their compressed data are sent to L1, significantly enhancing efficiency and reducing costs.
Developed by Matter Labs, zkSync is announced as a fully open source (100% open source) product, managed by the community. According to Cryptorank, the project has already attracted attention, raising investments of $458 million. In the long term, Matter Labs aims to create a comprehensive ecosystem. Currently, two blockchains are operational: zkSync Lite, which processes payments in ETH and ERC20 tokens, and zkSync Era, supporting full-fledged smart contracts. Future plans include launching a hyperchain system (L3), ensuring high security. Matter Labs’ goal is to scale the technology to a level that will attract the next billion blockchain users.
ZkSync represents a new approach to solving the scalability problem known as the blockchain trilemma. This project, like other Layer 2 (L2) solutions, seeks to find a balance between security, scalability, and decentralization in blockchain networks.
Ethereum focuses on security and decentralization, emphasizing its status as a peer-to-peer protocol with nodes distributed around the world. For the latest information on node distribution, refer to NodeWatch.
To maintain decentralization in the network, each node must verify all transactions. This inherently slows down the network. Moreover, under high network load, transactions can become quite expensive and require significant time to process.
The main task for increasing the TPS of the Ethereum network without increasing the load on the nodes was the introduction of Sharding in combination with the transition to PoS (Proof of Stake) consensus. This involved dividing validators into subgroups to process separate segments of the network, thereby reducing the overall load and increasing throughput. However, the community has focused on Layer 2 solutions, considering their rapid development.
In addition to the idea of implementing Sharding in Ethereum, other scalability solutions have emerged, such as:
As well as technologies based on Zero-Knowledge Proofs (ZKP), including:
More detailed information can be found here.
Although Sharding is still under development, the Dencun hardfork is planned for early 2024, which will implement Proto-Danksharding. This intermediate step is aimed at improving Layer 2 solutions, making data storage on L1 more economical. Thus, Proto-Danksharding promises to reduce transaction costs on L2, as a step towards a full-fledged Sharding solution.
At first glance, L2 blockchains may seem similar, as their main task is to increase the number of transactions outside of L1 while delegating the role of security guarantor to L1. Developers of such blockchains often claim that their solutions are the fastest, most reliable, and simplest. In reality, each approach to scaling has its nuances, and inevitable compromises regarding transaction speed, security level, or degree of decentralization. Fully centralized solutions are also common. All these aspects bring us back to the fundamental issues of the blockchain trilemma.
In this article, key criteria for evaluating protocols used in Layer-2 solutions are proposed. They include:
Important! The article is written by Matter Labs and, in my opinion, some things are “stretched” in favor of zkRollup (since there is a clear conflict of interest), but that’s not so important, the main thing is to see what differences exist between Layer-2 protocols.
Below I will provide a table, and here I will briefly describe its contents.
With performance, it’s straightforward. TPS (Transactions Per Second) indicates the network’s throughput, and in the context of scaling, it’s the most crucial parameter.
Economic aspects:
Below is a comparative table of the main ZKP-based solutions:
For a more detailed understanding of Zero-Knowledge Proofs (ZKP), I recommend referring to this article in our blockchain-wiki, created by developers for developers with a love for proofs and deep dives into details.
The operation of ZK-Rollups can be represented at a high level as follows:
In the context of zkSync’s architecture, the process looks like this:
Validators in ZK-Rollups play a key role, packing transactions into blocks and generating Zero-Knowledge Proofs for them. A feature of the system is that validators physically cannot steal funds. The most significant potential harm they can cause is a temporary halt of the network.
Note: In zkSync Era, the role of validators is performed by operators.
Developers of zkSync highlight the following guarantees of their architecture:
Transactions in zkSync Era go through several key states, different from the usual Rollup confirmations in L1:
In addition to the block number, transactions in zkSync also display the package number. Originally, parameters such as block.number, block.timestamp, and blockhash were taken from L1. However, after an update, these values will now be obtained from L2. Despite this, developers plan to provide methods for accessing data from L1.
Compatibility of L2 solutions based on ZKP with Ethereum is a complex task. This is because Ethereum was not originally designed for optimal interaction with ZKP. As a result, in developing such systems, a compromise must be found between performance and scalability potential on the one hand, and compatibility with Ethereum and EVM on the other. Vitalik Buterin’s article “The different types of ZK-EVMs” discusses these aspects in detail and highlights different levels of compatibility.
zkSync chose one of the most challenging paths, aiming for high performance but with limited compatibility with both Ethereum and EVM. To obtain bytecode compatible with zkEVM, the LLVM project is used with a suite of proprietary compilers and optimizers. In the case of Solidity and Yul, after the standard solc compiler, the code undergoes several more stages before becoming zkEVM bytecode. The diagram below illustrates all the stages of this process (described in more detail here):
Important! Optimizations in zksolc are supported.
Bytecode specifically compiled for EVM is not compatible with zkEVM. This means that the addresses of identical smart contracts in Ethereum and zkSync will differ. However, developers plan to solve this problem in the future.
One of the significant advantages of this approach is independence from specific programming languages. In the future, zkSync developers promise to add support for languages like Rust and C++. It is important that the delay in updates and the integration of innovations between high-level compilers (e.g., solc) and platform compilers (e.g., zksolc) is minimal. Initially, there was an idea to create their own programming language, Zinc, but at the moment, the team is focused on supporting more popular programming languages.
The issue of compatibility of zk-compilers with existing development and debugging tools for Solidity and Vyper smart contracts is significant. Current development platforms such as Remix, Hardhat, and Foundry do not support zk-compilers out of the box, creating difficulties in working with them. However, solutions are being developed that promise to ease the migration process of projects and adaptation to new technologies.
Vitalik Buterin’s article mentions that Ethereum will likely strive to improve compatibility with ZKP at the protocol level over time. Similarly, L2 solutions with ZKP will adapt for better compatibility with Ethereum. As a result, in the future, the differences between these systems may become almost imperceptible, ensuring a smoother integration and transition for developers.
Important! The protocol is actively being developed; always refer to the latest version of the documentation!
zkEVM differs from EVM and despite developers’ efforts to hide these differences “under the hood,” there are important features to consider when writing smart contracts:
For a deep understanding of working with zkEVM, it is recommended to study the documentation, including the section “Security and best practices”.
Account abstraction in zkSync offers several key advantages over ERC-4337:
The infrastructure of zkSync Era is rapidly gaining momentum and already includes dozens of protocols: Bridges, DeFi, infrastructure protocols, and more. (The current list can be viewed here).
Another advantage is compatibility with Ethereum wallets, such as MetaMask or TrustWallet.
The zkSync protocol began its development with the launch of zkSync Lite, aimed only at transfers of ether and ERC-20 tokens, without the capability of deploying full-fledged protocols. This stage was an important step in development but only preceded the arrival of zkSync Era — a full-fledged L2 solution for Ethereum, which theoretically can be adapted for other L1 blockchains as well. However, zkSync’s ambitions don’t stop there, as the development plans include the launch of so-called hyperchains.
Hyperchains, or “fractal scaling,” consist of ZKP networks, each forming its own blocks and proofs. These proofs are then collected together and posted on the main L1 network. Each of these networks is a complete copy of the entire system and can be considered its “fractal”.
The uniqueness of hyperchains is that they can be created and deployed independently. To maintain consistency and compatibility, each hyperchain must use a common zkEVM engine, part of the ZK stack (with zkSync Era acting as the first hyperchain). This allows hyperchains to inherit their security from L1, ensuring their reliability and eliminating the need for additional trust and security measures.
Hyperchains represent an innovative approach to scaling blockchain networks, reducing the load on the main network and increasing transaction processing speed. Key aspects of this approach include:
More about all this can be found here.
The zkSync protocol looks very promising and has great potential, although at present, launching on this blockchain is still associated with a number of risks that need to be considered. Developing for zkSync is currently more challenging than for blockchains that are much more compatible with EVM and the EVM development stack. However, perhaps in the future, this difference will become insignificant or disappear altogether.