Closed lazovicff closed 2 years ago
@drewstone Let me know what you think. We could also break arkworks-r1cs-circuits
and arkworks-plonk-circuits
into two parts: arkworks-[x]-circuits + arkworks-[x]-gadgets
, and rename arkworks-native-circuits
into arkworks-native-gadgets
This looks good
We would need updates to the documentation as well @filiplazovic. Perhaps we can add to this proper rust docs and start publishing this online.
1. Structure
We should have a workspace with the following structure:
arkworks-benchmarks
arkworks-circom-verifier
arkworks-r1cs-circuits
- which contains only the r1cs constraints version of our circuits + gadgetsarkworks-setups
- contains the higher level APIs for both R1CS and PLONK circuitsarkworks-native-circuits
- which contains only the native version of our gadgetsarkworks-plonk-circuits
arkworks-utils
2. Tools
Use cargo-workspaces for workspace publishing.
3. Dependency graph
arkworks-gadgets
should not have dependency ofarkworks-utils
, except for testing.Move
PoseidonParameters
,Sbox
,PoseidonError
(https://github.com/webb-tools/arkworks-gadgets/blob/master/arkworks-utils/src/poseidon/mod.rs) into thearkworks-native-circuits/poseidon
directory.arkworks-native-circuits
.arkworks-r1cs-circuits
, etc.Modify utility functions for Poseidon to not return PoseidonParameters struct, but instead return tuple:
Move
setup_params...
(https://github.com/webb-tools/arkworks-gadgets/blob/master/arkworks-utils/src/utils/common.rs#L23) functions inside the native version of poseidon.Elliptic curves should only be imported for testing, for all crates.