pub struct Xpub { /* private fields */ }
Implementations§
Source§impl Xpub
impl Xpub
pub fn decode(data: impl Borrow<[u8]>) -> Result<Xpub, XkeyDecodeError>
pub fn encode(&self) -> [u8; 78]
pub fn is_testnet(&self) -> bool
pub fn depth(&self) -> u8
pub fn child_number(&self) -> DerivationIndex
pub fn parent_fp(&self) -> XpubFp
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_pk(&self) -> LegacyPk
pub fn to_legacy_pk(&self) -> LegacyPk
Constructs ECDSA public key valid in legacy context (compressed by default).
Sourcepub fn to_compr_pk(&self) -> CompressedPk
pub fn to_compr_pk(&self) -> CompressedPk
Constructs ECDSA public key.
Sourcepub fn to_xonly_pk(&self) -> XOnlyPk
pub fn to_xonly_pk(&self) -> XOnlyPk
Constructs BIP340 public key matching internal public key representation.
Sourcepub fn derive_pub(&self, path: impl AsRef<[NormalIndex]>) -> Xpub
pub fn derive_pub(&self, path: impl AsRef<[NormalIndex]>) -> Xpub
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
pub fn chain_code(&self) -> ChainCode
Trait Implementations§
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.