You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce a low-level API for setup, indexing, proving, and verifying that directly reasons about the relation, instead of going via our ConstraintSystem API.
Problem Definition
Right now, for proving R1CS via our SNARK traits, we have to go via the ConstraintSynthesizer (and hence ConstraintSystem) trait. This is unsatisfactory for a couple of reasons:
Using our libraries with external R1CS formats like zkinterface incurs performance overheads because we have to convert to ConstraintSystem and then back to matrices, instead of directly reading the matrices from the external format.
The relations crate is at the moment more about data structures for working with a particular relation (R1CS) rather than about the relation itself. For example, the R1CS relation consists of (i, x, w) where i consists of the R1CS matrices, and x and w are the public input and witness, respectively. However, the current ark_relations::r1cs module doesn't have any data structure reflecting these, and only has data structures like ConstraintSystemRef.
Proposal
Add a Relation trait in relations that looks like:
pubtraitSNARK<R:Relation>{fnindex(pp:&Self::Parameters,i:&R::Index) -> (Self::ProvingKey,Self::VerifyingKey);// same for proving and verifying}
Additionally, we add a new R1CS-specific trait:
pubtraitR1CSSnark:SNARK<R1CS>{fnindex_from_cs<CS:ConstraintSynthesizer>(pp:&Self::Parameters,cs:CS) -> (Self::ProvingKey,Self::VerifyingKey){// default impl using the `SNARK::index`, by `calling cs.into_matrices()`. }}
(We might need equivalents for PreprocessingSNARK.)
For Admin Use
Not duplicate issue
Appropriate labels applied
Appropriate contributors tagged
Contributor assigned/self-assigned
The text was updated successfully, but these errors were encountered:
Summary
Introduce a low-level API for setup, indexing, proving, and verifying that directly reasons about the relation, instead of going via our
ConstraintSystem
API.Problem Definition
Right now, for proving R1CS via our
SNARK
traits, we have to go via theConstraintSynthesizer
(and henceConstraintSystem
) trait. This is unsatisfactory for a couple of reasons:zkinterface
incurs performance overheads because we have to convert toConstraintSystem
and then back to matrices, instead of directly reading the matrices from the external format.relations
crate is at the moment more about data structures for working with a particular relation (R1CS) rather than about the relation itself. For example, theR1CS
relation consists of(i, x, w)
wherei
consists of theR1CS
matrices, andx
andw
are the public input and witness, respectively. However, the currentark_relations::r1cs
module doesn't have any data structure reflecting these, and only has data structures likeConstraintSystemRef
.Proposal
Relation
trait inrelations
that looks like:SNARK
trait as follows:Additionally, we add a new R1CS-specific trait:
(We might need equivalents for
PreprocessingSNARK
.)For Admin Use
The text was updated successfully, but these errors were encountered: