Struct kaspa_bip32::ExtendedPublicKey
source · pub struct ExtendedPublicKey<K: PublicKey> {
pub public_key: K,
pub attrs: ExtendedKeyAttrs,
}
Expand description
Extended public secp256k1 ECDSA verification key. Extended public keys derived using BIP32.
Generic around a PublicKey
type.
Fields§
§public_key: K
Derived public key
attrs: ExtendedKeyAttrs
Extended key attributes.
Implementations§
source§impl<K> ExtendedPublicKey<K>where
K: PublicKey,
impl<K> ExtendedPublicKey<K>where
K: PublicKey,
sourcepub fn public_key(&self) -> &K
pub fn public_key(&self) -> &K
Obtain the non-extended public key value K
.
sourcepub fn attrs(&self) -> &ExtendedKeyAttrs
pub fn attrs(&self) -> &ExtendedKeyAttrs
Get attributes for this key such as depth, parent fingerprint, child number, and chain code.
sourcepub fn fingerprint(&self) -> KeyFingerprint
pub fn fingerprint(&self) -> KeyFingerprint
Compute a 4-byte key fingerprint for this extended public key.
sourcepub fn derive_child(&self, child_number: ChildNumber) -> Result<Self>
pub fn derive_child(&self, child_number: ChildNumber) -> Result<Self>
Derive a child key for a particular ChildNumber
.
pub fn derive_path(self, path: DerivationPath) -> Result<Self>
sourcepub fn to_bytes(&self) -> PublicKeyBytes
pub fn to_bytes(&self) -> PublicKeyBytes
Serialize the raw public key as a byte array (e.g. SEC1-encoded).
sourcepub fn to_extended_key(&self, prefix: Prefix) -> ExtendedKey
pub fn to_extended_key(&self, prefix: Prefix) -> ExtendedKey
Serialize this key as an ExtendedKey
.
pub fn to_string(&self, prefix: Option<Prefix>) -> String
pub fn from_public_key(public_key: K, attrs: &ExtendedKeyAttrs) -> Self
Trait Implementations§
source§impl<K> BorshDeserialize for ExtendedPublicKey<K>where
K: PublicKey,
impl<K> BorshDeserialize for ExtendedPublicKey<K>where
K: PublicKey,
source§impl<K> BorshSerialize for ExtendedPublicKey<K>where
K: PublicKey,
impl<K> BorshSerialize for ExtendedPublicKey<K>where
K: PublicKey,
source§impl<K: Clone + PublicKey> Clone for ExtendedPublicKey<K>
impl<K: Clone + PublicKey> Clone for ExtendedPublicKey<K>
source§fn clone(&self) -> ExtendedPublicKey<K>
fn clone(&self) -> ExtendedPublicKey<K>
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<'de, K> Deserialize<'de> for ExtendedPublicKey<K>where
K: Deserialize<'de> + PublicKey + 'de,
impl<'de, K> Deserialize<'de> for ExtendedPublicKey<K>where
K: Deserialize<'de> + PublicKey + 'de,
source§fn deserialize<D>(deserializer: D) -> Result<ExtendedPublicKey<K>, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<ExtendedPublicKey<K>, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for ExtendedPublicKey<PublicKey>
impl Display for ExtendedPublicKey<PublicKey>
source§impl<K> From<&ExtendedPrivateKey<K>> for ExtendedPublicKey<K::PublicKey>where
K: PrivateKey,
impl<K> From<&ExtendedPrivateKey<K>> for ExtendedPublicKey<K::PublicKey>where
K: PrivateKey,
source§fn from(xprv: &ExtendedPrivateKey<K>) -> ExtendedPublicKey<K::PublicKey>
fn from(xprv: &ExtendedPrivateKey<K>) -> ExtendedPublicKey<K::PublicKey>
Converts to this type from the input type.
source§impl From<ExtendedPublicKey<PublicKey>> for XPub
impl From<ExtendedPublicKey<PublicKey>> for XPub
source§fn from(inner: ExtendedPublicKey<PublicKey>) -> Self
fn from(inner: ExtendedPublicKey<PublicKey>) -> Self
Converts to this type from the input type.
source§impl<K> FromStr for ExtendedPublicKey<K>where
K: PublicKey,
impl<K> FromStr for ExtendedPublicKey<K>where
K: PublicKey,
source§impl<K: Ord + PublicKey> Ord for ExtendedPublicKey<K>
impl<K: Ord + PublicKey> Ord for ExtendedPublicKey<K>
source§fn cmp(&self, other: &ExtendedPublicKey<K>) -> Ordering
fn cmp(&self, other: &ExtendedPublicKey<K>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<K: PartialEq + PublicKey> PartialEq for ExtendedPublicKey<K>
impl<K: PartialEq + PublicKey> PartialEq for ExtendedPublicKey<K>
source§fn eq(&self, other: &ExtendedPublicKey<K>) -> bool
fn eq(&self, other: &ExtendedPublicKey<K>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<K: PartialOrd + PublicKey> PartialOrd for ExtendedPublicKey<K>
impl<K: PartialOrd + PublicKey> PartialOrd for ExtendedPublicKey<K>
source§fn partial_cmp(&self, other: &ExtendedPublicKey<K>) -> Option<Ordering>
fn partial_cmp(&self, other: &ExtendedPublicKey<K>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<K> Serialize for ExtendedPublicKey<K>
impl<K> Serialize for ExtendedPublicKey<K>
source§impl<K> TryFrom<ExtendedKey> for ExtendedPublicKey<K>where
K: PublicKey,
impl<K> TryFrom<ExtendedKey> for ExtendedPublicKey<K>where
K: PublicKey,
source§fn try_from(extended_key: ExtendedKey) -> Result<ExtendedPublicKey<K>>
fn try_from(extended_key: ExtendedKey) -> Result<ExtendedPublicKey<K>>
Performs the conversion.
impl<K: Eq + PublicKey> Eq for ExtendedPublicKey<K>
impl<K: PublicKey> StructuralEq for ExtendedPublicKey<K>
impl<K: PublicKey> StructuralPartialEq for ExtendedPublicKey<K>
Auto Trait Implementations§
impl<K> RefUnwindSafe for ExtendedPublicKey<K>where
K: RefUnwindSafe,
impl<K> Send for ExtendedPublicKey<K>where
K: Send,
impl<K> Sync for ExtendedPublicKey<K>where
K: Sync,
impl<K> Unpin for ExtendedPublicKey<K>where
K: Unpin,
impl<K> UnwindSafe for ExtendedPublicKey<K>where
K: UnwindSafe,
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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