BlindValueProofs

Trait BlindValueProofs 

Source
pub trait BlindValueProofs: Sized {
    // Required methods
    fn blind_value_proof<C: Signing, R: RngCore + CryptoRng>(
        rng: &mut R,
        secp: &Secp256k1<C>,
        explicit_val: u64,
        value_commit: PedersenCommitment,
        asset_gen: Generator,
        vbf: ValueBlindingFactor,
    ) -> Result<Self, Error>;
    fn blind_value_proof_verify<C: Verification>(
        &self,
        secp: &Secp256k1<C>,
        explicit_val: u64,
        asset_gen: Generator,
        value_commit: PedersenCommitment,
    ) -> bool;
}
Expand description

A trait to create and verify explicit rangeproofs

Required Methods§

Source

fn blind_value_proof<C: Signing, R: RngCore + CryptoRng>( rng: &mut R, secp: &Secp256k1<C>, explicit_val: u64, value_commit: PedersenCommitment, asset_gen: Generator, vbf: ValueBlindingFactor, ) -> Result<Self, Error>

Outputs a [RangeProof] that blinded value corresponfs to unblinded explicit value

Source

fn blind_value_proof_verify<C: Verification>( &self, secp: &Secp256k1<C>, explicit_val: u64, asset_gen: Generator, value_commit: PedersenCommitment, ) -> bool

Verify that the Rangeproof proves that commitment is actually bound to the explicit value

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.

Implementations on Foreign Types§

Source§

impl BlindValueProofs for RangeProof

Source§

fn blind_value_proof<C: Signing, R: RngCore + CryptoRng>( rng: &mut R, secp: &Secp256k1<C>, explicit_val: u64, value_commit: PedersenCommitment, asset_gen: Generator, vbf: ValueBlindingFactor, ) -> Result<Self, Error>

Outputs a RangeProof that blinded value_commit corresponds to explicit value

Source§

fn blind_value_proof_verify<C: Verification>( &self, secp: &Secp256k1<C>, explicit_val: u64, asset_gen: Generator, value_commit: PedersenCommitment, ) -> bool

Verify that the Rangeproof proves that commitment is actually bound to the explicit value

Implementors§