diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ada7bf5..6e29b92 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ When contributing to this repository, please first discuss the change you wish t ## Contributing to an existing example project If you would like to contribute to an existing example project, please open an issue and tag one of the original -authors or maintainers (@critesjosh, @signorecello) with your suggestion. +authors or maintainers ([@critesjosh](https://github.com/critesjosh), [@signorecello](https://github.com/signorecello)) with your suggestion. ## Adding a new example project @@ -18,4 +18,4 @@ If you want to contribute with unique ideas, check out Awesome Noir to see what' - A Svelte example - A server-side-rendered Go or Python app -Basically anything that combines different technologies would be adding a lot to the ecosystem. If you'd like to discuss further, please message @signorecello or @critesjosh! +Basically anything that combines different technologies would be adding a lot to the ecosystem. If you'd like to discuss further, please message [@signorecello](https://github.com/signorecello) or [@critesjosh](https://github.com/critesjosh)! diff --git a/vite-hardhat/bun.lockb b/vite-hardhat/bun.lockb index 0a059d6..e968ee7 100755 Binary files a/vite-hardhat/bun.lockb and b/vite-hardhat/bun.lockb differ diff --git a/vite-hardhat/package.json b/vite-hardhat/package.json index 2217b63..836b0b8 100644 --- a/vite-hardhat/package.json +++ b/vite-hardhat/package.json @@ -8,13 +8,20 @@ "scripts": { "deploy": "bunx hardhat compile && bunx hardhat deploy", "dev": "bun --filter vite dev", - "test:hardhat": "bunx hardhat test" + "test:hardhat": "bunx hardhat test", + "node": "bunx hardhat node" }, "type": "module", "devDependencies": { "hardhat-plugin-noir": "0.1.3", "@types/bun": "^1.1.12", - "hardhat": "^2.19.2", + "hardhat": "^2.19.2" + }, + "dependencies": { + "@aztec/bb.js": "^0.62.0", + "@noir-lang/noir_js": "0.36.0", + "@noir-lang/noir_wasm": "0.36.0", + "@noir-lang/types": "0.36.0", "@nomicfoundation/hardhat-ignition": "^0.15.5", "@nomicfoundation/hardhat-ignition-viem": "^0.15.5", "commander": "^12.1.0", diff --git a/vite-hardhat/packages/vite/hooks/useOffChainVerification.tsx b/vite-hardhat/packages/vite/hooks/useOffChainVerification.tsx index bddb002..3e249c6 100644 --- a/vite-hardhat/packages/vite/hooks/useOffChainVerification.tsx +++ b/vite-hardhat/packages/vite/hooks/useOffChainVerification.tsx @@ -3,14 +3,18 @@ import { ProofData } from '@noir-lang/types'; import { useEffect } from 'react'; import { toast } from 'react-toastify'; -import { BarretenbergBackend } from '@noir-lang/backend_barretenberg'; +import { UltraPlonkBackend } from '@aztec/bb.js'; import { Noir } from '@noir-lang/noir_js'; -export function useOffChainVerification(backend: BarretenbergBackend, noir?: Noir, proofData?: ProofData) { +export function useOffChainVerification( + backend: UltraPlonkBackend, + noir?: Noir, + proofData?: ProofData, +) { useEffect(() => { if (!proofData || !noir) return; - toast.promise(backend.verifyProof(proofData), { + toast.promise(backend.verifyProof(proofData.proof), { pending: 'Verifying proof off-chain', success: 'Proof verified off-chain', error: 'Error verifying proof off-chain', diff --git a/vite-hardhat/packages/vite/hooks/useProofGeneration.tsx b/vite-hardhat/packages/vite/hooks/useProofGeneration.tsx index 4a2910a..f06b91a 100644 --- a/vite-hardhat/packages/vite/hooks/useProofGeneration.tsx +++ b/vite-hardhat/packages/vite/hooks/useProofGeneration.tsx @@ -1,18 +1,18 @@ import { toast } from 'react-toastify'; import { useEffect, useState } from 'react'; import { getCircuit } from '../../noir/compile.js'; -import { BarretenbergBackend, ProofData } from '@noir-lang/backend_barretenberg'; +import { UltraPlonkBackend } from '@aztec/bb.js'; import { Noir } from '@noir-lang/noir_js'; export function useProofGeneration(inputs?: { [key: string]: string }) { - const [proofData, setProofData] = useState(); - const [backend, setBackend] = useState(); + const [proofData, setProofData] = useState(); + const [backend, setBackend] = useState(); const [noir, setNoir] = useState(); const proofGeneration = async () => { if (!inputs) return; const circuit = await getCircuit(); - const backend = new BarretenbergBackend(circuit, { + const backend = new UltraPlonkBackend(circuit.bytecode, { threads: navigator.hardwareConcurrency, }); const noir = new Noir(circuit); diff --git a/vite-hardhat/packages/vite/package.json b/vite-hardhat/packages/vite/package.json index 97ff837..ff018b0 100644 --- a/vite-hardhat/packages/vite/package.json +++ b/vite-hardhat/packages/vite/package.json @@ -11,6 +11,7 @@ "@noir-lang/noir_js": "0.36.0", "@noir-lang/noir_wasm": "0.36.0", "@noir-lang/types": "0.36.0", + "@aztec/bb.js": "^0.62.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-toastify": "^9.1.1",