pub trait SpendProver {
    type Proof;

    // Required methods
    fn prepare_circuit(
        proof_generation_key: ProofGenerationKey,
        diversifier: Diversifier,
        rseed: Rseed,
        value: NoteValue,
        alpha: Fr,
        rcv: ValueCommitTrapdoor,
        anchor: Scalar,
        merkle_path: MerklePath
    ) -> Option<Spend>;
    fn create_proof<R: RngCore>(
        &self,
        circuit: Spend,
        rng: &mut R
    ) -> Self::Proof;
    fn encode_proof(proof: Self::Proof) -> GrothProofBytes;
}
Expand description

Interface for creating Sapling Spend proofs.

Required Associated Types§

source

type Proof

The proof type created by this prover.

Required Methods§

source

fn prepare_circuit( proof_generation_key: ProofGenerationKey, diversifier: Diversifier, rseed: Rseed, value: NoteValue, alpha: Fr, rcv: ValueCommitTrapdoor, anchor: Scalar, merkle_path: MerklePath ) -> Option<Spend>

Prepares an instance of the Sapling Spend circuit for the given inputs.

Returns None if diversifier is not a valid Sapling diversifier.

source

fn create_proof<R: RngCore>(&self, circuit: Spend, rng: &mut R) -> Self::Proof

Create the proof for a Sapling SpendDescription.

source

fn encode_proof(proof: Self::Proof) -> GrothProofBytes

Encodes the given Sapling SpendDescription proof, erasing its type.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl SpendProver for SpendParameters

source§

impl SpendProver for MockSpendProver

Available on crate feature test-dependencies only.
§

type Proof = [u8; 192]