Standardized ProvingKey
, VerifyingKey
, and Proof
ABIs
#128
Labels
D-hard
Difficult: hard
P-medium
Priority: medium
T-design
Type: discuss API design and/or research
T-documentation
Type: doc improvements
T-performance
Type: performance improvements
T-refactor
Type: cleanup/refactor
Milestone
Especially as projects move towards mainnet adoption of
ZK-Garage
, it's important that we set some specifications on the expected format of the various circuit-specific components in PLONK, down to the binary level. Whenever there are optimizations to be made on the compiler, prover, or verifier side that don't break API/ABI compatibility we can give library users guarantees about the state of existing provers or verifiers that have already been deployed to a blockchain protocol.Goals
A major goal of this project is to ensure that stabilizing the data formats is future-proof against extensions to PLONK like lookups, custom gates, an arbitrary number of wires, ... etc.
Draft Proposal
The following is a draft proposal of what a standard format could look like.
Configuration
First, we should consider the kind of PLONK that a circuit is using, notably the kinds of features it has access to. These can exist in some standard configurations that look like this:
The default configuration for this repo would have
WIRE_COUNT = 4
.TODO: We can add more to this configuration related to lookups and custom gates.
In order to produce
ProvingKey
andVerifyingKey
we should have the following interfaceNOTE: See #127 for a desired interface for
commitment::PolynomialCommitment
.Proving Key
The
ProvingKey
(under a givenConfiguration
) should be sufficient for producing a proof. Here's a desirable API for this:The standard format of the
ProvingKey
is as follows:Sources:
Verifying Key
The
VerifyingKey
(under a givenConfiguration
) should be sufficient for verifying a proof. Here's a desirable API for this:The standard format of the
VerifyingKey
is as follows:Sources:
Proof
The standard format of the
Proof
is as follows:Sources:
What's Next
???
.compile
,prove
, andverify
APIs to the desired ones above.The text was updated successfully, but these errors were encountered: