Enum bdk::keys::DescriptorSecretKey
source · [−]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)
Single Secret Key
XPrv(DescriptorXKey<ExtendedPrivKey>)
Xprv
Implementations
sourceimpl DescriptorSecretKey
impl DescriptorSecretKey
sourcepub 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
sourceimpl Debug for DescriptorSecretKey
impl Debug for DescriptorSecretKey
sourceimpl Display for DescriptorSecretKey
impl Display for DescriptorSecretKey
sourceimpl FromStr for DescriptorSecretKey
impl FromStr for DescriptorSecretKey
type Err = DescriptorKeyParseError
type Err = DescriptorKeyParseError
The associated error which can be returned from parsing.
sourcefn from_str(
s: &str
) -> Result<DescriptorSecretKey, <DescriptorSecretKey as FromStr>::Err>
fn from_str(
s: &str
) -> Result<DescriptorSecretKey, <DescriptorSecretKey as FromStr>::Err>
Parses a string s
to return a value of this type. Read more
sourceimpl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorSecretKey
impl<Ctx: ScriptContext> IntoDescriptorKey<Ctx> for DescriptorSecretKey
sourcefn 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
Auto Trait Implementations
impl RefUnwindSafe for DescriptorSecretKey
impl Send for DescriptorSecretKey
impl Sync for DescriptorSecretKey
impl Unpin for DescriptorSecretKey
impl UnwindSafe for DescriptorSecretKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more