Decentralized exchange Uniswap has opted for Arbitrum’s optimistics rollups.
ConsenSys and Mastercard prefer ZK rollups in their solutions for corporate clients.
The main Ethereum network does not currently offer a good user experience, due to its congestion, waiting times for confirmation of transactions and the high fees that must be paid to miners to operate.
This is why scalability solutions (e.g. second layers or sidechains) are especially important, in a context in which dozens of decentralized finance (DeFi) protocols are emerging every day, marketplaces collectible tokens (NFT) or games play-to-earn.
Among the second layer solutions in Ethereum stand out, due to their development and popularity, the rollups. These allow you to “wrap” multiple transactions and execute them outside the main chain. The aforementioned transactions can be ether (ETH) shipments, tokens, or smart contract signatures.
By doing this, there is no need to pay fees to the miners and no backbone stuck. Gas must only be paid when entering the rollup or when leaving (to settle the operations in the Ethereum blockchain), because that does imply a transaction in the mother chain.
Two types of rollups compete for the majority of the market: ZK rollups and optimistics. In this text, briefly and in easy-to-understand language (which implies omitting or simplifying as much as possible some details and technical complexities), the similarities and differences between the two will be seen.
How are Ethereum’s ZK and optimistics rollups alike?
Broadly speaking, from the user’s perspective, both scalability solutions work in the same way, by “wrapping” transactions and allowing them to operate outside the main Ethereum blockchain (often referred to by its English name, “the mainnet»).
They are also similar in that both rollups must “prove” to the Ethereum network that they are doing a correct job. Explain OffchainLabs, Arbitrum development team (optimistic type rollups): “rollups demonstrate their accuracy using specialized tests that allow Ethereum to verify accuracy even without executing transactions.”
To trust or not to trust? That’s the question for Ethereum rollups
It is in the latter (in the way of demonstrating to Ethereum that the rules are being followed) is where the differences begin. On the one hand, optimistic rollups take – as their name implies – an “optimistic” stance, in which all parties act in good faith. Instead, ZK rollups – acronym for “zero knowledge” – seek to ensure that this is actually the case.
Limechain, a decentralized application development company (dApps), details the following:
“Optimism uses a smart contract to transmit transaction data from the Ethereum backbone to a second layer network. There, a sequencer can bundle multiple transactions into one batch, and then send that batch up the main chain through a single transaction. The sequencers perform these functions optimistically under the assumption that all transactions are valid.
Limechain, dApps development company
And how can you be “optimistic” and believe that everyone is acting in good faith? What happens if there is a malicious entity in the process? Optimitics rollups solve that by providing a period (for example, a week) during which that assumption can be questioned. In case of discrepancies, a proof of fraud is generated. This implies that the entire second layer transaction runs on the main network. “The advantage of this approach is that it allows a very fast generation of tests”, explains Limechain.
Different is the case of ZK rollups, which use validity tests. This means that some part must provide cryptographic proof publicly, establishing the existence of a valid string ending in a particular state.
Details the Arbitrum team (which, as we have mentioned, develops optimistic type rollups):
«[Los rollups ZK] they require the testing party to run the string, to know how to build the test, and then have to build the test by performing a series of complex cryptographic operations. The proof is verified by a contract on the main chain. ‘
OffChain Labs, Arbitrum rollup developer
Arguments found about Ethereum rollups
And which rollup is better, the optimistics or the ZK? Here each company or rollup development team, of course, defends its interests and highlights the advantages of its own. In this compendium, we will say that each of them has its advantages and disadvantages and could be more suitable (or not) depending on the use that you want to give it.
It is also possible that one of these types of rollups ends up being the favorite of the market and the one that prevails over the other.
As to execution costs, optimistics rollups only execute contracts, without the need to produce the complex cryptographic tests (which can require hundreds or thousands of transactions) of the ZKs. However, optimistics inevitably require that the system have many nodes.
On these arguments, the defenders of rollup optimistics indicate that, if a chain is executed on a large scale, yes or yes, many nodes will be required, so it does not imply an additional expense. And the defenders of the ZKs argue in their favor that the cryptographic tests could be done with only part of the operations, without the need to replicate a lot of transactions.
Another point to keep in mind is the compatibility of the rollups with the Ethereum virtual machine (EVM), which is what allows the execution of smart contracts. Here it depends a lot on each particular rollup, regardless of its type.
For example, Arbitrum (optimistic type rollup) was designed from the ground up to be EVM compliant. On the other hand, the rollups of the Optimistic company (which, of course, are also of the optimistic type) added the compatibility after their users required it.
Also, among the ZK rollups there is compatibility for all tastes. In the words of Arbitrum about its competition: «Some [rollups ZK] ignore [la EVM] considering it a legacy tool and encourage users to learn their custom languages. Other ZK systems do not attempt to be compatible. And that’s fine for developers and users who don’t care about compatibility. “
Another thing that both types of rollups differ on is how they solve the “transparency-compression” dilemma. That is, the ability for operations to be visible at the same time as they manage to compress them to “wrap” them within the rollup.
Optimistic type rollups allow anyone to see the content of the string, without having to rely on a centralized party. “This means not only that everyone can see occasional status snapshots, but they can also see the full history of the chain, how it got to its current state,” explains Arbitrum.
In contrast, ZK rollups, for greater compression, skip parts of the chain’s history. Viewing them would require a centralized data provider willing to share them. This, although it goes to the detriment of the transparency that is intended, speeds up the execution times of the transactions.
What is needed to execute the rollups? Here, optimistics have an advantage in terms of requirements. The fraud test can be performed by any node. On the other hand, in the ZK (remember that the test requires replicating hundreds or thousands of transactions) special software and hardware may be necessary.
If the parameter being evaluated is the “bridge” with Ethereum, the advantage is carried by the ZK rollups. With optimistics, it can take a week to transfer funds from the rollup to the mainnet. As explained, this is to result in some evidence of fraud being presented. Instead, ZKs allow for a faster transition. All you need to do is publish a test on Layer 1, and voila.
Which rollup will win the battle? not even Vitalik Buterin has the answer
The market is divided and there are implementations that have preferred one or another type of rollup. For example, Uniswap, the most widely used decentralized exchange on Ethereum, opted for Arbitrum (optimistic type rollup). As CriptoNoticias reported, in May 2021 – even before Arbitrum was fully operational – the exchange community voted in favor of incorporating this scalability solution.
On the other hand, the developer firm ConsenSys, in conjunction with Mastercard, advance the development of ZK rollups to provide corporate solutions.
Vitalik Buterin, co-creator of Ethereum anticipates two possible scenarios in relation to what has been proposed: in one of them, one of the rollups dominates the market; in another, there is no dominant one and the capital is distributed among all the existing ones.
In any case, according to Buterin, the production of Ethereum blocks in the second layers would tend to centralization, as detailed in a text that was commented on by CriptoNoticias days ago.
This centralization – in the words of the Russian-Canadian developer – would not be a problem for the Ethereum ecosystem in general, as it could be compensated if the base layer (the main network or mainnet) remains strong and distributed over many nodes.