pub struct Xpub { /* private fields */ }
Implementations§
source§impl Xpub
impl Xpub
pub fn decode(data: impl Borrow<[u8]>) -> Result<Xpub, XpubDecodeError>
pub fn encode(&self) -> [u8; 78]
sourcepub fn identifier(&self) -> XpubId
pub fn identifier(&self) -> XpubId
Returns the HASH160 of the chaincode
pub fn fingerprint(&self) -> XpubFp
sourcepub fn to_legacy_pub(&self) -> LegacyPk
pub fn to_legacy_pub(&self) -> LegacyPk
Constructs ECDSA public key valid in legacy context (compressed by default).
sourcepub fn to_compr_pub(&self) -> CompressedPk
pub fn to_compr_pub(&self) -> CompressedPk
Constructs ECDSA public key.
sourcepub fn to_xonly_pub(&self) -> XOnlyPk
pub fn to_xonly_pub(&self) -> XOnlyPk
Constructs BIP340 public key matching internal public key representation.
sourcepub fn derive_pub(&self, path: impl AsRef<[NormalIndex]>) -> Self
pub fn derive_pub(&self, path: impl AsRef<[NormalIndex]>) -> Self
Attempts to derive an extended public key from a path.
The path
argument can be any type implementing AsRef<ChildNumber>
, such as
DerivationPath
, for instance.
sourcepub fn ckd_pub_tweak(&self, child_no: NormalIndex) -> (Scalar, ChainCode)
pub fn ckd_pub_tweak(&self, child_no: NormalIndex) -> (Scalar, ChainCode)
Compute the scalar tweak added to this key to get a child key
sourcepub fn ckd_pub(&self, child_no: NormalIndex) -> Xpub
pub fn ckd_pub(&self, child_no: NormalIndex) -> Xpub
Public->Public child key derivation
Trait Implementations§
source§impl PartialEq for Xpub
impl PartialEq for Xpub
impl Copy for Xpub
impl Eq for Xpub
impl StructuralPartialEq for Xpub
Auto Trait Implementations§
impl Freeze for Xpub
impl RefUnwindSafe for Xpub
impl Send for Xpub
impl Sync for Xpub
impl Unpin for Xpub
impl UnwindSafe for Xpub
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.