Struct coins_bip32::derived::DerivedPubkey

source ·
pub struct DerivedPubkey { /* private fields */ }
Expand description

A Pubkey with its derivation. Primarily used by PSBT.

Implementations§

source§

impl DerivedPubkey

source

pub fn to_sec1_bytes(&self) -> [u8; 33]

Get the compressed sec1 representation of the public key.

source§

impl DerivedPubkey

source

pub const fn new(key: VerifyingKey, derivation: KeyDerivation) -> Self

Instantiate a new DerivedPubkey

source

pub fn pubkey_hash160(&self) -> Hash160Digest

Return the hash of the compressed (Sec1) pubkey.

source

pub fn fingerprint(&self) -> KeyFingerprint

The fingerprint is the first 4 bytes of the HASH160 of the serialized public key.

Trait Implementations§

source§

impl AsRef<VerifyingKey<Secp256k1>> for DerivedPubkey

source§

fn as_ref(&self) -> &VerifyingKey

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Debug for DerivedPubkey

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl DerivedKey for DerivedPubkey

source§

fn derivation(&self) -> &KeyDerivation

Return this key’s derivation
source§

fn same_root<K: DerivedKey>(&self, other: &K) -> bool

true if the keys share a root fingerprint, false otherwise. Note that on key fingerprints, which may collide accidentally, or be intentionally collided.
source§

fn is_possible_ancestor_of<K: DerivedKey>(&self, other: &K) -> bool

true if this key is a possible ancestor of the argument, false otherwise. Read more
source§

fn path_to_descendant<K: DerivedKey>(&self, other: &K) -> Option<DerivationPath>

Returns the path to the descendant, or None if the argument is definitely not a descendant. Read more
source§

impl<D> DigestVerifier<D, Signature<Secp256k1>> for DerivedPubkey
where D: Digest + FixedOutput<OutputSize = U32>,

source§

fn verify_digest(&self, digest: D, signature: &Signature) -> Result<(), Error>

Verify the signature against the given Digest output.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.