August 11, 2023

What are ZK Rollups?

dYdX
What are ZK Rollups?What are ZK Rollups?

Since its launch in 2015, Ethereum (ETH) has been the dominant blockchain for developers interested in smart contracts and decentralized applications (dApps). However, more users are shifting their focus from Ethereum's main chain to layer-2 (L2) protocols built on top of Ethereum. L2s use new blockchain technologies to interact with Ethereum's base protocol without charging users high gas fees. And ZK rollups are one such technology driving the rapid adoption of L2 networks.

Although ZK rollups aren't the only scaling solution for the Ethereum blockchain, they're gaining traction with many of cryptocurrency's top developers. Even Ethereum's cofounder Vitalik Buterin predicts ZK rollups will become Web3’s leading L2 scaling solution. So what are ZK rollups, and how could they change cryptocurrency?

But before we review ZK rollups, let’s take a look at rollups as a concept.

What is a Crypto Rollup?

At its most basic level, a "rollup" is a list of cryptocurrency transactions. The term rollup evokes the image of multiple crypto transfers "rolled up" in one digital envelope. However, these transactions don't occur on a layer-1 (L1) blockchain like Ethereum. Instead, rollups use off-chain software to verify and organize crypto transfer data.

L2s using rollup technology send batches of these crypto transactions to the L1 blockchain at regular intervals for final confirmation. And to ensure rollup data transfer is decentralized, L2s use smart contracts to communicate with their associated L1 blockchain.

The benefits of using rollups are twofold. First, since rollups take place off-chain, they take computational stress and congestion off the main blockchain. Second, rollup protocols compress significant data into "byte-size" pieces, maximizing the available space per block on L1 networks. Both these features amplify cryptocurrency networks’ efficiency by offering users faster confirmation speeds, higher transaction throughput, and lower fees. Additionally, by siphoning off user activity from the main blockchain, there's less risk for extreme bottlenecks on L1s.  

What is a ZK Rollup?

Short for zero-knowledge proofs, ZK refers to the distinctive verification process a ZK rollup uses before submitting bundles of crypto transactions. Computers on a ZK rollup network must solve advanced off-chain computations before sending crypto payment history to the main blockchain. Whenever a ZK processor sends their rollups to the main chain, they attach a "validity proof," which is a certificate showing the processor organized the transaction history.

Here, the validator nodes on an L1 blockchain (e.g., Ethereum) have "zero knowledge" of the incoming transaction batches. However, the validity proofs show the Ethereum mainnet off-chain ZK processors used immense computational power to prove these transactions. To provide an analogy, these proofs function like a unique seal of approval from a king on a letter distributed to his kingdom. The royals in this hypothetical kingdom first scan the paper for the distinctive seal before accepting its contents. Similarly, L1 blockchains check the validity proof is valid before submitting payment data to the distributed ledger.

How Does a ZK Rollup Work? 

ZK rollups work like the proof-of-work (PoW) consensus mechanism powering the Bitcoin (BTC) blockchain. In the PoW model, miners use high-powered computers to solve difficult algorithmic puzzles every few minutes, preventing bad actors from cheating the system and invalidating BTC’s history. Similarly, processors in a ZK rollup network must perform advanced computations to publish a validity proof on their batch of transactions.

The critical difference between the ZK rollup system and a PoW blockchain like Bitcoin is that the former takes place off the primary blockchain network. Also, ZK rollups compress all their transaction data off-chain before sending it to the main chain through smart contracts. But verification across both ZK rollups and PoW networks is essentially the same. 

ZK Rollups Versus Optimistic Rollups 

Optimistic rollups are another popular L2 protocol that processes crypto transactions off-chain and sends them to an L1 blockchain. But the difference between ZK and optimistic rollups is that the latter doesn't send validity proofs with crypto transfer data. Instead, an optimistic rollup assumes all transaction records passing through to the main chain are okay (hence the word "optimistic").

So now the question is, if optimistic rollups don't pre-screen transactions, how do L1 validators know whether to trust them?

Although each optimistic rollup has slightly different procedures, they all rely on "fraud proofs" rather than "validity proofs." Just because optimistic rollups assume every sender is innocent doesn't mean nodes aren't screening for errors. If a node suspects issues in a rollup, it flags the suspicious transaction for internal review. Crypto transaction history in a rollup won't post on the main blockchain until it clears the network with zero verifiable fraud charges.

Optimistic rollup protocols also use incentives and punishments to discourage bad behavior. For instance, nodes often have to put cryptocurrency as collateral in a "bond" to send new transactions or request fraud proofs. If the L2's system determines a transaction is invalid, it rewards the bonded crypto from the bad node to whoever reported the problem.

Optimistic rollups aren't as quick as ZK rollups since each transaction bundle won't post until the "fraud-proofing" stage is complete. In some cases, crypto users need to wait over a week for an optimistic rollup to clear on the main blockchain, even if there's no issue with their transaction history. However, optimistic rollups tend to be more adaptable in the crypto ecosystem than ZK rollups because they have lower computational requirements. Since optimistic rollups always assume transactions are valid, they don't need to expend as much time or energy generating validity proofs for every transaction. 

Pros and Cons of ZK Rollups

ZK rollups are a breakthrough in blockchain technology, but there are trade-offs with this scaling solution. Traders and builders should know the pros and cons of ZK rollups versus other L2 options before making decisions. 

Pros of ZK Rollups

  • Maximum security: ZK rollups don't need to resort to “game theory” tactics like optimistic rollups to prove every set of transactions. The rigorous nature of validity proofs ensures network participants always send pre-screened data to their L1 blockchain. 
  • Lower network fees: ZK rollups can fit thousands of crypto transactions into a small space on an L1 blockchain. The efficient use of storage capacity on blockchains like Ethereum helps make ZK rollups cheaper to process. 
  • Faster transaction throughput: ZK rollups help blockchains, such as Ethereum, process high transaction volumes in less time. They also offload computation-heavy validation processes from Ethereum's main chain, reducing network congestion risk. 

Cons of ZK Rollups

  • Not as cost-efficient as other solutions: Although ZK rollups are cheaper than using an L1 chain, they require more computation power than alternatives like optimistic rollups. Therefore, the fees on ZK rollup networks are slightly higher than some competing L2 solutions. 
  • Difficult to integrate with advanced programs: Due to their extreme technical precision, ZK rollups are less flexible than programs like optimistic rollups. Developers often find it easier to port their Ethereum dApps into optimistic rollup platforms than re-coding their projects to fit a ZK rollup system. 
  • Requires intensive hardware from the ZK processor: Because the hardware requirements to become a ZK processor are high, fewer people join ZK networks than optimistic rollups. The smaller concentration of ZK processors may raise centralization concerns.

Examples of ZK Rollup Projects

ZK rollup technology is still in its beginning phases, but a few projects command attention in this space. When it comes to deciding how to use ZK rollups, traders typically research tokens associated with L2 solutions like: 

  • Polygon: Originally called the Matic Network, Polygon is an L2 scaling solution on Ethereum with a suite of tools for developers. Although Polygon is well-known for its proof-of-stake sidechain, it offers a zkEVM solution to provide the security and speed of ZK rollups throughout Ethereum's ecosystem. 
  • StarkWare: StarkWare Industries is a software company behind two ZK rollup solutions for Ethereum developers: StarkEx and StarkNet. While StarkEx is a permissioned software as a service (SaaS) that helps dApp creators use ZK technology, StarkNet is a permissionless software any dApp developer can use to integrate ZK rollups into their designs
  • Immutable X: Immutable X is an L2 Ethereum scaling solution that uses ZK rollups in blockchain gaming and non-fungible token (NFT) trading. Games such as "Gods Unchained" and "Illuvium" use Immutable X's system to provide the security of Ethereum's decentralized network with faster speeds and lower network fees. 

Eligible Traders Can Enjoy Low-Fee Crypto Swaps on dYdX 

To offer eligible traders superior security and speed, dYdX partnered with StarkWare's StarkEx L2 solution to create a low-fee decentralized crypto trading portal. StarkEx uses ZK rollup technology to significantly reduce gas fees and improve transaction speeds on the Ethereum blockchain. For more details on perpetuals trading with dYdX and our product, check out our blog. Also, head to our Academy to learn more about complex crypto topics, such as pump-and-dump schemes, market makers versus market takers, and slippage.

Eligible traders can start trading on dYdX today!

Legitimacy and Disclaimer

Crypto-assets can be highly volatile and trading crypto-assets involves risk of loss, particularly when using leverage. Investment into crypto-assets may not be regulated and may not be adequate for retail investors. Do your own research and due diligence before engaging in any activity involving crypto-assets.

dYdX is a decentralised, disintermediated and permissionless protocol, and is not available in the U.S. or to U.S. persons as well as in other restricted jurisdictions. The dYdX Foundation does not operate or participate in the operation of any component of the dYdX Chain’s infrastructure.

The dYdX Foundation’s purpose is to support the current implementation and any future implementations of the dYdX protocol and to foster community-driven growth in the dYdX ecosystem.

The dYdX Chain software is open-source software to be used or implemented by any party in accordance with the applicable license. At no time should the dYdX Chain and/or its software or related components be deemed to be a product or service provided or made available in any way by the dYdX Foundation. Interactions with the dYdX Chain software or any implementation thereof are permissionless and disintermediated, subject to the terms of the applicable licenses and code. Users who interact with the dYdX Chain software (or any implementations thereof) will not be interacting with the dYdX Foundation in any way whatsoever. The dYdX Foundation does not make any representations, warranties or covenants in connection with the dYdX Chain software (or any implementations and/or components thereof), including (without limitation) with regard to their technical properties or performance, as well as their actual or potential usefulness or suitability for any particular purpose, and users agree to rely on the dYdX Chain software (or any implementations and/or components thereof) “AS IS, WHERE IS”.

Nothing in this post should be used or considered as legal, financial, tax, or any other advice, nor as an instruction or invitation to act by anyone.  Users should conduct their own research and due diligence before making any decisions. The dYdX Foundation may alter or update any information in this post in the future at its sole discretion and assumes no obligation to publicly disclose any such change. This post is solely based on the information available to the dYdX Foundation at the time it was published and should only be read and taken into consideration at the time it was published and on the basis of the circumstances that surrounded it. The dYdX Foundation makes no guarantees of future performance and is under no obligation to undertake any of the activities contemplated herein.

dYdX is a decentralised, disintermediated and permissionless protocol, and is not available in the U.S. or to U.S. persons as well as in other restricted jurisdictions. The dYdX Foundation does not operate or participate in the operation of any component of the dYdX Chain's infrastructure.

Nothing in this website should be used or considered as legal, financial, tax, or any other advice, nor as an instruction or invitation to act in any way by anyone. You should perform your own research and due diligence before engaging in any activity involving crypto-assets due to high volatility and risks of loss.

Depositing into the MegaVault carries risks. Do your own research and make sure to understand the risks before depositing funds. MegaVault returns are not guaranteed and may fluctuate over time depending on multiple factors. MegaVault returns may be negative and you may lose your entire investment.

The dYdX Foundation does not operate or has control over the MegaVault and has not been involved in the development, deployment and operation of  any component of the dYdX Unlimited software (including the MegaVault).

Crypto-assets can be highly volatile and trading crypto-assets involves risk of loss, particularly when using leverage. Investment into crypto-assets may not be regulated and may not be adequate for retail investors. Do your own research and due diligence before engaging in any activity involving crypto-assets.

Leaving site