Skip to content
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

Add IVCProof to the existing folding schemes (Nova,HyperNova,ProtoGalaxy) #167

Merged
merged 7 commits into from
Oct 11, 2024

Conversation

arnaucube
Copy link
Collaborator

@arnaucube arnaucube commented Oct 4, 2024

Add IVCProof to the existing folding schemes (Nova,HyperNova,ProtoGalaxy), with serializers (by macro).

Implement from_ivc_proof for the FoldingSchemes trait (and Nova, HyperNova, ProtoGalaxy), so that the FoldingScheme IVC's instance can be constructed from the given parameters and the last IVCProof, which allows to sent the IVCProof between different parties, so that they can continue iterating the IVC from the received IVCProof.
Also the serializers allow for the IVCProof to be sent to a verifier that can deserialize it and verify it.

This allows to remove the logic from the file folding/nova/serialize.rs (removing the whole file), which is now covered by the IVCProof generated serializers (generated by macro instead of handwritten), and the test that the file contained is now abstracted and applied to all the 3 existing folding schemes (Nova, HyperNova, ProtoGalaxy) at the folding/mod.rs file.

It updates too the IVC::verify interface so that now it takes less parameters as inputs (basically the new IVCProof).

Also, update Nova VerifierParams serializers to avoid serializing the R1CS to save big part of the old serialized size (several MBs reduced).

The main improvement is that now we have the data structure of IVCProof which is portable (serializable) between different machines, so that one prover can send their current IVC state with the IVCProof to another one, and the second prover can continue the IVC folding, and eventually generate the Decider compressed zkSNARK proof for a verifier to verify it (or even send the plain IVCProof to a verifier). This also allows to remove the serializers of the Nova & HyperNova structs.
And also it adds a unified interface for deserializing the FoldingSchemes::ProverParam & VerifierParam.

HyperNova, ProtoGalaxy), so that the FoldingScheme IVC's instance can be
constructed from the given parameters and the last IVCProof, which
allows to sent the IVCProof between different parties, so that they can
continue iterating the IVC from the received IVCProof.  Also the
serializers allow for the IVCProof to be sent to a verifier that can
deserialize it and verify it.

This allows to remove the logic from the file
[folding/nova/serialize.rs](https://github.com/privacy-scaling-explorations/sonobe/blob/f1d82418ba047cf90805f2d0505370246df24d68/folding-schemes/src/folding/nova/serialize.rs)
and
[folding/hypernova/serialize.rs](https://github.com/privacy-scaling-explorations/sonobe/blob/f1d82418ba047cf90805f2d0505370246df24d68/folding-schemes/src/folding/hypernova/serialize.rs)
(removing the whole files), which is now covered by the `IVCProof`
generated serializers (generated by macro instead of handwritten), and
the test that the file contained is now abstracted and applied to all
the 3 existing folding schemes (Nova, HyperNova, ProtoGalaxy) at the
folding/mod.rs file.
…zation (for all Nova, HyperNova and ProtoGalaxy), without serializing the R1CS/CCS and thus saving substantial serialized bytes space.
Copy link
Collaborator

@dmpierre dmpierre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is neat! I have one question about keeping the implementation of a serializer trait. Apart from that, this PR removes quite a lot, nice!

folding-schemes/src/folding/nova/mod.rs Outdated Show resolved Hide resolved
folding-schemes/src/folding/protogalaxy/mod.rs Outdated Show resolved Hide resolved
Copy link
Member

@CPerezz CPerezz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!! Nice work!!!

@arnaucube arnaucube added this pull request to the merge queue Oct 11, 2024
Merged via the queue into main with commit cb1b8e3 Oct 11, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants