Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update NoirJS tutorial in docs #4793

Closed
1 task
Savio-Sou opened this issue Apr 12, 2024 · 3 comments · Fixed by #4861
Closed
1 task

Update NoirJS tutorial in docs #4793

Savio-Sou opened this issue Apr 12, 2024 · 3 comments · Fixed by #4861
Labels
documentation Improvements or additions to documentation

Comments

@Savio-Sou
Copy link
Collaborator

Savio-Sou commented Apr 12, 2024

Prerequisites

Update the https://noir-lang.org/docs/tutorials/noirjs_app doc page per the changes in #4769.

@Savio-Sou
Copy link
Collaborator Author

Savio-Sou commented Apr 12, 2024

On second read of the https://noir-lang.org/docs/tutorials/noirjs_app page:

@signorecello should engineers update it without updating the example, or should we count on @noir-lang/developerrelations to update both in one go?

@michaeljklein
Copy link
Contributor

Summary of expected docs for new verifier class (could be added to the end of the existing noirjs_app page):

Change the BarretenbergBackend import line:

import { BarretenbergVerifierBackend } from '@noir-lang/backend_barretenberg';

and the setup line:

// try {
const backend = new BarretenbergVerifierBackend(circuit);

and then skip proving:

const proof = await noir.generateProof(input);

@Savio-Sou Savio-Sou changed the title Document split of backend_barretenburg into prover and verifier classes Update NoirJS tutorial in docs Apr 16, 2024
@Savio-Sou
Copy link
Collaborator Author

Savio-Sou commented Apr 16, 2024

expected docs

Also verifyProof now takes in proof and verificationKey, instead of regenerating they verification key every time.

Adapted from the E2E test in #4769:

// Import
import { BarretenbergVerifier as Verifier } from '@noir-lang/backend_barretenberg';

// Generate vkey
const verificationKey = await backend.getVerificationKey();

// Verify proof
const verifier = new Verifier();
const isValid = await verifier.verifyProof(proof, verificationKey);

github-merge-queue bot pushed a commit that referenced this issue Apr 22, 2024
# Description

## Problem\*

Resolves #4793

## Summary\*

This pull requests updates the docs to support changes made after
version v0.25.0. The current docs directs the user to install packages
of version 0.19.7 while calling functions `generateProof` and
`verifyProof` instead of `generateFinalProof` and `verifyFinalProof`
which results in the error that functions `generateProof` and
`verifyProof` don't exist.

Also, for the dev version of the docs, using the packages
v0.27.0@nightly, the functions needed to be updated to reflect the
changes in #4769.

## Additional Context

I've tested the changes using packages and nargo of the following
versions:
 - v0.25.0
 - v0.26.0
 - v0.27.0@nightly
 
I added documentation for the `vite.config.js` file otherwise any
version >= v0.21.0 would result in runtime errors.

## Documentation\*

Check one:
- [ ] No documentation needed.
- [x] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants