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§
sourcefn inputs_committed(&self) -> Vec<Commitment>
fn inputs_committed(&self) -> Vec<Commitment>
Vector of input commitments to verify.
sourcefn outputs_committed(&self) -> Vec<Commitment>
fn outputs_committed(&self) -> Vec<Commitment>
Vector of output commitments to verify.
sourcefn kernels_committed(&self) -> Vec<Commitment>
fn kernels_committed(&self) -> Vec<Commitment>
Vector of kernel excesses to verify.
Provided Methods§
sourcefn sum_kernel_excesses(
&self,
offset: &BlindingFactor
) -> Result<(Commitment, Commitment), Error>
fn sum_kernel_excesses( &self, offset: &BlindingFactor ) -> Result<(Commitment, Commitment), Error>
Gather the kernel excesses and sum them.
sourcefn sum_commitments(&self, overage: i64) -> Result<Commitment, Error>
fn sum_commitments(&self, overage: i64) -> Result<Commitment, Error>
Gathers commitments and sum them.
sourcefn verify_kernel_sums(
&self,
overage: i64,
kernel_offset: BlindingFactor
) -> Result<(Commitment, Commitment), Error>
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)
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).