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;
}Available on crate feature
circuit only.Expand description
Interface for creating Sapling Spend proofs.
Required Associated Types§
Required Methods§
Sourcefn prepare_circuit(
proof_generation_key: ProofGenerationKey,
diversifier: Diversifier,
rseed: Rseed,
value: NoteValue,
alpha: Fr,
rcv: ValueCommitTrapdoor,
anchor: Scalar,
merkle_path: MerklePath,
) -> Option<Spend>
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.
Sourcefn create_proof<R: RngCore>(&self, circuit: Spend, rng: &mut R) -> Self::Proof
fn create_proof<R: RngCore>(&self, circuit: Spend, rng: &mut R) -> Self::Proof
Create the proof for a Sapling SpendDescription.
Sourcefn encode_proof(proof: Self::Proof) -> GrothProofBytes
fn encode_proof(proof: Self::Proof) -> GrothProofBytes
Encodes the given Sapling SpendDescription proof, erasing its type.
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§
Source§impl SpendProver for SpendParameters
impl SpendProver for SpendParameters
Source§impl SpendProver for MockSpendProver
Available on crate feature test-dependencies only.
impl SpendProver for MockSpendProver
Available on crate feature
test-dependencies only.