Enum DescriptorSecretKey
pub enum DescriptorSecretKey {
Single(SinglePriv),
XPrv(DescriptorXKey<Xpriv>),
MultiXPrv(DescriptorMultiXKey<Xpriv>),
}
Expand description
The descriptor secret key, either a single private key or an xprv.
Variants§
Single(SinglePriv)
Single private key.
XPrv(DescriptorXKey<Xpriv>)
Extended private key (xpriv).
MultiXPrv(DescriptorMultiXKey<Xpriv>)
Multiple extended private keys.
Implementations§
§impl DescriptorSecretKey
impl DescriptorSecretKey
pub fn to_public<C>(
&self,
secp: &Secp256k1<C>,
) -> Result<DescriptorPublicKey, DescriptorKeyParseError>where
C: Signing,
pub fn to_public<C>(
&self,
secp: &Secp256k1<C>,
) -> Result<DescriptorPublicKey, DescriptorKeyParseError>where
C: Signing,
Returns the public version of this key.
If the key is an “XPrv”, the hardened derivation steps will be applied before converting it to a public key.
It will return an error if the key is a “multi-xpriv”, as we wouldn’t always be able to apply hardened derivation steps if there are multiple paths.
pub fn is_multipath(&self) -> bool
pub fn is_multipath(&self) -> bool
Whether or not this key has multiple derivation paths.
pub fn into_single_keys(self) -> Vec<DescriptorSecretKey>
pub fn into_single_keys(self) -> Vec<DescriptorSecretKey>
Get as many keys as derivation paths in this key.
For raw keys and single-path extended keys it will return the key itself. For multipath extended keys it will return a single-path extended key per derivation path.
Trait Implementations§
§impl Clone for DescriptorSecretKey
impl Clone for DescriptorSecretKey
§fn clone(&self) -> DescriptorSecretKey
fn clone(&self) -> DescriptorSecretKey
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 more§impl Debug for DescriptorSecretKey
impl Debug for DescriptorSecretKey
§impl Display for DescriptorSecretKey
impl Display for DescriptorSecretKey
§impl FromStr for DescriptorSecretKey
impl FromStr for DescriptorSecretKey
Source§impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorSecretKey
impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorSecretKey
Source§fn into_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError>
fn into_descriptor_key(self) -> Result<DescriptorKey<Ctx>, KeyError>
Turn the key into a
DescriptorKey
within the requested ScriptContext
§impl PartialEq for DescriptorSecretKey
impl PartialEq for DescriptorSecretKey
impl Eq for DescriptorSecretKey
impl StructuralPartialEq for DescriptorSecretKey
Auto Trait Implementations§
impl Freeze for DescriptorSecretKey
impl RefUnwindSafe for DescriptorSecretKey
impl Send for DescriptorSecretKey
impl Sync for DescriptorSecretKey
impl Unpin for DescriptorSecretKey
impl UnwindSafe for DescriptorSecretKey
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more