pub enum DescriptorPublicKey {
Single(SinglePub),
XPub(DescriptorXKey<ExtendedPubKey>),
}
Expand description
The descriptor pubkey, either a single pubkey or an xpub.
Variants§
Single(SinglePub)
Single public key.
XPub(DescriptorXKey<ExtendedPubKey>)
Extended public key (xpub).
Implementations§
Source§impl DescriptorPublicKey
impl DescriptorPublicKey
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
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)
Sourcepub fn is_deriveable(&self) -> bool
👎Deprecated: use has_wildcard instead
pub fn is_deriveable(&self) -> bool
Whether or not the key has a wildcard
Sourcepub fn has_wildcard(&self) -> bool
pub fn has_wildcard(&self) -> bool
Whether or not the key has a wildcard
Sourcepub fn derive(self, index: u32) -> DefiniteDescriptorKey
👎Deprecated: use at_derivation_index instead
pub fn derive(self, index: u32) -> DefiniteDescriptorKey
Deprecated name of [at_derivation_index
].
Sourcepub fn at_derivation_index(self, index: u32) -> DefiniteDescriptorKey
pub fn at_derivation_index(self, index: u32) -> DefiniteDescriptorKey
Replaces any wildcard (i.e. /*
) in the key with a particular derivation index, turning it into a
definite key (i.e. one where all the derivation paths are set).
§Returns
- If this key is not an xpub, returns
self
. - If this key is an xpub but does not have a wildcard, returns
self
. - Otherwise, returns the xpub at derivation
index
(removing the wildcard).
§Panics
If index
≥ 2^31
Trait Implementations§
Source§impl Clone for DescriptorPublicKey
impl Clone for DescriptorPublicKey
Source§fn clone(&self) -> DescriptorPublicKey
fn clone(&self) -> DescriptorPublicKey
Returns a duplicate 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 DescriptorPublicKey
impl Debug for DescriptorPublicKey
Source§impl Display for DescriptorPublicKey
impl Display for DescriptorPublicKey
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 DescriptorPublicKey
impl FromStr for DescriptorPublicKey
Source§impl Hash for DescriptorPublicKey
impl Hash for DescriptorPublicKey
Source§impl MiniscriptKey for DescriptorPublicKey
impl MiniscriptKey for DescriptorPublicKey
Source§type Sha256 = Hash
type Sha256 = Hash
The associated
sha256::Hash
for this MiniscriptKey
,
used in the hash256 fragment.Source§type Hash256 = Hash
type Hash256 = Hash
The associated
hash256::Hash
for this MiniscriptKey
,
used in the hash256 fragment.Source§type Ripemd160 = Hash
type Ripemd160 = Hash
The associated [
ripedmd160::Hash
] for this MiniscriptKey
type.
used in the ripemd160 fragmentSource§type Hash160 = Hash
type Hash160 = Hash
The associated
hash160::Hash
for this MiniscriptKey
type.
used in the hash160 fragmentSource§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§impl Ord for DescriptorPublicKey
impl Ord for DescriptorPublicKey
Source§fn cmp(&self, other: &DescriptorPublicKey) -> Ordering
fn cmp(&self, other: &DescriptorPublicKey) -> 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 DescriptorPublicKey
impl PartialEq for DescriptorPublicKey
Source§impl PartialOrd for DescriptorPublicKey
impl PartialOrd for DescriptorPublicKey
impl Eq for DescriptorPublicKey
impl StructuralPartialEq for DescriptorPublicKey
Auto Trait Implementations§
impl Freeze for DescriptorPublicKey
impl RefUnwindSafe for DescriptorPublicKey
impl Send for DescriptorPublicKey
impl Sync for DescriptorPublicKey
impl Unpin for DescriptorPublicKey
impl UnwindSafe for DescriptorPublicKey
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