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

Abstract away witness generation within noir_js #2836

Closed
Tracked by #2711
signorecello opened this issue Sep 26, 2023 · 1 comment · Fixed by #2842
Closed
Tracked by #2711

Abstract away witness generation within noir_js #2836

signorecello opened this issue Sep 26, 2023 · 1 comment · Fixed by #2842
Assignees

Comments

@signorecello
Copy link
Contributor

signorecello commented Sep 26, 2023

Part of the first noir_js devex review.

With the current versions, we need to call two methods in order to generate a witness:

const solvedWitness = await generateWitness(circuit, input);
const witness = witnessMapToUint8Array(solvedWitness);

this also means that devs need to import and manage versioning for noir_js, acvm_js, and optionally noir_wasm, reducing the usefulness of noir_js in the first place

would be worth to try making them only one, and abstracted within the noir_js main export (class, object, whatever it is). This avoids passing the circuit twice, as it can be stored within the Noir class. Suggestion:

const noir = new Noir(circuit) // here goes the circuit, is stored in the class
const witness = await noir.generateWitness(input) // just need to pass the input
@signorecello
Copy link
Contributor Author

I wonder if the generateWitness method we have in noir-starter could be useful

Didn't yet check acvm_js library but it seems to be an amazing lib we could just use in this method instead of the low-brain Map.set we have there 😄 Actually the reason I didn't try it in noir-starter is because it will be refactored pretty soon with noir_js anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants