Book a free call

How Much Does It Cost to Build on an Optimistic Rollup?

Building on an optimistic rollup costs far less than the main chain, but the audit and running costs still dominate. Here is what each part costs.

Hertiv engineering teamReviewed by a senior engineer
6 min read
How Much Does It Cost to Build on an Optimistic Rollup?
On this page

Short answer

Building on an optimistic rollup usually costs a few tens of thousands of dollars in the first year, with the security audit taking the largest share. Deployment fees are small, transaction fees are a few cents each, and monthly infrastructure is modest for a small app.

What is an optimistic rollup?

An optimistic rollup is a layer 2 network that runs transactions off the Ethereum main chain and posts the results back to it, assuming the results are correct unless someone proves otherwise. It is called optimistic because it accepts batches of transactions as valid by default and only runs a fraud check when a challenger disputes a result.

The design keeps the security of the main chain while moving most of the work off it. Users pay far lower fees than on the main chain, and builders get more room for each transaction. The trade-off is a challenge window, usually around seven days, during which withdrawals back to the main chain wait for disputes to close.

Optimistic rollups suit applications that need many transactions at a low cost, such as games, marketplaces and payment flows. They are less suited to use cases that need instant final settlement on the main chain. If you are new to the idea, start with what an optimistic rollup is before pricing a build.

What are the cost components of building on an optimistic rollup?

Building on an optimistic rollup has five cost components: writing and deploying the contracts, auditing them, running the off-chain parts of the app, paying transaction fees for users, and keeping the system running. The first two are one-off costs, the last three repeat every month.

Cost componentWhen you payWhat drives it
Contract developmentOnceNumber and complexity of contracts
Security auditOnce, plus re-checksCode size and risk of the contracts
Deployment feesOnce per deployContract size and main-chain gas price
Transaction feesOngoingTransactions per day and data posted
Hosting and monitoringMonthlyNodes, indexers and alerting

The biggest surprise for most teams is that the contracts are only part of the bill. The off-chain app, the data the rollup posts to the main chain, and the audit often cost as much as the contracts themselves. Budget for all five lines, not just the code.

How much does deployment cost?

Deployment is usually the smallest line in the budget. Publishing a contract on an optimistic rollup costs a fraction of what the same deploy costs on the main chain, because the rollup charges far less for the same storage and computation. A small set of contracts typically deploys for a few tens of dollars in fees.

The fee depends on the size of the contract bytecode and the gas price at the moment you deploy. Larger contracts cost more, so teams that keep their contracts small and split logic across a few contracts pay less. You also pay again each time you redeploy after a fix, so budget for two or three deploys rather than one.

Some teams also pay a one-off fee to register their contracts with a bridge or to set up a token on the rollup. These are small compared with development and audit costs, but they belong in the budget all the same.

What does an audit cost?

An audit is usually the largest single cost after development. A professional audit of a small set of contracts takes a team of auditors one to three weeks, and the price reflects that specialist time. Simple token or marketplace contracts sit at the low end; contracts that hold user funds or use new logic sit at the high end.

The audit price depends on how much code there is, how novel the logic is, and how much the auditors need to test. A contract that copies a well-tested pattern costs less to review than one that invents a new mechanism. Every fix the auditors find also needs a re-check, and that re-check is usually billed separately.

Skipping the audit saves money up front and risks far more later, because a bug in a live contract can lock or drain funds. A comparison with ZK rollups is worth reading if you are still choosing a layer 2, since the audit scope differs between the two designs.

What are the ongoing costs?

Ongoing costs come from three places: the fees your users pay per transaction, the infrastructure that keeps your app running, and the work of keeping contracts and data in sync. Transaction fees on an optimistic rollup are a small fraction of main-chain fees, often a few cents or less, because most of the work happens off the main chain.

The rollup still posts transaction data to the main chain, and that data posting is the main variable cost. When main-chain gas prices rise, the cost of posting data rises with them, and the rollup passes that cost on to users. Apps with many small transactions feel this more than apps with a few large ones.

Infrastructure costs cover the node or RPC service, the indexer that reads chain data for your app, and monitoring and alerts. A small app can run on shared services for a modest monthly fee. A larger app that needs its own node and fast indexing pays more, and it also needs someone on call when the chain or the indexer stops.

Example (hypothetical): a small NFT marketplace budget

Example (hypothetical): a team builds a small NFT marketplace on an optimistic rollup. It has three contracts: a marketplace, a royalty splitter and a token. Development takes one developer eight weeks at 40 hours a week, which is 320 hours. At a planning rate of 60 dollars an hour, that is 19,200 dollars.

The audit takes two auditors two weeks and costs 25,000 dollars, with a 5,000 dollar re-check after fixes. Deployment costs 40 dollars in fees. The team runs a shared node and indexer for 150 dollars a month, which is 1,800 dollars a year.

The first-year total is 19,200 + 25,000 + 5,000 + 40 + 1,800 = 51,040 dollars. The audit is almost half the budget, which is normal for a small build. Transaction fees are paid by users on top, at a few cents each, so the team also plans a small subsidy of 500 dollars a month for the first three months, which is 1,500 dollars.

What are the common mistakes?

The first mistake is budgeting only for development and forgetting the audit, the re-check and the monthly infrastructure. The second is assuming transaction fees stay flat: when the main chain gets busy, the cost of posting rollup data rises, and apps that subsidise user fees feel it first.

The third mistake is treating the seven-day challenge window as a detail. If your app lets users withdraw funds, they wait for that window to close, and your support team needs to explain the delay clearly. The fourth mistake is deploying contracts that were written for the main chain without checking how they behave on a rollup, where gas costs and timing differ.

Finally, some teams pick a rollup for its low fees and then build a design that posts a lot of data to the main chain, which wipes out the saving. Keep the data you post small, batch where you can, and measure the real fee per transaction before you promise users a price.

Key takeaways

  • An optimistic rollup assumes transactions are valid unless a challenger proves otherwise.
  • The audit is usually the largest cost after development, often close to half the first-year budget.
  • Deployment fees are small, but you pay again for every redeploy after a fix.
  • Ongoing costs come from data posted to the main chain, hosting and monitoring.
  • The seven-day challenge window affects withdrawals and needs clear user messaging.

Frequently asked questions

How is an optimistic rollup different from a ZK rollup?

An optimistic rollup assumes transactions are valid and relies on fraud proofs when someone disputes a result, while a ZK rollup posts a validity proof with every batch. Optimistic rollups are usually cheaper to build on, and ZK rollups settle faster.

How long do withdrawals take from an optimistic rollup?

Withdrawals back to the main chain usually wait about seven days, which is the challenge window for fraud proofs. Some bridges offer faster exits for a fee, but the standard route waits for the window to close.

Do I need to audit a simple token contract?

Yes, if the contract handles user funds or real value. Even simple contracts can hide a bug that locks funds, and an audit is the cheapest way to find it before users do.

What makes transaction fees rise on a rollup?

The main driver is the cost of posting transaction data to the main chain, which rises when main-chain gas prices rise. Apps that post a lot of data per transaction feel this most.

Can I move a main-chain contract to a rollup unchanged?

Often yes, because most optimistic rollups run the same contract language as the main chain. You still need to test gas costs, timing and any main-chain assumptions the contract makes.

What should I budget for the first year?

Plan for development, an audit plus a re-check, a few deploys, and monthly infrastructure. For a small app, the first-year total often lands in the tens of thousands of dollars.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: blockchain systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Planning a rollup deployment?

A senior engineer replies within one business day. Or see our Blockchain Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call