pub struct DefiniteDescriptorKey(/* private fields */);
Expand description
A DescriptorPublicKey
without any wildcards.
Implementations§
Source§impl DefiniteDescriptorKey
impl DefiniteDescriptorKey
Sourcepub 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.
When deriving from an XOnlyPublicKey, it adds the default 0x02 y-coordinate
and returns the obtained full bitcoin::PublicKey
. All BIP32 derivations
always return a compressed key
Will return an error if the descriptor key has any hardened derivation steps in its path. To
avoid this error you should replace any such public keys first with translate_pk
.
Sourcepub fn master_fingerprint(&self) -> Fingerprint
pub fn master_fingerprint(&self) -> Fingerprint
The fingerprint of the master key associated with this key, 0x00000000
if none.
Sourcepub fn full_derivation_path(&self) -> Option<DerivationPath>
pub fn full_derivation_path(&self) -> Option<DerivationPath>
Full path from the master key if not a multipath extended key.
Sourcepub fn as_descriptor_public_key(&self) -> &DescriptorPublicKey
pub fn as_descriptor_public_key(&self) -> &DescriptorPublicKey
Reference to the underlying DescriptorPublicKey
Sourcepub fn into_descriptor_public_key(self) -> DescriptorPublicKey
pub fn into_descriptor_public_key(self) -> DescriptorPublicKey
Converts the definite key into a generic one
Trait Implementations§
Source§impl Borrow<DescriptorPublicKey> for DefiniteDescriptorKey
impl Borrow<DescriptorPublicKey> for DefiniteDescriptorKey
Source§fn borrow(&self) -> &DescriptorPublicKey
fn borrow(&self) -> &DescriptorPublicKey
Immutably borrows from an owned value. Read more
Source§impl Clone for DefiniteDescriptorKey
impl Clone for DefiniteDescriptorKey
Source§fn clone(&self) -> DefiniteDescriptorKey
fn clone(&self) -> DefiniteDescriptorKey
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DefiniteDescriptorKey
impl Debug for DefiniteDescriptorKey
Source§impl Display for DefiniteDescriptorKey
impl Display for DefiniteDescriptorKey
Source§impl From<DefiniteDescriptorKey> for DescriptorPublicKey
impl From<DefiniteDescriptorKey> for DescriptorPublicKey
Source§fn from(d: DefiniteDescriptorKey) -> Self
fn from(d: DefiniteDescriptorKey) -> Self
Converts to this type from the input type.
Source§impl FromStr for DefiniteDescriptorKey
impl FromStr for DefiniteDescriptorKey
Source§impl Hash for DefiniteDescriptorKey
impl Hash for DefiniteDescriptorKey
Source§impl MiniscriptKey for DefiniteDescriptorKey
impl MiniscriptKey for DefiniteDescriptorKey
Source§type Sha256 = Hash
type Sha256 = Hash
The associated
bitcoin::hashes::sha256::Hash
for this MiniscriptKey
, used in the
sha256 fragment.Source§type Hash256 = Hash
type Hash256 = Hash
The associated
miniscript::hash256::Hash
for this MiniscriptKey
, used in the
hash256 fragment.Source§type Ripemd160 = Hash
type Ripemd160 = Hash
The associated
bitcoin::hashes::ripemd160::Hash
for this MiniscriptKey
type, used
in the ripemd160 fragment.Source§type Hash160 = Hash
type Hash160 = Hash
The associated
bitcoin::hashes::hash160::Hash
for this MiniscriptKey
type, used in
the hash160 fragment.Source§fn is_uncompressed(&self) -> bool
fn is_uncompressed(&self) -> bool
Returns true if the pubkey is uncompressed. Defaults to
false
.Source§fn is_x_only_key(&self) -> bool
fn is_x_only_key(&self) -> bool
Returns true if the pubkey is an x-only pubkey. Defaults to
false
.Source§fn num_der_paths(&self) -> usize
fn num_der_paths(&self) -> usize
Returns the number of different derivation paths in this key. Only >1 for keys
in BIP389 multipath descriptors.
Source§impl Ord for DefiniteDescriptorKey
impl Ord for DefiniteDescriptorKey
Source§fn cmp(&self, other: &DefiniteDescriptorKey) -> Ordering
fn cmp(&self, other: &DefiniteDescriptorKey) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for DefiniteDescriptorKey
impl PartialEq for DefiniteDescriptorKey
Source§impl PartialOrd for DefiniteDescriptorKey
impl PartialOrd for DefiniteDescriptorKey
Source§impl ToPublicKey for DefiniteDescriptorKey
impl ToPublicKey for DefiniteDescriptorKey
Source§fn to_public_key(&self) -> PublicKey
fn to_public_key(&self) -> PublicKey
Converts an object to a public key
Source§fn to_sha256(hash: &Hash) -> Hash
fn to_sha256(hash: &Hash) -> Hash
Converts the generic associated
MiniscriptKey::Sha256
to sha256::Hash
Source§fn to_hash256(hash: &Hash) -> Hash
fn to_hash256(hash: &Hash) -> Hash
Converts the generic associated
MiniscriptKey::Hash256
to hash256::Hash
Source§fn to_ripemd160(hash: &Hash) -> Hash
fn to_ripemd160(hash: &Hash) -> Hash
Converts the generic associated
MiniscriptKey::Ripemd160
to ripemd160::Hash
Source§fn to_hash160(hash: &Hash) -> Hash
fn to_hash160(hash: &Hash) -> Hash
Converts the generic associated
MiniscriptKey::Hash160
to hash160::Hash
Source§fn to_x_only_pubkey(&self) -> XOnlyPublicKey
fn to_x_only_pubkey(&self) -> XOnlyPublicKey
Convert an object to x-only pubkey
Source§fn to_pubkeyhash(&self, sig_type: SigType) -> Hash
fn to_pubkeyhash(&self, sig_type: SigType) -> Hash
Obtain the public key hash for this MiniscriptKey
Expects an argument to specify the signature type.
This would determine whether to serialize the key as 32 byte x-only pubkey
or regular public key when computing the hash160
impl Eq for DefiniteDescriptorKey
impl StructuralPartialEq for DefiniteDescriptorKey
Auto Trait Implementations§
impl Freeze for DefiniteDescriptorKey
impl RefUnwindSafe for DefiniteDescriptorKey
impl Send for DefiniteDescriptorKey
impl Sync for DefiniteDescriptorKey
impl Unpin for DefiniteDescriptorKey
impl UnwindSafe for DefiniteDescriptorKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromStrKey for Twhere
T: MiniscriptKey + FromStr,
<T as MiniscriptKey>::Sha256: FromStr,
<T as MiniscriptKey>::Hash256: FromStr,
<T as MiniscriptKey>::Ripemd160: FromStr,
<T as MiniscriptKey>::Hash160: FromStr,
<T as FromStr>::Err: Debug + Display,
<<T as MiniscriptKey>::Sha256 as FromStr>::Err: Debug + Display,
<<T as MiniscriptKey>::Hash256 as FromStr>::Err: Debug + Display,
<<T as MiniscriptKey>::Ripemd160 as FromStr>::Err: Debug + Display,
<<T as MiniscriptKey>::Hash160 as FromStr>::Err: Debug + Display,
impl<T> FromStrKey for Twhere
T: MiniscriptKey + FromStr,
<T as MiniscriptKey>::Sha256: FromStr,
<T as MiniscriptKey>::Hash256: FromStr,
<T as MiniscriptKey>::Ripemd160: FromStr,
<T as MiniscriptKey>::Hash160: FromStr,
<T as FromStr>::Err: Debug + Display,
<<T as MiniscriptKey>::Sha256 as FromStr>::Err: Debug + Display,
<<T as MiniscriptKey>::Hash256 as FromStr>::Err: Debug + Display,
<<T as MiniscriptKey>::Ripemd160 as FromStr>::Err: Debug + Display,
<<T as MiniscriptKey>::Hash160 as FromStr>::Err: Debug + Display,
Source§type _Sha256 = <T as MiniscriptKey>::Sha256
type _Sha256 = <T as MiniscriptKey>::Sha256
Dummy type. Do not use.
Source§type _Sha256FromStrErr = <<T as MiniscriptKey>::Sha256 as FromStr>::Err
type _Sha256FromStrErr = <<T as MiniscriptKey>::Sha256 as FromStr>::Err
Dummy type. Do not use.
Source§type _Hash256 = <T as MiniscriptKey>::Hash256
type _Hash256 = <T as MiniscriptKey>::Hash256
Dummy type. Do not use.
Source§type _Hash256FromStrErr = <<T as MiniscriptKey>::Hash256 as FromStr>::Err
type _Hash256FromStrErr = <<T as MiniscriptKey>::Hash256 as FromStr>::Err
Dummy type. Do not use.
Source§type _Ripemd160 = <T as MiniscriptKey>::Ripemd160
type _Ripemd160 = <T as MiniscriptKey>::Ripemd160
Dummy type. Do not use.
Source§type _Ripemd160FromStrErr = <<T as MiniscriptKey>::Ripemd160 as FromStr>::Err
type _Ripemd160FromStrErr = <<T as MiniscriptKey>::Ripemd160 as FromStr>::Err
Dummy type. Do not use.
Source§type _Hash160 = <T as MiniscriptKey>::Hash160
type _Hash160 = <T as MiniscriptKey>::Hash160
Dummy type. Do not use.
Source§type _Hash160FromStrErr = <<T as MiniscriptKey>::Hash160 as FromStr>::Err
type _Hash160FromStrErr = <<T as MiniscriptKey>::Hash160 as FromStr>::Err
Dummy type. Do not use.
Source§type _FromStrErr = <T as FromStr>::Err
type _FromStrErr = <T as FromStr>::Err
Dummy type. Do not use.