Struct aigc_keychain::BlindingFactor
source · pub struct BlindingFactor(_);
Implementations§
source§impl BlindingFactor
impl BlindingFactor
pub fn from_secret_key(skey: SecretKey) -> BlindingFactor
pub fn from_slice(data: &[u8]) -> BlindingFactor
pub fn zero() -> BlindingFactor
pub fn is_zero(&self) -> bool
pub fn rand(secp: &Secp256k1) -> BlindingFactor
pub fn from_hex(hex: &str) -> Result<BlindingFactor, Error>
pub fn secret_key(&self, secp: &Secp256k1) -> Result<SecretKey, Error>
pub fn add( &self, other: &BlindingFactor, secp: &Secp256k1 ) -> Result<BlindingFactor, Error>
sourcepub fn split(
&self,
blind_1: &BlindingFactor,
secp: &Secp256k1
) -> Result<BlindingFactor, Error>
pub fn split( &self, blind_1: &BlindingFactor, secp: &Secp256k1 ) -> Result<BlindingFactor, Error>
Split a blinding_factor (aka secret_key) into a pair of blinding_factors. We use one of these (k1) to sign the tx_kernel (k1G) and the other gets aggregated in the block_header as the “offset”. This prevents an actor from being able to sum a set of inputs, outputs and kernels from a block to identify and reconstruct a particular tx from a block. You would need both k1, k2 to do this.
Trait Implementations§
source§impl AsRef<[u8]> for BlindingFactor
impl AsRef<[u8]> for BlindingFactor
source§impl Clone for BlindingFactor
impl Clone for BlindingFactor
source§fn clone(&self) -> BlindingFactor
fn clone(&self) -> BlindingFactor
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for BlindingFactor
impl Debug for BlindingFactor
source§impl Default for BlindingFactor
impl Default for BlindingFactor
source§fn default() -> BlindingFactor
fn default() -> BlindingFactor
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for BlindingFactor
impl<'de> Deserialize<'de> for BlindingFactor
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<BlindingFactor> for BlindingFactor
impl PartialEq<BlindingFactor> for BlindingFactor
source§fn eq(&self, other: &BlindingFactor) -> bool
fn eq(&self, other: &BlindingFactor) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for BlindingFactor
impl Serialize for BlindingFactor
source§impl Zeroize for BlindingFactor
impl Zeroize for BlindingFactor
impl StructuralPartialEq for BlindingFactor
Auto Trait Implementations§
impl RefUnwindSafe for BlindingFactor
impl Send for BlindingFactor
impl Sync for BlindingFactor
impl Unpin for BlindingFactor
impl UnwindSafe for BlindingFactor
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more