Paper: "Dispute-free Scalable Open Vote Network using zk-SNARKs" by Muhammad ElSheikh Available at: https://arxiv.org/pdf/2203.03363.pdf

In this paper, the author has mentioned some pre-defined Groth16 zk-snark arithmetic circuits such as Mux(), LessThan(), GreaterThan(), etc. (page 5).

The author has also written three zk-snark circuits (page 7). This is very interesting.

But, it is not clear, how to write such programs (arithmetic circuits) and where those “pre-defined” functions were defined!

Can somebody help with how to write such programs?

  • $\begingroup$ You might like to check out zokrates. $\endgroup$
    – Daniel S
    Commented Feb 8 at 12:35

1 Answer 1


You can use circom. This is a framework for writing zero-knowledge circuits in Rust. It also contains predefined circuits such as the ones you were referring to.

There are other options in general (e.g., libsnark for C++), but circom is the one the authors of the paper you refer use: see their GitHub repo here, which is referred at page 2.

  • $\begingroup$ Thanks. I am still feeling disconnect here. This seems a different programming paradigm where normal functional programming may not fit. . Before start coding (in Circom), how to even start writing pseudocode (as in the paper) at the first place. $\endgroup$
    – user60588
    Commented Feb 8 at 15:23
  • $\begingroup$ I imagine you are referring to the pseudocode in, e.g., page 7. Those are example of relations: they have a witness (private input), statement (public input) and "perform checks". If all the checks / assertions are passed then the relation is satisfied. There may be no simple answer here for how to start writing them: there is no official convention on it. Reading a few papers like the one you referred to is the only suggestion I have. $\endgroup$ Commented Feb 11 at 21:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.