Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/web-starter-playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install Nargo
uses: noir-lang/[email protected]
with:
toolchain: 1.0.0-beta.11
toolchain: 1.0.0-beta.15

- name: Install bb
run: |
Expand Down
21 changes: 10 additions & 11 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ forge script script/Deploy.s.sol:DeployScript --rpc-url <RPC_URL> --broadcast --
- `base64_example/` - Base64 encoding/decoding using `noir-base64` library
- Uses workspace structure with shared Nargo.toml

- **`stealthdrop/`** - Complex example using ecrecover, Merkle trees, and PLUME signatures
- Demonstrates integration of multiple cryptographic libraries
- Uses `noir_bigcurve`, `ecrecover`, and custom merkle tree implementations

- **`noir_by_example/`** - Small focused examples of Noir language features
- `loops/` - Loop constructs in Noir
- `generic_traits/` - Generic types and traits
Expand All @@ -133,7 +129,7 @@ fn main(private_input: Field, public_output: pub Field) {

### JavaScript Proof Generation Pattern

Common pattern across examples using `@noir-lang/noir_js` and `@aztec/bb.js`:
Common pattern across examples using `@noir-lang/noir_js` (v1.0.0-beta.15) and `@aztec/bb.js` (v3.0.0-nightly.20251104):
1. Import compiled circuit artifacts from `target/` directory
2. Initialize Noir program with artifacts
3. Generate witness from inputs
Expand All @@ -149,14 +145,17 @@ Common pattern across examples using `@noir-lang/noir_js` and `@aztec/bb.js`:

## Version Compatibility

Different examples may use different Noir/bb versions:
- `solidity-example/`: Noir 1.0.0-beta.11, bb 0.87.0
- `recursion/`: Noir 1.0.0-beta.6, bb 0.84.0
- `web-starter/`: Noir 1.0.0-beta.11, bb 0.87.0
- `bignum_example/`: Noir 1.0.0-beta.9+
**Recent Updates (November 2025):**
- All main examples updated to Noir 1.0.0-beta.15 and bb.js 3.0.0-nightly.20251104
- The `stealthdrop/` example has been removed from the repository

Current version information:
- `solidity-example/`: Noir 1.0.0-beta.15, bb.js 3.0.0-nightly.20251104
- `recursion/`: Noir 1.0.0-beta.15, bb.js 3.0.0-nightly.20251104
- `web-starter/`: Noir 1.0.0-beta.15, bb.js 3.0.0-nightly.20251104
- `bignum_example/`: Noir 1.0.0+ (>=1.0.0)
- `lib_examples/base64_example/`: Noir 0.36.0+
- `noir_by_example/`: Noir 0.34.0+ (varies by example)
- `stealthdrop/`: Noir 1.0.0-beta.1, bb 0.67.0

Check each project's README for specific version requirements. Version mismatches between nargo and bb can cause compilation or proof generation issues.

Expand Down
2 changes: 1 addition & 1 deletion web-starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A simple Noir circuit with browser proving with bb.js
Has both webpack and vite bundling.

Tested with Noir 1.0.0-beta.11 and bb 0.87.0
Tested with Noir 1.0.0-beta.15 and bb 3.0.0-nightly.20251104

## Setup

Expand Down
2 changes: 1 addition & 1 deletion web-starter/circuits/target/noir_uh_starter.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"noir_version":"1.0.0-beta.11+fd3925aaaeb76c76319f44590d135498ef41ea6c","hash":"11550909604998811057","abi":{"parameters":[{"name":"x","type":{"kind":"field"},"visibility":"private"},{"name":"y","type":{"kind":"field"},"visibility":"public"}],"return_type":null,"error_types":{}},"bytecode":"H4sIAAAAAAAA/62QQQqAMAwErfigpEna5OZXLKb/f4KoFUrxpgPL7mkOG6ab0DIyt15bwzfijy4MnYsgMXuOjoQbRCsqwFKSoqKo7FGJXFmzFctgyORYxcjrhZ6upftiGvbbNw8HOny0w0QBAAA=","debug_symbols":"nZBNCoMwEIXvMussLK1YvUopEuMogSEJY1Io4t07ira66MbV/Lz53sAbocUm9bV1nR+geozQsCWyfU3e6Gi9k+04KdjGOjKirGCnCxU0o4tQuUSk4KUpLUdD0G6pUbOomQJ0rVQx7Czh3E3qR2f/0Vu5svntC+cn6PsJurisdFEe6KdM2lg+ZAUZVNdpNmOrG8I1vy45s4szvsOmbIEH9gbbxDjbLZo8+AA=","file_map":{"50":{"source":"\nfn main(x: Field, y: pub Field) {\n let res = x * 2 + y;\n assert(res == 9);\n}\n","path":"/home/josh/Documents/Github/noir-examples/web-starter/circuits/src/main.nr"}},"names":["main"],"brillig_names":[]}
{"noir_version":"1.0.0-beta.15+83245db91dcf63420ef4bcbbd85b98f397fee663","hash":"13597520350741267546","abi":{"parameters":[{"name":"x","type":{"kind":"field"},"visibility":"private"},{"name":"y","type":{"kind":"field"},"visibility":"public"}],"return_type":null,"error_types":{}},"bytecode":"H4sIAAAAAAAA/5XOoQ5AUBjF8e/ceRCRxjyC2SQTFcGmCMw08T6CeQFPYTzObZpk0y6bG+4Q+JdfOeGArgxlmRUVTkHPmNKkT7EfW0DbOnnUCHewpzgYOU9Sy1vCdq47X2z9KuWuf8PNtw6uNGV55AAAAA==","debug_symbols":"nZBNCoMwEIXvMussLK1YvUopEuMogSEJY1Io4t07ira66MbV/Lz53sAbocUm9bV1nR+geozQsCWyfU3e6Gi9k+04KdjGOjKirGCnCxU0o4tQuUSk4KUpLUdD0G6pUbOomQJ0rVQx7Czh3E3qR2f/0Vu5svntC+cn6PsJurisdFEe6KdM2lg+ZAUZVNdpNmOrG8I1vy45s4szvsOmbIEH9gbbxDjbLZo8+AA=","file_map":{"50":{"source":"\nfn main(x: Field, y: pub Field) {\n let res = x * 2 + y;\n assert(res == 9);\n}\n","path":"/home/josh/Documents/Github/noir-examples/web-starter/circuits/src/main.nr"}},"expression_width":{"Bounded":{"width":4}}}
Binary file modified web-starter/circuits/target/vk
Binary file not shown.
2 changes: 1 addition & 1 deletion web-starter/web/nextjs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A simple Noir circuit with browser proving with bb.js
This is a Next.js version, similar to the vite and webpack examples.

