pub struct DerivedXPub { /* private fields */ }
Expand description

An XPub with its derivation.

Implementations§

source§

impl DerivedXPub

source

pub fn to_sec1_bytes(&self) -> [u8; 33]

Get the compressed sec1 representation of the public key.

source§

impl DerivedXPub

source

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.

source

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

source§

fn as_ref(&self) -> &VerifyingKey

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<XKeyInfo> for DerivedXPub

source§

fn as_ref(&self) -> &XKeyInfo

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<XPub> for DerivedXPub

source§

fn as_ref(&self) -> &XPub

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for DerivedXPub

source§

fn clone(&self) -> DerivedXPub

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DerivedXPub

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl DerivedKey for DerivedXPub

source§

fn derivation(&self) -> &KeyDerivation

Return this key’s derivation
source§

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

true if this key is a possible ancestor of the argument, false otherwise. Read more
source§

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 more
source§

impl<'de> Deserialize<'de> for DerivedXPub

source§

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 DerivedXPubwhere D: Digest + FixedOutput<OutputSize = U32>,

source§

fn verify_digest(&self, digest: D, signature: &Signature) -> Result<(), Error>

Verify the signature against the given Digest output.
source§

impl Parent for DerivedXPub

source§

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>where E: Into<Bip32Error>, P: TryInto<DerivationPath, Error = E>,

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<DerivedXPub> for DerivedXPub

source§

fn eq(&self, other: &DerivedXPub) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for DerivedXPub

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for DerivedXPub

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,