privacy-scaling-explorations/sonobe

Question about Circom frontend for Hypernova

yugocabrio opened this issue · 4 comments

Hello,
I understand that Hypernova's Augmented Circuit has to be represented as CCS. So my question is does generate_step_constraints in the FCircuit also have to be represented as CCS to conduct HyperNova's folding?
I wrote the code that converts circom-compat's R1CS to Sonobe's R1CS at this PR, but I changed to use cricom-compat's generate_constraints function in the generate_step_constraints of Sonobe. However, I feel that I should have adopted the first approach when I consider HyperNova and see the circom-compat update because it is easy to convert from R1CS to CCS.
What do you think about this and how would the approach to circom for Hypernova be best?

The R1CS to CCS is pretty direct (eg. sonobe/folding-schemes/src/ccs/mod.rs#L73), so the approach that we're currently using is that the HyperNova's AugmentedFCircuit is defined with normal arkworks code which generates the R1CS, and we 'compute' the CCS from that R1CS ('compute' with quotes because it is not computing much, is just re-labeling some parameters to convert it to CCS to work with it later in HyperNova), which then is folded following HyperNova NIMFS scheme.

Does this mean that the constraint check of R1CS of Fcircuit (step circuit) is also converted to CCS together with the Augmented circuit when it is converted to CCS?

Yes, the FCircuit is a kind of abstraction that allows to generate the constraints that are part of the AugmentedFCircuit, so at the end the constraints that we generate are the R1CS of the AugmentedFCircuit (which contains the constraints of the FCircuit among other constraints for the other checks). Then the AugmentedFCircuit's R1CS is converted to CCS, which contains the FCircuit constraints converted to CCS too.

I understand. Thank you kindly for letting me know.