Struct coins_bip32::derived::DerivedXPub
source · pub struct DerivedXPub { /* private fields */ }
Expand description
An XPub with its derivation.
Implementations§
source§impl DerivedXPub
impl DerivedXPub
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 DerivedXPub
impl DerivedXPub
sourcepub const fn new(xpub: XPub, derivation: KeyDerivation) -> Self
pub const fn new(xpub: XPub, derivation: KeyDerivation) -> Self
Instantiate a derived XPub from the XPub and derivatin. This usually should not be called directly. Prefer deriving keys from parents.
sourcepub fn is_public_ancestor_of(
&self,
other: &DerivedXPub,
) -> Result<bool, Bip32Error>
pub fn is_public_ancestor_of( &self, other: &DerivedXPub, ) -> Result<bool, Bip32Error>
Check if this XPriv is the private ancestor of some other derived key
Trait Implementations§
source§impl AsRef<VerifyingKey<Secp256k1>> for DerivedXPub
impl AsRef<VerifyingKey<Secp256k1>> for DerivedXPub
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 AsRef<XKeyInfo> for DerivedXPub
impl AsRef<XKeyInfo> for DerivedXPub
source§impl AsRef<XPub> for DerivedXPub
impl AsRef<XPub> for DerivedXPub
source§impl Clone for DerivedXPub
impl Clone for DerivedXPub
source§fn clone(&self) -> DerivedXPub
fn clone(&self) -> DerivedXPub
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 Debug for DerivedXPub
impl Debug for DerivedXPub
source§impl DerivedKey for DerivedXPub
impl DerivedKey for DerivedXPub
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<'de> Deserialize<'de> for DerivedXPub
impl<'de> Deserialize<'de> for DerivedXPub
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<D> DigestVerifier<D, Signature<Secp256k1>> for DerivedXPub
impl<D> DigestVerifier<D, Signature<Secp256k1>> for DerivedXPub
source§impl Parent for DerivedXPub
impl Parent for DerivedXPub
source§fn derive_child(&self, index: u32) -> Result<Self, Bip32Error>
fn derive_child(&self, index: u32) -> Result<Self, Bip32Error>
Derive the child at
index
. Note that this may produce the child at
index+1
in rare circumstances. For public keys this will derive public
children. For private keys it will derive private children.source§fn derive_path<E, P>(&self, p: P) -> Result<Self, Bip32Error>
fn derive_path<E, P>(&self, p: P) -> Result<Self, Bip32Error>
Derive a series of child indices. Allows traversing several levels of the tree at once.
Accepts an iterator producing u32, or a string.
source§impl PartialEq for DerivedXPub
impl PartialEq for DerivedXPub
source§fn eq(&self, other: &DerivedXPub) -> bool
fn eq(&self, other: &DerivedXPub) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for DerivedXPub
impl Serialize for DerivedXPub
impl StructuralPartialEq for DerivedXPub
Auto Trait Implementations§
impl Freeze for DerivedXPub
impl RefUnwindSafe for DerivedXPub
impl Send for DerivedXPub
impl Sync for DerivedXPub
impl Unpin for DerivedXPub
impl UnwindSafe for DerivedXPub
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)