Book a free call

How Much Does It Cost to Build on Layer 2?

Building on layer 2 costs far less per transaction than the main chain, but the budget still depends on the rollup type, the audit and the traffic you expect.

Hertiv engineering teamReviewed by a senior engineer
5 min read
How Much Does It Cost to Build on Layer 2?
On this page

Short answer

Layer 2 is a system that runs transactions off the main blockchain and posts a compressed record back to it, so users pay a fraction of main-chain fees. Building on layer 2 typically costs far less to operate than building directly on the main chain, but the budget depends on the rollup type, smart contract audits, bridging and the traffic you expect.

What is layer 2?

Layer 2 is a system that runs transactions off the main blockchain, usually Ethereum, and posts a compressed record of them back to the main chain. Users get lower fees and faster confirmation, while the main chain still provides the security.

The main types are optimistic rollups, which assume transactions are valid unless challenged, and zero-knowledge rollups, which post a proof that the transactions are valid. Sidechains and validiums sit nearby but settle security differently, so they are cheaper and less anchored to the main chain.

For a builder, the choice is practical: what fees will your users pay, how fast must transactions confirm, and how much does the audit cost? The answers decide which layer 2 fits and what the budget looks like. If the basics are new, what layer 2 is explains the model in full.

Layer 2 does not change what your app does, only where the transactions run. The user still signs with the same wallet and sees the same interface, while the app routes the transaction to the rollup instead of the main chain. That is why most teams can move an existing app to layer 2 without redesigning it.

Which layer 2 fits your budget?

Each layer 2 type trades fees, security and control differently. Pick the type that fits your use case before writing any contracts.

TypeFee per transactionBest forTrade-off
Optimistic rollupLowGeneral apps, DeFiWithdrawals take days
ZK rollupLowPayments, high volumeHigher audit cost
SidechainVery lowGames, social appsWeaker main-chain security
ValidiumVery lowHigh-volume data appsData kept off chain
App chainVariesOne product, full controlYou run the chain

Optimistic rollups suit most general apps, while ZK rollups suit payments and high-volume flows where the proof is worth the audit cost. Games and social apps often pick a sidechain for the lowest fees, accepting weaker main-chain security.

What does a layer 2 build cost?

Budget for the build, the audit and the running costs together. Teams that price only the build run out of money at the audit.

ItemPlanning rangeNotes
Smart contract development$20,000-$80,000Depends on scope
Audit$15,000-$50,000One or two rounds
Deployment and bridging$100-$2,000Gas and bridge fees
Indexer and node$200-$1,000 a monthData and uptime
Ongoing gas and fees$50-$500 a monthDepends on volume

These are planning ranges for a small to mid-size app. A simple token or marketplace sits at the low end, while a DeFi protocol with several contracts sits at the high end.

Audit quotes vary by firm and by code size, so get two quotes before choosing: a quote that looks cheap may exclude the re-check, while a higher quote may include it. For a rollup-specific view, optimistic rollup costs breaks down the same budget for one rollup type.

What pushes layer 2 costs up or down?

Contract complexity is the biggest driver. Each extra contract adds development and audit time, and audits are priced by code size and risk. A single well-tested contract costs far less to audit than five interlinked ones.

Traffic matters too. Low volume keeps gas and indexer costs small, while high volume raises both. Some teams start on a test network and a low-cost rollup, then move to a larger chain once usage justifies the audit spend.

Bridging is easy to forget. Moving assets between the main chain and layer 2 costs gas on the main chain, and that fee is paid per bridge transaction, not per user action. A chain-specific example is Polygon costs, where bridging fees are a visible part of the budget.

Testnet work is free in gas terms, but it still costs time. A team that skips testnet testing pays for the same bugs on mainnet, where every fix costs gas and a new deployment. Budget a full week of testnet runs for a small app, and two weeks if the contracts interact with other protocols.

A five-step plan to control layer 2 costs

