ZK Rollup Best Practices: How Teams Ship and Run Them
A ZK rollup works when the proving system, data availability, sequencer and upgrade path are chosen well. Here are the practices experienced teams follow.
On this page
Short answer
A ZK rollup works best when the proving system, data availability layer, sequencer and upgrade path are chosen for what the application actually needs, not copied from another project. Teams that ship safely test under real load, publish proofs on time, keep an escape path for users, and watch prover costs, proof latency and finality from day one.
What is a ZK rollup?
A ZK rollup is a layer 2 network that runs transactions off chain and posts a validity proof to a layer 1 chain, so the layer 1 can check the result without re-running every transaction. The proof, usually a zk-SNARK or zk-STARK, confirms that a whole batch of transactions was executed correctly.
Because the layer 1 only verifies the proof, a ZK rollup can process many more transactions than the base chain at a lower cost per transaction. Users can also withdraw funds as soon as a proof is verified, without waiting through a challenge period. That is the main difference from optimistic rollups, which assume batches are correct unless someone proves otherwise. What is a ZK rollup explains the basic design in more detail.
The design has four parts that decide how well it works: the proving system that creates the proofs, the data availability layer that stores the transaction data, the sequencer that orders transactions, and the upgrade path that lets the team fix bugs. The best practices below cover each part in turn.
How do you choose the proving system?
You choose the proving system by weighing proof size, proving time, verification cost and whether the setup needs trusted parameters, because each choice shapes what your rollup can do cheaply.
SNARK-based systems produce small proofs that are cheap to verify on chain, which suits applications with many small transactions. STARK-based systems need no trusted setup and scale well for large computations, but their proofs are larger and cost more to verify. Some teams use a custom circuit for one job, such as payments, and a general-purpose virtual machine when they want developers to deploy ordinary smart contracts.
| Proving approach | Proof size | Trusted setup | Best fit |
|---|---|---|---|
| zk-SNARK | Small | Often needed | Payments, high-volume apps |
| zk-STARK | Larger | Not needed | Large computations, audits |
| General VM | Varies | Depends on system | Smart contract platforms |
| Custom circuit | Small | Depends on system | One fixed job, done well |
Do not pick a proving system only because another project uses it. Measure proving time and cost on your own workload first, and check how the system handles upgrades to its circuits. ZK rollups vs optimistic rollups compares the two designs side by side.
Where should the transaction data live?
Transaction data should live where users can always check it, because a rollup is only safe if anyone can rebuild its state and prove what happened.
Posting data to the layer 1 as blobs is the safest option: the data is public, permanent and available to anyone who wants to verify the chain. It costs more, so teams with very high volume sometimes use a validium, where data lives off chain with a committee or a dedicated data availability layer. That cuts costs but adds trust: if the data holders go offline, users may not be able to withdraw.
A good middle path is to start with data on the layer 1 and move only after measuring the real cost. Whatever you choose, publish the data availability arrangement in plain terms and test the withdrawal path with data availability offline. If users cannot exit when the data layer fails, the design is not ready.
How do you run the sequencer?
You run the sequencer by starting with one operator, making its behaviour visible, and giving users a way to force their transactions in if it stops working.
Most rollups begin with a single sequencer because it is simpler and faster. That is acceptable early on, as long as the team is honest about it and has a plan to share the role later. The sequencer should publish the order it chose, so anyone can check for unfair reordering. Users also need a forced-inclusion path: a way to submit a transaction directly to the layer 1 contract so it cannot be ignored forever.
Watch sequencer uptime and the time between a transaction being submitted and included. Long delays or unexplained gaps are the first sign of trouble. A decentralised sequencer set, chosen by stake or by rotation, is the long-term goal, but only after the single-operator version is stable and monitored.
How do you handle upgrades safely?
You handle upgrades safely by making them slow, public and reversible, so a bad change can be caught and stopped before it touches user funds.
Put a timelock on every upgrade, long enough for users and auditors to read the change and exit if they disagree. Use a security council with several independent members rather than one key, and require more than one signature to approve a change. Test each upgrade on a testnet that mirrors the main network, including the proving system and the data availability setup.
Audit the circuits and the contracts together, not separately, because most failures sit at the boundary between them. How to implement a ZK rollup covers the build steps that lead up to this point. Keep an upgrade log that anyone can read, with the reason for each change and the test results behind it.
How do you keep proving costs under control?
You keep proving costs under control by batching transactions well, aggregating proofs where possible, and measuring cost per transaction from the first testnet.
Larger batches usually mean lower cost per transaction, but they also mean longer waits before a proof is posted, so pick a batch size that fits how fast your users expect finality. Proof aggregation, where several small proofs are combined into one, can cut verification cost further. Some teams rent prover capacity from a shared market instead of running their own machines, which helps when volume is uneven.
Track three numbers every week: cost per transaction, time from submission to proof, and the share of batches that fail to prove on the first try. ZK rollup cost explains what drives these numbers. If cost per transaction rises while volume is flat, the proving setup needs attention, not more volume.
Example (hypothetical): a payments team launches a ZK rollup
Example (hypothetical): a payments team expects 12,000 transactions a day and wants each one final within an hour. It batches 500 transactions per proof, so it posts 24 proofs a day. Each proof costs the team $4 in prover compute and on-chain verification, so the daily cost is $96, or about $2,880 over a 30-day month.
The team starts with data on the layer 1 and a single sequencer, with a forced-inclusion path through the layer 1 contract. It runs a testnet for six weeks under real load, including a week where the sequencer is stopped on purpose to check that forced inclusion works. Proving cost per transaction comes out at under one cent, which fits the budget.
Before launch, the team sets a 7-day timelock on upgrades and appoints a security council of five members, three of whom must sign. It also writes a runbook for two failures: proofs stopping, and the data layer going offline. Both are practised on the testnet before real funds arrive.
What are the common mistakes?
The most common ZK rollup mistakes are copying another project's design without measuring it, treating data availability as an afterthought, and shipping upgrades without a timelock.
- Copying the stack. A proving system that fits a trading app may be wrong for a payments app. Measure on your own workload.
- Hiding the data layer. If users cannot rebuild the chain state, the rollup is not verifiable, whatever the marketing says.
- One-key upgrades. A single key that can change the contracts is a single point of failure. Use a timelock and several signers.
- No escape path. Users must be able to withdraw even if the sequencer or the operator disappears.
- Ignoring prover cost. Proving is a real operating cost. Budget for it and watch it weekly.
- Skipping load tests. A rollup that works with ten test users can still fail at real volume.
Key takeaways
- Pick the proving system for your workload, not by copying another project
- Keep transaction data somewhere users can always check it
- A single sequencer is fine early on if forced inclusion gives users an escape path
- Slow, public upgrades with a timelock and several signers prevent the worst failures
- Track cost per transaction, proof latency and batch failures every week
Frequently asked questions
Do ZK rollups need a trusted setup?
It depends on the proving system. Some SNARK systems need a one-time trusted setup, while STARK systems do not. If a setup is needed, check that it was run by many independent participants and that the ceremony details are public before you trust the result.
How fast can users withdraw from a ZK rollup?
Users can withdraw as soon as a validity proof covering their transaction is verified on the layer 1, which is usually minutes to an hour. That is faster than optimistic rollups, where withdrawals wait out a challenge period of several days.
What is a validium and how is it different?
A validium is a rollup that keeps transaction data off chain instead of posting it to the layer 1. It costs less, but users must trust the data holders to keep the data available. If the data disappears, users may not be able to prove their balances and withdraw.
Can a ZK rollup run smart contracts?
Yes, if it uses a general-purpose proving system such as a zkEVM. Developers can then deploy ordinary smart contracts. A rollup built on a custom circuit is cheaper for one fixed job but cannot run arbitrary contracts.
What happens if the sequencer stops working?
Users should be able to submit transactions directly to the layer 1 contract through forced inclusion, so the sequencer cannot block them forever. If a rollup has no forced-inclusion path, a stopped sequencer can freeze the whole chain.
How much does it cost to run a ZK rollup?
The main running costs are prover compute and the on-chain cost of posting proofs and data. Both vary with volume, batch size and the data availability choice. Measure cost per transaction on a testnet before promising a price to users.