Struct miniscript::DefiniteDescriptorKey
source · [−]pub struct DefiniteDescriptorKey(_);
Expand description
A DescriptorPublicKey
without any wildcards.
Implementations
sourceimpl 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) -> DerivationPath
pub fn full_derivation_path(&self) -> DerivationPath
Full path, from the master key
Trait Implementations
sourceimpl Clone for DefiniteDescriptorKey
impl Clone for DefiniteDescriptorKey
sourcefn clone(&self) -> DefiniteDescriptorKey
fn clone(&self) -> DefiniteDescriptorKey
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for DefiniteDescriptorKey
impl Debug for DefiniteDescriptorKey
sourceimpl Display for DefiniteDescriptorKey
impl Display for DefiniteDescriptorKey
sourceimpl From<DefiniteDescriptorKey> for DescriptorPublicKey
impl From<DefiniteDescriptorKey> for DescriptorPublicKey
sourcefn from(d: DefiniteDescriptorKey) -> Self
fn from(d: DefiniteDescriptorKey) -> Self
Converts to this type from the input type.
sourceimpl FromStr for DefiniteDescriptorKey
impl FromStr for DefiniteDescriptorKey
sourceimpl Hash for DefiniteDescriptorKey
impl Hash for DefiniteDescriptorKey
sourceimpl MiniscriptKey for DefiniteDescriptorKey
impl MiniscriptKey for DefiniteDescriptorKey
type Sha256 = Hash
type Sha256 = Hash
type Ripemd160 = Hash
type Ripemd160 = Hash
The associated [
ripedmd160::Hash
] for this MiniscriptKey
type.
used in the ripemd160 fragment Read moretype Hash160 = Hash
type Hash160 = Hash
sourcefn is_uncompressed(&self) -> bool
fn is_uncompressed(&self) -> bool
Returns true if the pubkey is uncompressed. Defaults to
false
.sourcefn 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
.sourceimpl Ord for DefiniteDescriptorKey
impl Ord for DefiniteDescriptorKey
sourcefn cmp(&self, other: &DefiniteDescriptorKey) -> Ordering
fn cmp(&self, other: &DefiniteDescriptorKey) -> Ordering
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<DefiniteDescriptorKey> for DefiniteDescriptorKey
impl PartialEq<DefiniteDescriptorKey> for DefiniteDescriptorKey
sourcefn eq(&self, other: &DefiniteDescriptorKey) -> bool
fn eq(&self, other: &DefiniteDescriptorKey) -> bool
sourceimpl PartialOrd<DefiniteDescriptorKey> for DefiniteDescriptorKey
impl PartialOrd<DefiniteDescriptorKey> for DefiniteDescriptorKey
sourcefn partial_cmp(&self, other: &DefiniteDescriptorKey) -> Option<Ordering>
fn partial_cmp(&self, other: &DefiniteDescriptorKey) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl ToPublicKey for DefiniteDescriptorKey
impl ToPublicKey for DefiniteDescriptorKey
sourcefn to_public_key(&self) -> PublicKey
fn to_public_key(&self) -> PublicKey
Converts an object to a public key
sourcefn to_sha256(hash: &Hash) -> Hash
fn to_sha256(hash: &Hash) -> Hash
Converts the generic associated
MiniscriptKey::Sha256
to [sha256::Hash
]sourcefn to_hash256(hash: &Hash) -> Hash
fn to_hash256(hash: &Hash) -> Hash
Converts the generic associated
MiniscriptKey::Hash256
to hash256::Hash
sourcefn to_ripemd160(hash: &Hash) -> Hash
fn to_ripemd160(hash: &Hash) -> Hash
Converts the generic associated
MiniscriptKey::Ripemd160
to [ripemd160::Hash
]sourcefn to_hash160(hash: &Hash) -> Hash
fn to_hash160(hash: &Hash) -> Hash
Converts the generic associated
MiniscriptKey::Hash160
to [hash160::Hash
]sourcefn to_x_only_pubkey(&self) -> XOnlyPublicKey
fn to_x_only_pubkey(&self) -> XOnlyPublicKey
Convert an object to x-only pubkey
sourcefn 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 Read more
impl Eq for DefiniteDescriptorKey
impl StructuralEq for DefiniteDescriptorKey
impl StructuralPartialEq for DefiniteDescriptorKey
Auto Trait Implementations
impl RefUnwindSafe for DefiniteDescriptorKey
impl Send for DefiniteDescriptorKey
impl Sync for DefiniteDescriptorKey
impl Unpin for DefiniteDescriptorKey
impl UnwindSafe for DefiniteDescriptorKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more