Advanced Topics
What Are Rollups in Blockchain?
Learn what rollups are, how optimistic and zero-knowledge rollups work, and why they matter for scaling Ethereum and reducing gas fees in DeFi.
Explore zero-knowledge proofs (ZKPs): how they work, their role in blockchain scaling through ZK-rollups, privacy applications, and why they matter for the future of DeFi.
A zero-knowledge proof (ZKP) is a cryptographic protocol that allows one party — the prover — to convince another party — the verifier — that a statement is true without revealing any information about why it is true. The concept was first formalized by Goldwasser, Micali, and Rackoff in 1985, but it has found its most transformative applications in blockchain technology over the past decade.
In the context of crypto, zero-knowledge proofs solve two critical challenges simultaneously: scalability (processing more transactions at lower cost) and privacy (proving things without exposing underlying data). These properties make ZKPs one of the most important cryptographic primitives in modern DeFi.
Imagine a cave with two paths that meet at a locked door deep inside. Alice wants to prove to Bob that she knows the secret to unlock the door — without revealing the secret itself.
Bob waits at the entrance while Alice enters through a random path. Bob then shouts which path he wants Alice to emerge from. If Alice knows the secret, she can always come out the correct side (unlocking the door if needed). If she does not know the secret, she has only a 50% chance of emerging correctly. After 20 rounds, the probability of faking it drops to less than one in a million.
Alice has proven knowledge of the secret. Bob has learned nothing about the secret itself. This is a zero-knowledge proof.
Every zero-knowledge proof must satisfy three properties:
Interactive ZKPs require multiple rounds of communication between prover and verifier (like the cave analogy). Non-interactive ZKPs use a single message from prover to verifier, making them practical for blockchain applications where you cannot have a back-and-forth dialogue on-chain. The Fiat-Shamir heuristic converts interactive proofs into non-interactive ones by replacing the verifier's random challenges with a hash function.
Succinct Non-interactive Arguments of Knowledge (zk-SNARKs) are the most widely deployed ZKP system in blockchain:
The main drawback is the trusted setup — an initial ceremony that generates public parameters. If the secret randomness from this ceremony is not properly destroyed, it could be used to forge proofs. Multi-party computation (MPC) ceremonies involving hundreds of participants mitigate this risk: as long as one participant is honest, the setup is secure.
zk-SNARKs are used by Zcash, many ZK-rollups, and various DeFi privacy protocols.
Scalable Transparent Arguments of Knowledge (zk-STARKs), developed by Eli Ben-Sasson and StarkWare, offer different tradeoffs:
StarkNet and StarkEx use zk-STARKs for their ZK-rollup infrastructure.
The field evolves rapidly, with newer systems offering improved tradeoffs:
ZK-rollups are the most impactful application of zero-knowledge proofs in blockchain today. They work by:
This achieves dramatic throughput improvements. Instead of Ethereum processing 15–30 transactions per second, ZK-rollups can process thousands — with the L1 only needing to verify a single compact proof per batch.
Both are Layer 2 scaling solutions, but they differ fundamentally:
| Aspect | ZK-Rollups | Optimistic Rollups |
|---|---|---|
| Validity model | Proofs guarantee correctness | Fraud proofs challenge incorrect states |
| Withdrawal time | Minutes (once proof is verified) | 7+ days (challenge window) |
| Computation cost | Expensive proof generation | Cheaper computation, expensive disputes |
| EVM compatibility | Historically difficult, improving | Native EVM compatibility |
| Data availability | Compressed calldata or blobs | Full transaction data on L1 |
ZK-rollups offer faster finality and stronger security guarantees, while optimistic rollups have historically been easier to build with full EVM compatibility. This gap is closing rapidly as ZK-EVM technology matures.
These rollups are increasingly relevant for DeFi applications. Lower gas fees on ZK-rollups make lending and borrowing operations more accessible, and platforms like Borrow may integrate with these networks to offer users cheaper transactions when managing their collateralized positions.
ZKPs can prove that a transaction is valid — inputs equal outputs, no negative values, no double-spending — without revealing the amounts or addresses involved. This is how Zcash's shielded transactions work, and protocols like Aztec bring similar privacy to Ethereum.
Privacy in DeFi goes beyond simple transfers. ZKPs can enable:
ZKPs are transforming how identity verification works in crypto:
This technology could eventually enable undercollateralized lending in DeFi — a borrower could prove their creditworthiness through ZK-verified off-chain data without compromising privacy. For lending aggregators like Borrow, this opens the possibility of expanded loan options beyond the current overcollateralized model.
To prove a computation using ZKPs, the computation must first be expressed as an arithmetic circuit — a series of addition and multiplication gates over a finite field. Any program can theoretically be converted to an arithmetic circuit, though the conversion can be complex.
The circuit is transformed into a Rank-1 Constraint System (R1CS) — a set of equations that the valid computation must satisfy. This is then converted to a Quadratic Arithmetic Program (QAP), which allows the proof to be checked by evaluating polynomials at a secret point. The polynomial identity testing is what gives zk-SNARKs their succinctness.
The prover generates the proof by performing cryptographic operations (elliptic curve pairings for SNARKs, hash-based commitments for STARKs) that demonstrate knowledge of a valid witness — the secret input that satisfies all constraints.
Verification involves checking a small number of pairings or hash evaluations, which is computationally cheap. This asymmetry — expensive proving, cheap verification — is what makes ZKPs practical for blockchain: the L1 only needs to do the cheap verification step.
Zero-knowledge proofs can enable trustless cross-chain bridging. Instead of relying on multisig validators or optimistic fraud proofs, a ZK bridge proves that a transaction occurred on the source chain by verifying the source chain's consensus and state transitions cryptographically. Projects like Succinct, Polymer, and zkBridge are pursuing this approach.
ZK coprocessors allow smart contracts to verifiably access historical blockchain data and perform complex computations off-chain, posting only the proof on-chain. This enables on-chain applications that are orders of magnitude more data-rich and computationally complex than is currently feasible.
Recursive ZK proofs — proofs that verify other proofs — enable massive scalability. A proof of 1,000 transactions can be combined with another proof of 1,000 transactions into a single proof, which can then be combined again, and so on. This recursive composition is the foundation for future scaling architectures that could process millions of transactions per second.
ZK proof generation is computationally intensive, creating demand for specialized hardware:
As hardware improves, the cost and latency of ZK proof generation will decrease, making ZK-rollups even more competitive with optimistic rollups and L1 execution.
Zero-knowledge proofs are a foundational cryptographic technology reshaping how blockchains handle scalability and privacy. Through ZK-rollups, they enable dramatic throughput improvements while maintaining L1 security guarantees. Through privacy applications, they enable confidential transactions and selective disclosure without sacrificing verifiability.
For DeFi users, ZK technology translates to lower costs, faster finality, and new possibilities like privacy-preserving lending and trustless cross-chain operations. As the technology matures, platforms like Borrow stand to benefit from deploying on ZK-rollups that offer cheaper transactions for collateral management, liquidation monitoring, and cross-protocol operations.
Common Questions
A zero-knowledge proof is a cryptographic method by which one party (the prover) can demonstrate to another party (the verifier) that a statement is true without revealing any information beyond the truth of the statement itself. In blockchain, ZKPs enable transaction validation without exposing underlying data, supporting both privacy and scalability.
Related Questions
Advanced Topics
Learn what rollups are, how optimistic and zero-knowledge rollups work, and why they matter for scaling Ethereum and reducing gas fees in DeFi.
DeFi Basics
Learn what smart contracts are, how they work on blockchain networks, and why they are the foundation of DeFi applications like lending protocols and decentralized exchanges.
Advanced Topics
Learn what flash loans are, how they work within a single transaction, their legitimate use cases like arbitrage and collateral swaps, and the risks of flash loan attacks in DeFi.
Advanced Topics
Learn what smart contract audits are, how they work, what auditors look for, and why they matter for DeFi security and protecting your crypto assets.