Trait grin_core::core::committed::Committed

source ·
pub trait Committed {
    // Required methods
    fn inputs_committed(&self) -> Vec<Commitment>;
    fn outputs_committed(&self) -> Vec<Commitment>;
    fn kernels_committed(&self) -> Vec<Commitment>;

    // Provided methods
    fn sum_kernel_excesses(
        &self,
        offset: &BlindingFactor
    ) -> Result<(Commitment, Commitment), Error> { ... }
    fn sum_commitments(&self, overage: i64) -> Result<Commitment, Error> { ... }
    fn verify_kernel_sums(
        &self,
        overage: i64,
        kernel_offset: BlindingFactor
    ) -> Result<(Commitment, Commitment), Error> { ... }
}
Expand description

Implemented by types that hold inputs and outputs (and kernels) containing Pedersen commitments. Handles the collection of the commitments as well as their summing, taking potential explicit overages of fees into account.

Required Methods§

source

fn inputs_committed(&self) -> Vec<Commitment>

Vector of input commitments to verify.

source

fn outputs_committed(&self) -> Vec<Commitment>

Vector of output commitments to verify.

source

fn kernels_committed(&self) -> Vec<Commitment>

Vector of kernel excesses to verify.

Provided Methods§

source

fn sum_kernel_excesses( &self, offset: &BlindingFactor ) -> Result<(Commitment, Commitment), Error>

Gather the kernel excesses and sum them.

source

fn sum_commitments(&self, overage: i64) -> Result<Commitment, Error>

Gathers commitments and sum them.

source

fn verify_kernel_sums( &self, overage: i64, kernel_offset: BlindingFactor ) -> Result<(Commitment, Commitment), Error>

Verify the sum of the kernel excesses equals the sum of the outputs, taking into account both the kernel_offset and overage.

Implementations on Foreign Types§

source§

impl<'a> Committed for (BlockSums, &'a dyn Committed)

It’s a tuple but we can verify the “full” kernel sums on it. This means we can take a previous block_sums, apply a new block to it and verify the full kernel sums (full UTXO and kernel sets).

Implementors§

source§

impl Committed for Block

Provides all information from a block that allows the calculation of total Pedersen commitment.

source§

impl Committed for Transaction

source§

impl Committed for TransactionBody