-
Hello, firstly, thank you for this beautiful library! I have two questions: Firstly, I couldn't figure out how to use mod operation with gnark. In circom: Var xer = balance % r_prime; Secondly, I have written and compiled my circuit in circom, now I have my r1cs and witness. Is it possible to use gnark only as a prover and also can I generate my witness from my r1cs (or sym etc.) of circom circuit, using gnark? Thank you!! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 14 replies
-
See https://pkg.go.dev/github.com/consensys/[email protected]/std/math/emulated. Yes, it is possible. We don't have transpiler from circom, but you can build R1CS circuit manually. See for example https://www.notamonadtutorial.com/how-to-use-the-consenyss-gnark-zero-knowledge-proof-library-and-disclosure-of-a-ddos-bug/ |
Beta Was this translation helpful? Give feedback.
-
re: using circom circuit with gnark; as @ivokub said, possible, but not trivial to implement I think. The mapping of the constraints should be straightforward, but the "solver hint" part I have no idea. |
Beta Was this translation helpful? Give feedback.
See https://pkg.go.dev/github.com/consensys/[email protected]/std/math/emulated.
Yes, it is possible. We don't have transpiler from circom, but you can build R1CS circuit manually. See for example https://www.notamonadtutorial.com/how-to-use-the-consenyss-gnark-zero-knowledge-proof-library-and-disclosure-of-a-ddos-bug/