Enum bdk::keys::DescriptorSecretKey
pub enum DescriptorSecretKey {
Single(SinglePriv),
XPrv(DescriptorXKey<ExtendedPrivKey>),
MultiXPrv(DescriptorMultiXKey<ExtendedPrivKey>),
}
Expand description
The descriptor secret key, either a single private key or an xprv.
Variants§
Single(SinglePriv)
Single private key.
XPrv(DescriptorXKey<ExtendedPrivKey>)
Extended private key (xpriv).
MultiXPrv(DescriptorMultiXKey<ExtendedPrivKey>)
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, Global>
pub fn into_single_keys(self) -> Vec<DescriptorSecretKey, Global>
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