Cost control starts before any code is written. The cheapest audit is the one you never need because the design stayed small.

  1. Pick the rollup type before writing contracts. Changing chains mid-build means rewriting and re-auditing.
  2. Keep the contract set small and reuse audited patterns where you can.
  3. Budget for two audit rounds, not one. Fixes always need a re-check.
  4. Test on a test network until the flow is stable. Mainnet fixes cost real gas.
  5. Track gas and indexer spend weekly for the first month. Small leaks show up fast.

Write the budget down before the build starts and review it at each milestone. If the audit quote comes back higher than planned, cut scope before cutting the audit.

Example (hypothetical): an NFT marketplace budget

Example (hypothetical): a team builds a small NFT marketplace on an optimistic rollup. Development of three contracts takes 8 weeks at $5,000 a week, or $40,000. One audit round costs $25,000, and a re-check after fixes costs $5,000. Deployment and bridging cost $150, and the indexer costs $300 a month.

The first-year total is $40,000 + $25,000 + $5,000 + $150 + (12 x $300) = $73,750. If the team adds a second chain, the audit and deployment repeat, so the budget grows by roughly the same audit cost again. That is why most small teams launch on one chain first.

What are the common mistakes?

Most layer 2 budgets fail on the audit and the bridge, not on the build. The contracts get written on time and the money runs out at the checks.

  • Choosing the chain before the use case. Fees and security needs decide the chain, not the other way round.
  • Budgeting one audit round. Fixes always need a re-check, so budget for two.
  • Ignoring bridge fees. Moving assets to layer 2 costs main-chain gas every time.
  • No monitoring of gas spend. A small leak in a hot contract adds up over a month.
  • Launching on mainnet before testnet is stable. Testnet fixes are free; mainnet fixes are not.

For the wider build, Ethereum development covers the main-chain side.

Polygon development covers one of the most used layer 2 ecosystems.

Key takeaways

  • Layer 2 moves transactions off the main chain and posts a compressed record back
  • Optimistic rollups suit most apps; ZK rollups suit payments and high volume
  • Budget for the build, two audit rounds and running costs together
  • Bridge fees and gas monitoring are the costs teams forget most often
  • Launch on one chain first; adding a second chain repeats the audit cost

Frequently asked questions

What is the cheapest layer 2 to build on?

There is no single cheapest layer 2, because fees depend on the rollup type, the contract set and the traffic. Sidechains and validiums usually have the lowest fees, optimistic and ZK rollups sit above them, and app chains vary. Pick by use case first, then compare the fees for your expected volume.

How much does a layer 2 audit cost?

A single audit round for a small contract set usually falls in a $15,000 to $50,000 planning range, and a re-check after fixes adds more. Audits are priced by code size and risk, so a small contract set with reused patterns costs far less than several interlinked contracts.

Do users still pay gas on layer 2?

Yes, but far less than on the main chain. Users pay a small layer 2 fee per transaction, and bridging assets to layer 2 costs main-chain gas. The exact fee depends on the rollup and on traffic, so check the chain's fee page before promising users a number.

Can I move my app from one layer 2 to another?

Yes, but it is a real migration: contracts may need changes, the audit repeats, and users must bridge assets to the new chain. That is why most small teams pick one chain, launch there, and only add a second chain once usage justifies the extra audit cost.

Is layer 2 as safe as the main chain?

Optimistic and ZK rollups inherit most of the main chain's security, because the record is posted back to it. Sidechains and validiums are cheaper but rely on their own validators or off-chain data, so they carry more risk. Read the chain's security model before choosing.

How long does a layer 2 build take?

A small app with a few contracts can take a few weeks to a few months, including testing and one audit round. The audit queue and the re-check after fixes often take longer than the build itself, so start the audit conversation early.

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

Building on layer 2 and need the contracts and audit planned? Talk to Hertiv.

A senior engineer replies within one business day. Or see our Ethereum 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