arnaucube
arnaucube/sonobe-docsPublic Self-hosted repository
sonobe-docs/src/usage/modularity.md
src/usage/modularity.mdRaw
 1# Modularity
 2## Swapping curves and proving schemes
 3Thanks to the modularity of arkworks, we can swap between curves and proving systems.
 4Suppose that for the final proof (decider), instead of using Groth16 over the BN254 curve, we want to use Marlin+IPA over the Pasta curves, so we can enjoy of not needing a trusted setup.
 5
 6It just requires few line changes on our previous code, for example, imagine we're using the Nova folding scheme (where `FC` is the `FCircuit` that we want to fold):
 7```rust
 8type FS = Nova<G1, G2, FC, Pedersen<G1>, Pedersen<G2>, false>;
 9```
10
11to switch the folding scheme to use HyperNova, is as simple as updating the previous line to:
12
13```rust
14type FS = HyperNova< G1, G2, FC, Pedersen<G1>, Pedersen<G2>, 1, 1, false>;
15```
16
17similarly for using ProtoGalaxy folding scheme:
18```rust
19type FS = ProtoGalaxy<G1, G2, FC, Pedersen<G1>, Pedersen<G2>>;
20```
21
22We can use any cycle of curves available in arkworks for the `G1` and `G2`, and the rest of the code can be kept the same.