Enum bdk::keys::DescriptorSecretKey [−][src]
pub enum DescriptorSecretKey {
SinglePriv(DescriptorSinglePriv),
XPrv(DescriptorXKey<ExtendedPrivKey>),
}
Expand description
A Secret Key that can be either a single key or an Xprv
Variants
SinglePriv(DescriptorSinglePriv)
Tuple Fields
Single Secret Key
XPrv(DescriptorXKey<ExtendedPrivKey>)
Tuple Fields
Xprv
Implementations
pub fn as_public<C>(
&self,
secp: &Secp256k1<C>
) -> Result<DescriptorPublicKey, DescriptorKeyParseError> where
C: Signing,
pub fn as_public<C>(
&self,
secp: &Secp256k1<C>
) -> Result<DescriptorPublicKey, DescriptorKeyParseError> where
C: Signing,
Return the public version of this key, by applying either
DescriptorSinglePriv::as_public
or DescriptorXKey<bip32::ExtendedPrivKey>::as_public
depending on the type of key.
If the key is an “XPrv”, the hardened derivation steps will be applied before converting it
to a public key. See the documentation of DescriptorXKey<bip32::ExtendedPrivKey>::as_public
for more details.
Trait Implementations
type Err = DescriptorKeyParseError
type Err = DescriptorKeyParseError
The associated error which can be returned from parsing.
pub fn from_str(
s: &str
) -> Result<DescriptorSecretKey, <DescriptorSecretKey as FromStr>::Err>
pub fn from_str(
s: &str
) -> Result<DescriptorSecretKey, <DescriptorSecretKey as FromStr>::Err>
Parses a string s
to return a value of this type. Read more
Turn the key into a DescriptorKey
within the requested ScriptContext