Tested with Noir 1.0.0-beta.11, bb 0.87.0, and Next.js 15.
Tested with Noir 1.0.0-beta.15, bb 3.0.0-nightly.20251104, and Next.js 15.

## Setup

Expand Down
4 changes: 2 additions & 2 deletions web-starter/web/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "nextjs-noir",
"type": "module",
"dependencies": {
"@aztec/bb.js": "0.87.0",
"@noir-lang/noir_js": "1.0.0-beta.11",
"@aztec/bb.js": "3.0.0-nightly.20251104",
"@noir-lang/noir_js": "1.0.0-beta.15",
"next": "^15.3.4",
"react": "18.2.0",
"react-dom": "18.2.0"
Expand Down
30 changes: 15 additions & 15 deletions web-starter/web/nextjs/pages/api/verify.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { NextApiRequest, NextApiResponse } from 'next';
import { UltraHonkBackend, BarretenbergVerifier } from '@aztec/bb.js';
import { UltraHonkBackend } from '@aztec/bb.js';
import { promises as fs } from 'fs';
import path from 'path';

Expand All @@ -12,7 +12,7 @@ async function initializeCircuit() {
const circuitPath = path.resolve(process.cwd(), '../../circuits/target/noir_uh_starter.json');
const circuitData = await fs.readFile(circuitPath, 'utf-8');
circuit = JSON.parse(circuitData);
honk = new UltraHonkBackend(circuit.bytecode, {
honk = new UltraHonkBackend(circuit.bytecode, {
threads: 8,

// By default, bb.js downloads CRS files to ~/.bb-crs. For serverless environments where
Expand All @@ -36,11 +36,11 @@ export default async function handler(
await initializeCircuit();

const { proof, publicInputs } = req.body;

if (!proof || !publicInputs) {
return res.status(400).json({
return res.status(400).json({
error: 'Missing proof or publicInputs',
verified: false
verified: false
});
}

Expand All @@ -61,23 +61,23 @@ export default async function handler(
} else {
throw new Error('Invalid proof format');
}

const publicInputsArray = Array.isArray(publicInputs) ? publicInputs : [publicInputs];
const verified = await honk.verifyProof({
proof: proofArray,
publicInputs: publicInputsArray

const verified = await honk.verifyProof({
proof: proofArray,
publicInputs: publicInputsArray
});
return res.status(200).json({

return res.status(200).json({
verified,
message: verified ? 'Proof verified successfully' : 'Proof verification failed'
});
} catch (error) {
console.error('Server-side verification error:', error);
return res.status(500).json({
error: String(error),
verified: false
return res.status(500).json({
error: String(error),
verified: false
});
}
}
2 changes: 1 addition & 1 deletion web-starter/web/vite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A simple Noir circuit with browser proving with bb.js
Has both webpack and vite bundling.

Tested with Noir 1.0.0-beta.6 and bb 0.84.0
Tested with Noir 1.0.0-beta.15 and bb 3.0.0-nightly.20251104

## Setup

Expand Down
7 changes: 4 additions & 3 deletions web-starter/web/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "js",
"type": "module",
"dependencies": {
"@aztec/bb.js": "0.87.0",
"@noir-lang/noir_js": "1.0.0-beta.11"
"@aztec/bb.js": "3.0.0-nightly.20251104",
"@noir-lang/noir_js": "1.0.0-beta.15"
},
"scripts": {
"dev": "vite",
Expand All @@ -17,7 +17,8 @@
"playwright": "^1.53.0",
"ts-node": "^10.9.2",
"typescript": "^5.8.3",
"vite": "^6.1.0"
"vite": "^6.1.0",
"vite-plugin-node-polyfills": "0.17.0"
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
5 changes: 5 additions & 0 deletions web-starter/web/vite/playwright.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ const config = {
baseURL: 'http://localhost:5173',
headless: true,
},
// Global test timeout for proof generation
timeout: 300000, // 5 minutes
expect: {
timeout: 180 * 1000, // 3 minutes for assertions
},
projects: [
{ name: 'chromium', use: { browserName: 'chromium' } },
{ name: 'firefox', use: { browserName: 'firefox' } },
Expand Down
4 changes: 2 additions & 2 deletions web-starter/web/vite/tests/proof-verification.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { test, expect, Page } from '@playwright/test';
test('proof verification works in the browser', async ({ page }: { page: Page }) => {
await page.goto('/');
await page.click('#generateProofBtn');
// Wait for the result to contain 'Verified:' with increased timeout
// Wait for the result to contain 'Verified:' with 5 minute timeout for proof generation
let resultText = '';
try {
await expect(page.locator('#result')).toContainText('Verified:', { timeout: 30000 });
await expect(page.locator('#result')).toContainText('Verified:', { timeout: 300000 });
resultText = await page.locator('#result').innerText();
} catch (e) {
// Debug: print the current contents of #result if the check fails
Expand Down
18 changes: 10 additions & 8 deletions web-starter/web/vite/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { defineConfig } from 'vite';
import { nodePolyfills } from 'vite-plugin-node-polyfills';

export default defineConfig({
plugins: [
nodePolyfills(),
],
optimizeDeps: {
exclude: ['@noir-lang/noirc_abi', '@noir-lang/acvm_js', '@noir-lang/noir_js', '@aztec/bb.js']
},
rollupOptions: {
input: 'index.html',
output: {
dir: 'dist',
format: 'esm'
}
}
});
resolve: {
alias: {
pino: "pino/browser.js",
},
},
});
Loading