Noir ZK Proofs: BB Prove to EVM Tutorial

You've compiled your Noir circuit. Now prove it cryptographically and slam it on Ethereum. But at what gas cost? This tutorial reveals the numbers.

Noir's BB Prover Delivers 29ms Proofs—But Can It Conquer EVM Gas Wars? — theAIcatchup

Key Takeaways

  • Barretenberg proves Noir circuits in 29ms for simple checks, generating tiny 7.5KB proofs.
  • EVM-targeted verifiers use precompiles for ~200k gas on L2s—deploy once, verify forever.
  • VK reuse across proofs makes Noir scalable for production ZK apps, but watch memory on big circuits.

Ever wondered why ZK proofs feel like magic—until you clock the real prove time on a toy circuit?

29 milliseconds. That’s it. For a dead-simple Noir check: does private x beat public y?

And here’s the kicker: this isn’t vaporware from some VC deck. It’s Barretenberg—bb prove—chewing through your hello_world.json and spitting a 7.5KB proof, VK, hash, and public inputs. All in under 30ms on 8 threads, sipping just 28MB RAM. Numbers don’t lie; Noir’s stack is blisteringly fast for entry-level ZK.

But let’s pump the brakes. Market dynamics scream caution. ZK circuits balloon fast—think 10x for hashes, 100x for signatures. That 29ms? It’ll spike. Aztec’s bb, born from years of recursion wars, targets ultra_honk scheme for density. Still, skeptics (me included) question if it’s production-ready against gnark or halo2 benchmarks. Early Ethereum tooling echoed this: flashy proofs, hidden scaling traps.

What Happens When You Run ‘bb prove’?

Grab your artifacts from nargo: hello_world.json (ACIR bytecode), hello_world.gz (witness with x=2, y=1).

Fire up bb prove -b ./target/hello_world.json -w ./target/hello_world.gz –write_vk –verifier_target evm -o ./target.

Output floods: Proving key in 29ms. Public inputs (y=1) saved. Proof at 7,488 bytes. VK: 1,888 bytes. Hash: 32 bytes.

Scheme is: ultra_honk, num threads: 8 (mem: 8.10 MiB) CircuitProve: Proving key computed in 29 ms (mem: 24.21 MiB) Public inputs saved to “./target/public_inputs” (mem: 28.56 MiB) Proof saved to “./target/proof” (mem: 28.56 MiB) VK saved to “./target/vk” (mem: 28.56 MiB) VK Hash saved to “./target/vk_hash” (mem: 28.56 MiB)

That’s verbatim from the terminal. No fluff.

Flags matter. -b loads circuit shape. -w injects witness. –verifier_target evm swaps SHA to Keccak (gas saver) and enforces ZK hiding. VK? Circuit fingerprint—gates, wires, types. Reusable across proofs. Prover prepends publics to proof blob; verifier slices ‘em out.

Verification? Trivial.

bb verify -p ./target/proof -k ./target/vk –verifier_target evm.

“Proof verified successfully.” No witness needed. Magic.

This proves: someone knows x ≠ 1, without spilling x=2.

Why Does EVM Targeting Change Everything for ZK Devs?

bb write_solidity_verifier -k ./target/vk –verifier_target evm -o ./target/Verifier.sol.

Bam. 2,449 lines of Solidity. HonkVerifier inherits BaseZKHonkVerifier. Hardcodes VK constants—curve points, circuit size. verify() function leans on EVM precompiles: ecAdd, ecMul, ecPairing, modexp.

Gas? Critical metric. Ultra_honk proofs verify ~200k gas on L2s today—rivals plonk. Ethereum mainnet? 500k+. L2s like Optimism eat it alive.

Deploy via Foundry. forge init verifier-deploy. Copy Verifier.sol. Tweak foundry.toml for file reads.

DeployScript.s.sol: new HonkVerifier(). Address logged.

VerifyScript.s.sol: read proof binary, pack publicInputs[0] = bytes32(1). Call verify(). Logs true.

On-chain reality check: first deploy ~2M gas (big VK). Reuse? Pure verify flies at 200k. That’s deploy-once, verify-forever economics. Noir nails it.

But my unique angle—and it’s sharp: this mirrors 2016’s early ECDSA libs. Fast local, chain explodes costs. Aztec spins bb as ‘production’—hype? Memory at 28MB hints recursion limits. Real apps (privacy txs) hit GBs. Prediction: Noir dominates dev tools by 2025 if bb solos 1M-gate proves under 1s.

Skeptical? Fair. Gnark’s Go speed crushes CLI awkwardness. Halo2? Rust purity. Yet bb’s EVM glue—Keccak, precompiles—tilts for web3.

Look.

ZK market’s $1B+ now. Protocols like Scroll, zkSync burn millions on proofs. Noir’s OSS stack (nargo + bb) undercuts paid services 10x. If adoption spikes—devs flock.

One para deep-dive: VK reuse slashes deploys. Same circuit, infinite proofs. Rollup sequencers dream of this. Publics dynamic: append y=1, proof claims x≠y. Hides x eternally.

Corporate spin? Aztec’s docs gloss memory creeps. Test it: scale to MiMC hash. Prove time 10x. Still beats Circom’s 5s.

And on-chain.

Foundry broadcasts: deploy, verify. Gas logs tell truth— no simulations lie.

Can Noir’s Barretenberg Stack Outpace Rivals in Prod?

Facts: 7.5KB proofs. Tiny. Ultra_honk packs gates tight.

Market bet: L2s (Base, Arbitrum) standardize honk verifiers? Possible. EVM precompiles lock in winners.

Drawback—CLI only. No JS SDK yet. Dev UX lags.

Wander here: imagine bundling with Hardhat. One command: noir prove && deploy.

It’ll happen.

Proof size static-ish. Scale gates 2x, proof ~1.2x. Predictable.

Editorial stance: Bullish short-term. Bearish if recursion flops. Unique insight—bb’s 8-thread parallelism foreshadows GPU ports. Nvidia ZK boom incoming.

Short.

Deployed.

Verified.

Noir works.

**


🧬 Related Insights

Frequently Asked Questions**

How do I generate a ZK proof with Barretenberg?

Run bb prove -b circuit.json -w witness.gz –write_vk –verifier_target evm -o target/. Needs Prover.toml inputs set.

What is a verification key in Noir ZK proofs?

VK encodes circuit structure—gates, types. Reusable for any valid proof. Generated with –write_vk; used in verify and Solidity.

Can I verify Noir proofs on Ethereum mainnet?

Yes. bb write_solidity_verifier spits EVM-compatible HonkVerifier. ~500k gas first verify; reuse slashes it. Works on L2s too.

Marcus Rivera
Written by

Tech journalist covering AI business and enterprise adoption. 10 years in B2B media.

Frequently asked questions

How do I generate a ZK proof with Barretenberg?
Run bb prove -b circuit.json -w witness.gz --write_vk --verifier_target evm -o target/. Needs Prover.toml inputs set.
What is a verification key in <a href="/tag/noir-zk/">Noir ZK</a> proofs?
VK encodes circuit structure—gates, types. Reusable for any valid proof. Generated with --write_vk; used in verify and Solidity.
Can I verify Noir proofs on Ethereum mainnet?
Yes. bb write_solidity_verifier spits EVM-compatible HonkVerifier. ~500k gas first verify; reuse slashes it. Works on L2s too.

Worth sharing?

Get the best AI stories of the week in your inbox — no noise, no spam.

Originally reported by Dev.to

Stay in the loop

The week's most important stories from theAIcatchup, delivered once a week.