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)
Expand description
Single Public Key
XPub(DescriptorXKey<ExtendedPubKey>)
Expand description
Xpub
Implementations
impl DescriptorPublicKey
[src]
impl DescriptorPublicKey
[src]pub fn master_fingerprint(&self) -> Fingerprint
[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]
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]
pub fn is_deriveable(&self) -> bool
[src]Whether or not the key has a wildcards
pub fn derive(self, index: u32) -> DescriptorPublicKey
[src]
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>(
&self,
secp: &Secp256k1<C>
) -> Result<PublicKey, ConversionError> where
C: Verification,
[src]
pub fn derive_public_key<C>(
&self,
secp: &Secp256k1<C>
) -> Result<PublicKey, ConversionError> where
C: Verification,
[src]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]
impl Clone for DescriptorPublicKey
[src]pub fn clone(&self) -> DescriptorPublicKey
[src]
pub fn clone(&self) -> DescriptorPublicKey
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for DescriptorPublicKey
[src]
impl Debug for DescriptorPublicKey
[src]impl Display for DescriptorPublicKey
[src]
impl Display for DescriptorPublicKey
[src]impl FromStr for DescriptorPublicKey
[src]
impl FromStr for DescriptorPublicKey
[src]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>
[src]
pub fn from_str(
s: &str
) -> Result<DescriptorPublicKey, <DescriptorPublicKey as FromStr>::Err>
[src]Parses a string s
to return a value of this type. Read more
impl Hash for DescriptorPublicKey
[src]
impl Hash for DescriptorPublicKey
[src]impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorPublicKey
[src]
impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorPublicKey
[src]fn into_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError>
[src]
fn into_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError>
[src]Turn the key into a DescriptorKey
within the requested ScriptContext
impl MiniscriptKey for DescriptorPublicKey
[src]
impl MiniscriptKey for DescriptorPublicKey
[src]type Hash = DescriptorPublicKey
type Hash = DescriptorPublicKey
The associated Hash type with the publicKey
pub fn is_uncompressed(&self) -> bool
[src]
pub fn is_uncompressed(&self) -> bool
[src]Check if the publicKey is uncompressed. The default implementation returns false Read more
pub fn to_pubkeyhash(&self) -> DescriptorPublicKey
[src]
pub fn to_pubkeyhash(&self) -> DescriptorPublicKey
[src]Converts an object to PublicHash
fn serialized_len(&self) -> usize
[src]
fn serialized_len(&self) -> usize
[src]Computes the size of a public key when serialized in a script, including the length bytes Read more
impl Ord for DescriptorPublicKey
[src]
impl Ord for DescriptorPublicKey
[src]impl PartialEq<DescriptorPublicKey> for DescriptorPublicKey
[src]
impl PartialEq<DescriptorPublicKey> for DescriptorPublicKey
[src]pub fn eq(&self, other: &DescriptorPublicKey) -> bool
[src]
pub fn eq(&self, other: &DescriptorPublicKey) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
pub fn ne(&self, other: &DescriptorPublicKey) -> bool
[src]
pub fn ne(&self, other: &DescriptorPublicKey) -> bool
[src]This method tests for !=
.
impl PartialOrd<DescriptorPublicKey> for DescriptorPublicKey
[src]
impl PartialOrd<DescriptorPublicKey> for DescriptorPublicKey
[src]pub fn partial_cmp(&self, other: &DescriptorPublicKey) -> Option<Ordering>
[src]
pub fn partial_cmp(&self, other: &DescriptorPublicKey) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Eq for DescriptorPublicKey
[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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,