microsoft / Spartan

Spartan: High-speed zkSNARKs without trusted setup
MIT License
672 stars 112 forks source link

R1CS instance does not match the definition #69

Open ishwarbb opened 4 months ago

ishwarbb commented 4 months ago

The R1CS instance example used in cubic.rs is not an R1CS instance according to https://eprint.iacr.org/2020/1069.pdf Theorem 19 . Although it's still a valid constraint system, it's just more inefficient

image

We need total constraints to be No.of Multiplication gates + 1. The last constraint handles all additions and Basically the last two constraints can be combined into one addition constraint.

srinathsetty commented 4 months ago

Thanks for the note! Yes, cubic.rs is just an example. Please feel free to submit a PR.