pub enum DescriptorPublicKey {
    Single(SinglePub),
    XPub(DescriptorXKey<Xpub>),
    MultiXPub(DescriptorMultiXKey<Xpub>),
}
Expand description

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

Variants§

§

Single(SinglePub)

Single public key.

§

XPub(DescriptorXKey<Xpub>)

Extended public key (xpub).

§

MultiXPub(DescriptorMultiXKey<Xpub>)

Multiple extended public keys.

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).

For multipath extended keys, this returns None.

Returns a vector containing the full derivation paths from the master key. The vector will contain just one element for single keys, and multiple elements for multipath extended keys.

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 for Self::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).
Errors
  • If index is hardened.

Whether or not this key has multiple derivation paths.

Get as many keys as derivation paths in this key.

For raw public key and single-path extended keys it will return the key itself. For multipath extended keys it will return a single-path extended key per derivation path.

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
Deserialize this value from the given Serde deserializer. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
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
Convert self into a Assets struct
Turn the key into a DescriptorKey within the requested ScriptContext
The associated [bitcoin::hashes::sha256::Hash] for this [MiniscriptKey], used in the sha256 fragment. Read more
The associated [miniscript::hash256::Hash] for this [MiniscriptKey], used in the hash256 fragment. Read more
The associated [bitcoin::hashes::ripemd160::Hash] for this [MiniscriptKey] type, used in the ripemd160 fragment. Read more
The associated [bitcoin::hashes::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.
Returns the number of different derivation paths in this key. Only >1 for keys in BIP389 multipath descriptors. Read more
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 !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
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
Serialize this value into the given Serde serializer. 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

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.