Enum sapio_miniscript::DescriptorPublicKey [−][src]
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
impl DescriptorPublicKey
[src]
pub fn master_fingerprint(&self) -> Fingerprint
[src]
The fingerprint of the master key associated with this key
pub fn full_derivation_path(&self) -> DerivationPath
[src]
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)
pub fn is_deriveable(&self) -> bool
[src]
Whether or not the key has a wildcards
pub fn derive(self, index: u32) -> DescriptorPublicKey
[src]
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>
[src]
&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
impl Clone for DescriptorPublicKey
[src]
fn clone(&self) -> DescriptorPublicKey
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for DescriptorPublicKey
[src]
impl Display for DescriptorPublicKey
[src]
impl Eq for DescriptorPublicKey
[src]
impl FromStr for DescriptorPublicKey
[src]
type Err = DescriptorKeyParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for DescriptorPublicKey
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl MiniscriptKey for DescriptorPublicKey
[src]
type Hash = Self
The associated Hash type with the publicKey
fn is_uncompressed(&self) -> bool
[src]
fn to_pubkeyhash(&self) -> Self
[src]
fn serialized_len(&self) -> usize
[src]
impl Ord for DescriptorPublicKey
[src]
fn cmp(&self, other: &DescriptorPublicKey) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<DescriptorPublicKey> for DescriptorPublicKey
[src]
fn eq(&self, other: &DescriptorPublicKey) -> bool
[src]
fn ne(&self, other: &DescriptorPublicKey) -> bool
[src]
impl PartialOrd<DescriptorPublicKey> for DescriptorPublicKey
[src]
fn partial_cmp(&self, other: &DescriptorPublicKey) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for DescriptorPublicKey
[src]
impl StructuralPartialEq for DescriptorPublicKey
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,