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
impl DerivedPubkey
sourcepub fn to_sec1_bytes(&self) -> [u8; 33]
pub fn to_sec1_bytes(&self) -> [u8; 33]
Get the compressed sec1 representation of the public key.
source§impl DerivedPubkey
impl DerivedPubkey
sourcepub const fn new(key: VerifyingKey, derivation: KeyDerivation) -> Self
pub const fn new(key: VerifyingKey, derivation: KeyDerivation) -> Self
Instantiate a new DerivedPubkey
sourcepub fn pubkey_hash160(&self) -> Hash160Digest
pub fn pubkey_hash160(&self) -> Hash160Digest
Return the hash of the compressed (Sec1) pubkey.
sourcepub fn fingerprint(&self) -> KeyFingerprint
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
impl AsRef<VerifyingKey<Secp256k1>> for DerivedPubkey
source§fn as_ref(&self) -> &VerifyingKey
fn as_ref(&self) -> &VerifyingKey
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Debug for DerivedPubkey
impl Debug for DerivedPubkey
source§impl DerivedKey for DerivedPubkey
impl DerivedKey for DerivedPubkey
source§fn derivation(&self) -> &KeyDerivation
fn derivation(&self) -> &KeyDerivation
Return this key’s derivation
source§fn same_root<K: DerivedKey>(&self, other: &K) -> bool
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
fn is_possible_ancestor_of<K: DerivedKey>(&self, other: &K) -> bool
source§fn path_to_descendant<K: DerivedKey>(&self, other: &K) -> Option<DerivationPath>
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 moresource§impl<D> DigestVerifier<D, Signature<Secp256k1>> for DerivedPubkey
impl<D> DigestVerifier<D, Signature<Secp256k1>> for DerivedPubkey
Auto Trait Implementations§
impl Freeze for DerivedPubkey
impl RefUnwindSafe for DerivedPubkey
impl Send for DerivedPubkey
impl Sync for DerivedPubkey
impl Unpin for DerivedPubkey
impl UnwindSafe for DerivedPubkey
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