Trait zcash_primitives::sapling::prover::TxProver [−][src]
pub trait TxProver { type SaplingProvingContext; fn new_sapling_proving_context(&self) -> Self::SaplingProvingContext; fn spend_proof(
&self,
ctx: &mut Self::SaplingProvingContext,
proof_generation_key: ProofGenerationKey,
diversifier: Diversifier,
rseed: Rseed,
ar: Fr,
value: u64,
anchor: Scalar,
merkle_path: MerklePath<Node>
) -> Result<([u8; 192], ExtendedPoint, PublicKey), ()>; fn output_proof(
&self,
ctx: &mut Self::SaplingProvingContext,
esk: Fr,
payment_address: PaymentAddress,
rcm: Fr,
value: u64
) -> ([u8; 192], ExtendedPoint); fn binding_sig(
&self,
ctx: &mut Self::SaplingProvingContext,
value_balance: Amount,
sighash: &[u8; 32]
) -> Result<Signature, ()>; }
Expand description
Interface for creating zero-knowledge proofs for shielded transactions.
Associated Types
Type for persisting any necessary context across multiple Sapling proofs.
Required methods
fn new_sapling_proving_context(&self) -> Self::SaplingProvingContext
fn new_sapling_proving_context(&self) -> Self::SaplingProvingContext
Instantiate a new Sapling proving context.
fn spend_proof(
&self,
ctx: &mut Self::SaplingProvingContext,
proof_generation_key: ProofGenerationKey,
diversifier: Diversifier,
rseed: Rseed,
ar: Fr,
value: u64,
anchor: Scalar,
merkle_path: MerklePath<Node>
) -> Result<([u8; 192], ExtendedPoint, PublicKey), ()>
fn spend_proof(
&self,
ctx: &mut Self::SaplingProvingContext,
proof_generation_key: ProofGenerationKey,
diversifier: Diversifier,
rseed: Rseed,
ar: Fr,
value: u64,
anchor: Scalar,
merkle_path: MerklePath<Node>
) -> Result<([u8; 192], ExtendedPoint, PublicKey), ()>
Create the value commitment, re-randomized key, and proof for a Sapling
SpendDescription
, while accumulating its value commitment randomness inside
the context for later use.
fn output_proof(
&self,
ctx: &mut Self::SaplingProvingContext,
esk: Fr,
payment_address: PaymentAddress,
rcm: Fr,
value: u64
) -> ([u8; 192], ExtendedPoint)
fn output_proof(
&self,
ctx: &mut Self::SaplingProvingContext,
esk: Fr,
payment_address: PaymentAddress,
rcm: Fr,
value: u64
) -> ([u8; 192], ExtendedPoint)
Create the value commitment and proof for a Sapling OutputDescription
,
while accumulating its value commitment randomness inside the context for later
use.
fn binding_sig(
&self,
ctx: &mut Self::SaplingProvingContext,
value_balance: Amount,
sighash: &[u8; 32]
) -> Result<Signature, ()>
fn binding_sig(
&self,
ctx: &mut Self::SaplingProvingContext,
value_balance: Amount,
sighash: &[u8; 32]
) -> Result<Signature, ()>
Create the bindingSig
for a Sapling transaction. All calls to
TxProver::spend_proof
and TxProver::output_proof
must be completed before
calling this function.