pub trait Prover:
Clone
+ Send
+ Sync {
type ProvingKey: ProvingKey;
type Error: Debug + Display;
type ProveRequest<'a>: ProveRequest<'a, Self>
where Self: 'a;
// Required methods
fn inner(&self) -> &SP1NodeCore;
fn setup(&self, elf: Elf) -> Result<Self::ProvingKey, Self::Error>;
fn prove<'a>(
&'a self,
pk: &'a Self::ProvingKey,
stdin: SP1Stdin,
) -> Self::ProveRequest<'a>;
// Provided methods
fn version(&self) -> &str { ... }
fn execute(&self, elf: Elf, stdin: SP1Stdin) -> ExecuteRequest<'_, Self> { ... }
fn verify(
&self,
proof: &SP1ProofWithPublicValues,
vkey: &SP1VerifyingKey,
status_code: Option<StatusCode>,
) -> Result<(), SP1VerificationError> { ... }
}Expand description
The entire user-facing functionality of a prover.
Required Associated Types§
Sourcetype ProvingKey: ProvingKey
type ProvingKey: ProvingKey
The proving key used for this prover type.
Sourcetype ProveRequest<'a>: ProveRequest<'a, Self>
where
Self: 'a
type ProveRequest<'a>: ProveRequest<'a, Self> where Self: 'a
The prove request builder.
Required Methods§
Sourcefn inner(&self) -> &SP1NodeCore
fn inner(&self) -> &SP1NodeCore
The inner SP1NodeCore struct used by the prover.
Sourcefn setup(&self, elf: Elf) -> Result<Self::ProvingKey, Self::Error>
fn setup(&self, elf: Elf) -> Result<Self::ProvingKey, Self::Error>
Setup the prover with the given ELF.
Sourcefn prove<'a>(
&'a self,
pk: &'a Self::ProvingKey,
stdin: SP1Stdin,
) -> Self::ProveRequest<'a>
fn prove<'a>( &'a self, pk: &'a Self::ProvingKey, stdin: SP1Stdin, ) -> Self::ProveRequest<'a>
Prove the given program on the given input in the given proof mode.
Provided Methods§
Sourcefn execute(&self, elf: Elf, stdin: SP1Stdin) -> ExecuteRequest<'_, Self>
fn execute(&self, elf: Elf, stdin: SP1Stdin) -> ExecuteRequest<'_, Self>
Execute the program on the given input.
Sourcefn verify(
&self,
proof: &SP1ProofWithPublicValues,
vkey: &SP1VerifyingKey,
status_code: Option<StatusCode>,
) -> Result<(), SP1VerificationError>
fn verify( &self, proof: &SP1ProofWithPublicValues, vkey: &SP1VerifyingKey, status_code: Option<StatusCode>, ) -> Result<(), SP1VerificationError>
Verify the given proof.
If the status code is not set, the verification process will check for success.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".