ginger-lib icon indicating copy to clipboard operation
ginger-lib copied to clipboard

Generalize IOP and Darlin Proving System functions

Open 95DDB opened this issue 3 years ago • 0 comments

Some of the IOP rounds are exactly the same across different variants of the Marlin/Darlin proving system. Currently there is no code reuse because the functions implementing the IOP rounds operate directly on the fields of a Prover/VerifierState struct, which is necessarily different from one proving system variant to another, therefore these functions must be reimplemented for each proving system variant, even if their logic (and actually their code) stays exactly the same. Would be nice to find a way to abstract over the IOP Prover/Verifier state data structures and round functions to reduce code duplication thus improving code modularity, extendability and maintenability. There is a lot of code duplication in Marlin/Darlin itself too, e.g. the setup, prove, verify functions. I would even go further and define a trait for Marlin/Darlin itself that, working along with the already existing traits and the ones we are going to introduce when and if generalizing IOP, will provide default implementations for all the setup/prove/verify functions.

95DDB avatar Mar 21 '22 15:03 95DDB