pub trait Prover<C: SP1ProverComponents>: Send + Sync {
// Required methods
fn inner(&self) -> &SP1Prover<C>;
fn setup(&self, elf: &[u8]) -> (SP1ProvingKey, SP1VerifyingKey);
fn prove(
&self,
pk: &SP1ProvingKey,
stdin: &SP1Stdin,
mode: SP1ProofMode,
) -> Result<SP1ProofWithPublicValues>;
// Provided methods
fn version(&self) -> &str { ... }
fn execute(
&self,
elf: &[u8],
stdin: &SP1Stdin,
) -> Result<(SP1PublicValues, ExecutionReport)> { ... }
fn verify(
&self,
bundle: &SP1ProofWithPublicValues,
vkey: &SP1VerifyingKey,
) -> Result<(), SP1VerificationError> { ... }
}
Expand description
A basic set of primitives that each prover variant must implement.
Required Methods§
Sourcefn setup(&self, elf: &[u8]) -> (SP1ProvingKey, SP1VerifyingKey)
fn setup(&self, elf: &[u8]) -> (SP1ProvingKey, SP1VerifyingKey)
Generate the proving and verifying keys for the given program.
Sourcefn prove(
&self,
pk: &SP1ProvingKey,
stdin: &SP1Stdin,
mode: SP1ProofMode,
) -> Result<SP1ProofWithPublicValues>
fn prove( &self, pk: &SP1ProvingKey, stdin: &SP1Stdin, mode: SP1ProofMode, ) -> Result<SP1ProofWithPublicValues>
Proves the given program on the given input in the given proof mode.
Provided Methods§
Sourcefn execute(
&self,
elf: &[u8],
stdin: &SP1Stdin,
) -> Result<(SP1PublicValues, ExecutionReport)>
fn execute( &self, elf: &[u8], stdin: &SP1Stdin, ) -> Result<(SP1PublicValues, ExecutionReport)>
Executes the program on the given input.
Sourcefn verify(
&self,
bundle: &SP1ProofWithPublicValues,
vkey: &SP1VerifyingKey,
) -> Result<(), SP1VerificationError>
fn verify( &self, bundle: &SP1ProofWithPublicValues, vkey: &SP1VerifyingKey, ) -> Result<(), SP1VerificationError>
Verify that an SP1 proof is valid given its vkey and metadata.
For Plonk proofs, verifies that the public inputs of the PlonkBn254
proof match
the hash of the VK and the committed public values of the SP1ProofWithPublicValues
.