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!
The content of this article (the “Article”) is provided for general informational purposes only. Reference to any specific strategy, technique, product, service, or entity does not constitute an endorsement or recommendation by dYdX Trading Inc., or any affiliate, agent, or representative thereof (“dYdX”). Use of strategies, techniques, products or services referenced in this Article may involve material risks, including the risk of financial losses arising from the volatility, operational loss, or nonconsensual liquidation of digital assets. The content of this Article does not constitute, and should not be considered, construed, or relied upon as, financial advice, legal advice, tax advice, investment advice, or advice of any other nature; and the content of this Article is not an offer, solicitation or call to action to make any investment, or purchase any crypto asset, of any kind. dYdX makes no representation, assurance or guarantee as to the accuracy, completeness, timeliness, suitability, or validity of any information in this Article or any third-party website that may be linked to it. You are solely responsible for conducting independent research, performing due diligence, and/or seeking advice from a professional advisor prior to taking any financial, tax, legal, or investment action.
Any applicable sponsorship in connection with this Article will be disclosed, and any reference to a sponsor in this Article is for disclosure purposes, or informational in nature, and in any event is not a call to action to make an investment, acquire a service or product, or purchase crypto assets. This Article does not offer the purchase or sale of any financial instruments or related services.
By accessing this Article and taking any action in connection with the information contained in this Article, you agree that dYdX is not responsible, directly or indirectly, for any errors, omissions, or delays related to this Article, or any damage, injury, or loss incurred in connection with use of or reliance on the content of this Article, including any specific strategy, technique, product, service, or entity that may be referenced in the Article.