-
Notifications
You must be signed in to change notification settings - Fork 68
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
feat: implement nova's zk layer #127
Conversation
25b3318
to
ffe4e62
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass.
Currently discussing why is it required to add ZK to CycleFold instance. DIscussed in Zulip with @dmpierre and Srinath.
|
Answer from Srinath:
Nice, this should simplify this PR, will take this into account and remove the blinding of the cyclefold instances! |
Last transcription. After we get an answer for this, I think we are good to go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Great work! And thanks for writting in-line comments specifying each step related to the paper, made things more easy to follow! ^^
I guess that we're pending on the answer regarding the need to 'zk-fold' also the cyclefold instances or not, but otherwise LGTM!
I'm not sure how the structs and methods in the nova/zk.rs
file are expected to be used:
I identify 2 interesting places to use the nova zk-layer (not specifically this PR, but the concept of the zk-layer), one before all the folding pipeline (point 2), and the other at the end of the folding pipeline right before the final Decider snark proof (point 1)):
- Use-case-1: at the end of all the IVC folding steps (after n iterations of
nova.prove_step
), to 'blind' the IVC proof so then it can be sent to a server that will generate the final decider snark proof.
--> In this one, the user is externalizing the Decider final proof generation to a server. - Use-case-2: at the beginning of the folding pipeline, right when the user has their original instance prior to be folded into the running instance, the user can fold it with the random-satisfying-instance to then have a blinded instance that can be sent to a server that will fold it with the running instance.
--> In this one, the user is externalizing all the IVC folding and also the Decider final proof generation to a server.
From what I'm understanding (please correct me if I'm wrong), this PR allows to do part of the Use-case-1. 'part' because the new structs in nova/zk.rs
can not be plugged into the existing decider to generate the final snark proof, since it has extra parameters that would require extra checks in a modified Decider circuit.
Regarding Use-case-2, which would be adding the zk layer at the initial instances, where the use case would be the user initializes their instance, folds it with the randomly sampled instance, and then sends this folded instance (blinded) to a server which will fold it with the rest of instances and also will generate the final compressed Decider snark proof.
If I understand correctly this PR does not cover this case, and in fact this case could be done without the code in the nova/zk.rs
file, by just sampling a satisfying random instance and folding it with the user's original instance. (ie. in the current impl and paper there are more steps because we fold
This last description of Use-case-1, applied to the paper D.4 construction would be doing directly the steps 2,3,4:
- (2.) sample random satisfying instance
$(U_r, W_r)$ - (3.) fold user original fresh instance
$(u_i, w_i)$ with$(U_r, W_r)$ , obtaining$(u'_i, w'_i), \overline{T}'$ - (4.) the randomized proof then is:
$\pi' = (U_r, u_i, u_i', \overline{T}', w'_i)$
(notice that there is no$U_f, W_f, \overline{T}$ )
The output of this process can be then the instance to be folded into the next iteration of the folding steps. This is related to Allow tree-like folding #136 , since then we would be folding 'non-fresh' instances in the folding step (the original running instance with the new blinded folded instance), which to enable this it has similar requirements as the tree-like folding described on that issue.
Is the overview described in this message correct? if that's the case, then I understand that this PR is targeting the Use-case-1, and this PR by itself is partially implementing it right?
ie. This PR allows to generate the blinded IVC proof (not a snark proof) out of the final folded instance, but this is not compatible with the current Decider to then generate the final snark proof, right? I imagine that the idea is that at some point we would have a modified Decider that takes these kind of zkIVC instances and verifies them in-circuit to produce the final snark proof), so that the work done in this PR can be connected with the rest of the flow. Is that correct?
cc @arnaucube (quote replying breaks latex code) Thanks for the thoughtful comment and questions! Yes, this PR is only focused on implementing the zk layer for nova. In fact, there is a third use case, where the user computes folds and sends the zk IVC proof to any IVC verifier, without any decider circuit involved anywhere. Regarding use case 1: this is correct. Using the nova zk layer, a user can blind his running and incoming instances and send a zk IVC proof that can be groth16'ed by an untrusted server. This PR is not modifying sonobe's decider circuit to make this possible. In fact, I think the decider circuit would be a tad different? Notably to accommodate for the random instances. Hence, this might require its own PR. Regarding use case 2: this is correct. This PR does not aim to cover this use case, but you can do what you are describing with what this PR introduces, since you only need sampling relaxed r1cs instances. I see the connection with doing tree-like folding, nice! This is tangential, but here as well, I guess that obtaining a final compressed snark would require another modified final decider. |
As per discussion with @srinathtv I think we can simply remove the Cyclefold blinding for now and merge this. But was clearly stated in the |
Co-authored-by: Carlos Pérez <[email protected]>
Co-authored-by: Carlos Pérez <[email protected]>
Co-authored-by: Carlos Pérez <[email protected]>
prover provided cyclefold intance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed blinding the cyclefold instance. However, the verifier still performs the following checks on the cyclefold instance:
- The hash of the running cyclefold instance points to the same hash as
u_i.x[1]
- The prover-provided cyclefold instance satisfies the cyclefold R1CS
Also, rebased on main!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should add some of this explanation to the docs.
Mainly because it really gives a good intuition on how is the ZK introduced here useful (in which scenarios, and how does it work).
For the rest, LGTM, awesome job!!!!
This PR implements nova's zero-knowledge layer, as specified in Appendix D.4 of Kothapalli, Setty (2023).
Edit: we initially were blinding the cyclefold instance. However, after discussing, it appears that blinding the cyclefold instance should not be necessary, while keeping zk for the IVC proof.