Enum bdk::keys::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
Tuple Fields of SinglePub
XPub(DescriptorXKey<ExtendedPubKey>)
Xpub
Tuple Fields of 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>(
&self,
secp: &Secp256k1<C>
) -> Result<PublicKey, ConversionError> where
C: Verification,
pub fn derive_public_key<C>(
&self,
secp: &Secp256k1<C>
) -> Result<PublicKey, ConversionError> where
C: Verification,
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
type Err = DescriptorKeyParseError
type Err = DescriptorKeyParseError
The associated error which can be returned from parsing.
pub fn from_str(
s: &str
) -> Result<DescriptorPublicKey, <DescriptorPublicKey as FromStr>::Err>
pub fn from_str(
s: &str
) -> Result<DescriptorPublicKey, <DescriptorPublicKey as FromStr>::Err>
Parses a string s
to return a value of this type. Read more
Turn the key into a DescriptorKey
within the requested ScriptContext
type Hash = DescriptorPublicKey
type Hash = DescriptorPublicKey
The associated Hash type with the publicKey
Check if the publicKey is uncompressed. The default implementation returns false Read more
Converts an object to PublicHash
Computes the size of a public key when serialized in a script, including the length bytes 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
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
type Output = T
type Output = T
Should always be Self