Rollups:  Zk or ZkEVM?

Rollups: Zk or ZkEVM?

A quick high level understanding of the ZK technology

What are Zks

Zero-knowledge (Zk) Proofs are used to prove the validity of a statement without revealing the statement. They are used for enhancing privacy and security in various applications, in this case, the Ethereum blockchain.

Zero Knowledge Roll-ups (Zk Roll-ups) are layer 2 scaling solutions that increase the throughput on Ethereum Mainnet by moving computation and state storage to layer 2.
In a Zk-rollup, multiple transactions are batched together off-chain and then verified by a single smart contract on the blockchain. This smart contract then creates proof that all the transactions are valid, without revealing any of the individual transaction details. This proof is then submitted to the blockchain, where it is verified by nodes on the network.

By using Zk-rollups, the number of transactions that can be processed on the blockchain is greatly increased, since only the proof of the batch of transactions needs to be verified on the blockchain, rather than each transaction. This results in lower fees and faster transaction times, making decentralized applications more practical and user-friendly.

Why is there a need for this?

There is a need for Zk-rollups in Ethereum because the blockchain's limited transaction throughput can often result in high gas fees and slow transaction times. Ethereum, like other blockchain networks, has a limited capacity for processing transactions due to the consensus mechanism used to maintain the integrity of the network. This is known as the "Scalability Trilemma," where a blockchain network can only achieve two out of three desirable properties: security, scalability, and decentralization.

Source

This is because Ethereum is a monolithic blockchain.
A monolithic blockchain is a type of blockchain architecture where all nodes on the network are responsible for storing and processing all data and transactions on the network. In other words, a monolithic blockchain has a single, integrated layer of data storage and processing.

In a monolithic blockchain, all nodes on the network are treated equally and perform the same tasks, where all nodes validate transactions and store the entire blockchain history. However, as blockchain networks grew larger and more complex, this architecture became less scalable and less efficient.

They take on the four(4) basic areas of blockchain single-handedly:
Data availability
Consensus
Settlement
Execution

On Rollups, transactions are batched and executed, anyone can transact and the transactions are sent to Ethereum layer 1.
It is important to note that Zk rollups are not Side Chains. Sidechains are also monolithic chains even though they are layer 2 scaling solutions they simply are not as powerful and secure as Zk Rollups.

Also, Side chains do not exactly scale the Ethereum network, a sidechain is a separate blockchain that is attached to the Ethereum blockchain, or parent chain and is designed to operate in parallel with it. Sidechains are a type of layer-2 scaling solution that allows for faster and more efficient processing of transactions without congesting the main blockchain.

In a side chain system, assets are moved from the main blockchain to the side chain and back again through a two-way peg mechanism. This allows for the transfer of assets and data between the two chains, which enables side chains to perform a specific function or offer a particular feature without affecting the main chain.

Rollups use better and more secure bridges to move assets. ZK-rollups have the potential to greatly improve the user experience and functionality of decentralized applications on Ethereum by providing faster and cheaper transactions while maintaining the security and decentralization of the underlying blockchain network.

zkEVM vs zk

A zk-EVM roll-up is a type of Zero-Knowledge Roll-up that uses the EVM (Ethereum Virtual Machine) to execute smart contracts within a zero-knowledge proof.

In a zk-EVM roll-up, all transactions are processed off-chain and are verified through a zero-knowledge proof. The proof is then submitted to the Ethereum main chain for verification, and the state of the roll-up is updated accordingly. The EVM is used within the zero-knowledge proof to execute the smart contracts, enabling complex computations and contract interactions to be performed off-chain.

Problems faced by Roll-up solutions

EVM compatibility

Migrating dApps to ZK solutions can be a challenging process, as it involves significant changes to the dApp's existing infrastructure and codebase.

  1. Compatibility issues: ZK is a new technology, and migrating to it may require changes to the existing codebase to ensure compatibility. This can be a complex and time-consuming process, especially for larger dApps.

  2. Changes to the smart contracts: ZK requires modifications to the smart contracts that manage the dApp's functionality. These modifications may include changes to how data is stored and how transactions are processed, which can be difficult and time-consuming to implement.

  3. Integration with the ZK Sync network: Integrating a dApp with the ZK Sync network requires changes to the dApp's infrastructure and configuration. This can be a complex process, especially for dApps that have a large user base and require high levels of availability and scalability.

  4. Testing and debugging: After the dApp has been migrated to ZK Sync, it needs to be thoroughly tested and debugged to ensure that it works correctly and is compatible with the ZK Sync network. This can be a time-consuming and resource-intensive process.

Zk Evm on the other hand solves all these problems:

  1. Compatibility with existing smart contracts: Zk EVM is designed to be compatible with existing Ethereum smart contracts, which means that developers can use their existing codebase without the need for significant modifications.

  2. Faster transaction processing: By executing smart contracts off-chain, Zk EVM can significantly increase the throughput of the blockchain network. This enables faster transaction processing and reduces network congestion.

  3. Better privacy: Zk EVM uses Zero-Knowledge proofs to verify smart contract execution without revealing any sensitive information, such as contract data or inputs. This provides users with a high degree of privacy and protects them from potential attacks.

  4. Versatility: Zk EVM supports a wide range of smart contract functionality, including complex operations like token transfers, state updates, and more. This makes it a versatile and scalable solution for executing smart contracts off-chain.

Optimistic roll-ups are not powerful enough

Many exciting solutions have emerged in the layer 2 scaling space. Projects like Arbitrum, Optimism are both using a type of scaling technology called "Optimistic Roll-ups". Optimistic Roll-ups are Layer 2 scaling solutions that enable faster and cheaper transactions on blockchain networks by aggregating multiple transactions off-chain and then committing them to the main blockchain in a single batch. This approach can significantly increase the throughput of the underlying blockchain while maintaining its security and decentralization properties.

In Optimistic Rollup, transactions are verified by a sequencer who collects transactions and periodically submits them to the Ethereum network. This means that the sequencer has access to all transaction data and can potentially manipulate the transaction order or even censor transactions. Zk EVM, on the other hand, uses Zero-Knowledge proofs to verify smart contract execution without revealing any sensitive information, such as contract data or inputs. This provides users with a high degree of privacy and protects them from potential attacks.

Optimistic Roll-up only supports a limited set of operations, such as token transfers and simple contract calls. Zk EVM, on the other hand, supports a wide range of smart contract functionality, including complex operations like state updates and conditional payments. This makes Zk EVM a more versatile and scalable solution for executing smart contracts off-chain.

Some ZkEVM solutions you can start trying out today, I personally recommend both of these:
Polygon ZkEVM

ConsenSys Linea

Thanks for reading.