nexus_sdk::legacy

Trait LegacyProver

Source
pub trait LegacyProver<'a>: Setup<'a> {
    type Proof: LegacyVerifiable<'a>;
    type View: LegacyViewable;

    // Required methods
    fn new(elf_bytes: &[u8]) -> Result<Self, Self::Error>
       where Self: Sized;
    fn compile(opts: &CompileOpts) -> Result<Self, Self::Error>
       where Self: Sized,
             Self::Error: From<Error>;
    fn run_with_input<S: Serialize + Sized>(
        self,
        private_input: &S,
    ) -> Result<Self::View, Self::Error>;
    fn prove_with_input<S: Serialize + Sized>(
        self,
        private_input: &S,
    ) -> Result<Self::Proof, Self::Error>;

    // Provided methods
    fn new_from_file<P: AsRef<Path>>(path: &P) -> Result<Self, Self::Error>
       where Self: Sized,
             Self::Error: From<Error> { ... }
    fn run(self) -> Result<Self::View, Self::Error>
       where Self: Sized { ... }
    fn prove(self) -> Result<Self::Proof, Self::Error>
       where Self: Sized { ... }
}
Expand description

A prover for the zkVM.

Required Associated Types§

Required Methods§

Source

fn new(elf_bytes: &[u8]) -> Result<Self, Self::Error>
where Self: Sized,

Construct a new proving instance from raw ELF bytes.

Source

fn compile(opts: &CompileOpts) -> Result<Self, Self::Error>
where Self: Sized, Self::Error: From<Error>,

Construct a new proving instance through dynamic compilation (see compile).

Source

fn run_with_input<S: Serialize + Sized>( self, private_input: &S, ) -> Result<Self::View, Self::Error>

Run the zkVM on private input of type S and return a view of the execution output.

Source

fn prove_with_input<S: Serialize + Sized>( self, private_input: &S, ) -> Result<Self::Proof, Self::Error>

Run the zkVM on private input of type S and return a verifiable proof, along with a view of the execution output.

Provided Methods§

Source

fn new_from_file<P: AsRef<Path>>(path: &P) -> Result<Self, Self::Error>
where Self: Sized, Self::Error: From<Error>,

Construct a new proving instance by reading an ELF file.

Source

fn run(self) -> Result<Self::View, Self::Error>
where Self: Sized,

Run the zkVM and return a view of the execution output.

Source

fn prove(self) -> Result<Self::Proof, Self::Error>
where Self: Sized,

Run the zkVM and return a verifiable proof, along with a view of the execution output.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§