logo
pub enum DescriptorPublicKey {
    Single(SinglePub),
    XPub(DescriptorXKey<ExtendedPubKey>),
}
Expand description

The descriptor pubkey, either a single pubkey or an xpub.

Variants

Single(SinglePub)

Single public key.

XPub(DescriptorXKey<ExtendedPubKey>)

Extended public key (xpub).

Implementations

The fingerprint of the master key associated with this key, 0x00000000 if none.

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)

👎 Deprecated:

use has_wildcard instead

Whether or not the key has a wildcard

Whether or not the key has a wildcard

👎 Deprecated:

use at_derivation_index instead

Deprecated name of [at_derivation_index].

Replaces any wildcard (i.e. /*) in the key with a particular derivation index, turning it into a definite key (i.e. one where all the derivation paths are set).

Returns
  • If this key is not an xpub, returns self.
  • If this key is an xpub but does not have a wildcard, returns self.
  • Otherwise, returns the xpub at derivation index (removing the wildcard).
Panics

If index ≥ 2^31

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Turn the key into a DescriptorKey within the requested ScriptContext

The associated [sha256::Hash] for this [MiniscriptKey], used in the hash256 fragment. Read more

The associated [hash256::Hash] for this [MiniscriptKey], used in the hash256 fragment. Read more

The associated [ripedmd160::Hash] for this [MiniscriptKey] type. used in the ripemd160 fragment Read more

The associated [hash160::Hash] for this [MiniscriptKey] type. used in the hash160 fragment Read more

Returns true if the pubkey is uncompressed. Defaults to false.

Returns true if the pubkey is an x-only pubkey. Defaults to false.

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.