[][src]Enum miniscript::DescriptorPublicKey

pub enum DescriptorPublicKey {
    SinglePub(DescriptorSinglePub),
    XPub(DescriptorXKey<ExtendedPubKey>),
}

The MiniscriptKey corresponding to Descriptors. This can either be Single public key or a Xpub

Variants

Single Public Key

Xpub

Implementations

impl DescriptorPublicKey[src]

pub fn master_fingerprint(&self) -> Fingerprint[src]

The fingerprint of the master key associated with this key

pub fn full_derivation_path(&self) -> DerivationPath[src]

Full path, from the master key

For wildcard keys this will return the path up to the wildcard, so you can get full paths by appending one additional derivation step, according to the wildcard type (hardened or normal)

pub fn is_deriveable(&self) -> bool[src]

Whether or not the key has a wildcards

pub fn derive(mut self: Self, index: u32) -> DescriptorPublicKey[src]

If this public key has a wildcard, replace it by the given index

Panics if given an index ≥ 2^31

pub fn derive_public_key<C: Verification>(
    &self,
    secp: &Secp256k1<C>
) -> Result<PublicKey, ConversionError>
[src]

Computes the public key corresponding to this descriptor key

Will return an error if the descriptor key has any hardened derivation steps in its path, or if the key has any wildcards.

To ensure there are no wildcards, call .derive(0) or similar; to avoid hardened derivation steps, start from a DescriptorSecretKey and call as_public, or call TranslatePk2::translate_pk2 with some function which has access to secret key data.

Trait Implementations

impl Clone for DescriptorPublicKey[src]

impl Debug for DescriptorPublicKey[src]

impl Display for DescriptorPublicKey[src]

impl Eq for DescriptorPublicKey[src]

impl FromStr for DescriptorPublicKey[src]

type Err = DescriptorKeyParseError

The associated error which can be returned from parsing.

impl Hash for DescriptorPublicKey[src]

impl MiniscriptKey for DescriptorPublicKey[src]

type Hash = Self

The associated Hash type with the publicKey

impl Ord for DescriptorPublicKey[src]

impl PartialEq<DescriptorPublicKey> for DescriptorPublicKey[src]

impl PartialOrd<DescriptorPublicKey> for DescriptorPublicKey[src]

impl StructuralEq for DescriptorPublicKey[src]

impl StructuralPartialEq for DescriptorPublicKey[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.