Enum elements_miniscript::DescriptorPublicKey [−][src]
pub enum DescriptorPublicKey { SinglePub(DescriptorSinglePub), XPub(DescriptorXKey<ExtendedPubKey>), }
Expand description
The MiniscriptKey corresponding to Descriptors. This can either be Single public key or a Xpub
Variants
SinglePub(DescriptorSinglePub)
Single Public Key
XPub(DescriptorXKey<ExtendedPubKey>)
Xpub
Implementations
The fingerprint of the master key associated with this key
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)
Whether or not the key has a wildcards
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>
pub fn derive_public_key<C: Verification>(
&self,
secp: &Secp256k1<C>
) -> Result<PublicKey, ConversionError>
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
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
Auto Trait Implementations
impl RefUnwindSafe for DescriptorPublicKey
impl Send for DescriptorPublicKey
impl Sync for DescriptorPublicKey
impl Unpin for DescriptorPublicKey
impl UnwindSafe for DescriptorPublicKey
Blanket Implementations
Mutably borrows from an owned value. Read more