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

Add support for Noir as frontend #124

Closed
Savio-Sou opened this issue Jul 7, 2024 · 4 comments · Fixed by #131
Closed

Add support for Noir as frontend #124

Savio-Sou opened this issue Jul 7, 2024 · 4 comments · Fixed by #131
Assignees

Comments

@Savio-Sou
Copy link

Add to sonobe the ability to parse Noir (more accurately ACIR, Noir's intermediate representation of choice) and specifically its folding opcode; hence the ability to fold, prove and generate verifiers for circuits written in Noir.

Relevant links:

@dmpierre
Copy link
Collaborator

dmpierre commented Jul 9, 2024

Hey, thanks for suggesting this, we would indeed like to tackle this. Let me have a look!

@dmpierre dmpierre self-assigned this Jul 10, 2024
@dmpierre
Copy link
Collaborator

(small update: waiting for the aztec noir team to circle back on a few questions)

@Savio-Sou
Copy link
Author

Savio-Sou commented Jul 13, 2024

Additional reference: Closest pointer to ACIR --> R1CS would be arkworks_bridge, which does conversion of ACIR opcodes but to a new data structure instead of R1CS (as in the circom_compat struct).

Note that conversion is incomplete, where only AssertZero ACIR opcodes are handled as they can be converted into R1CS cleanly, while other opcodes would fail.

A possible approach could be building a converter which:

  1. Decomposes every ACIR opcode into AssertZero opcodes (a la acvm_stdlib)
  2. Uses ACVM to perform witness generation on this ACIR
  3. Converts this ACIR into R1CS

Follows by witness generation, which can either be witness generation on the ACIR or custom witness generation on the R1CS output.

(Credit @TomAFrench for insights)

@dmpierre
Copy link
Collaborator

It seems like this approach is working. With a few modifications, I managed to test it for a circuit with a shape similar to what sonobe expects. I will work on integrating this modified version of the arkworks_bridge into the lib now!

@dmpierre dmpierre linked a pull request Jul 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants