a16z / jolt

The simplest and most extensible zkVM. Fast and fully open source from a16z crypto and friends. ⚡
https://jolt.a16zcrypto.com
MIT License
619 stars 123 forks source link

Refactor generics #309

Closed sragss closed 4 months ago

sragss commented 4 months ago

Refactors generics to support multiple fields and polynomial commitment schemes.

JoltField

New field trait in jolt-core/src/poly/field.rs. Will allow us to wrap types of fields and make sure they implement Jolt specific functionality. We can support ark_ff::PrimeField, ff::PrimeField, binius_field::TowerField all in one place.

CommitmentScheme

The other big change is that we've added a CommitmentScheme trait in jolt-core/src/poly/commitment/commitment_scheme.rs. This is passed around as a static generic everywhere it's needed. Also allows us to remove the CommitmentScheme specific ark_ff::CurveGroup generic and apply that to only Curve based commitment schemes.