[][src]Trait bdk::keys::DerivableKey

pub trait DerivableKey<Ctx: ScriptContext> {
    pub fn add_metadata(
        self,
        origin: Option<KeySource>,
        derivation_path: DerivationPath
    ) -> Result<DescriptorKey<Ctx>, KeyError>; }

Trait for keys that can be derived.

When extra metadata are provided, a DerivableKey can be transofrmed into a DescriptorKey: the trait ToDescriptorKey is automatically implemented for (DerivableKey, DerivationPath) and (DerivableKey, KeySource, DerivationPath) tuples.

For key types that don't encode any indication about the path to use (like bip39), it's generally recommended to implemented this trait instead of ToDescriptorKey. The same rules regarding script context and valid networks apply.

Required methods

pub fn add_metadata(
    self,
    origin: Option<KeySource>,
    derivation_path: DerivationPath
) -> Result<DescriptorKey<Ctx>, KeyError>
[src]

Add a extra metadata, consume self and turn it into a DescriptorKey

Loading content...

Implementations on Foreign Types

impl<Ctx: ScriptContext> DerivableKey<Ctx> for Seed[src]

This is supported on crate feature keys-bip39 only.

impl<Ctx: ScriptContext> DerivableKey<Ctx> for Mnemonic[src]

This is supported on crate feature keys-bip39 only.

impl<Ctx: ScriptContext> DerivableKey<Ctx> for ExtendedPubKey[src]

impl<Ctx: ScriptContext> DerivableKey<Ctx> for ExtendedPrivKey[src]

Loading content...

Implementors

impl<Ctx, K> DerivableKey<Ctx> for GeneratedKey<K, Ctx> where
    Ctx: ScriptContext,
    K: DerivableKey<Ctx>, 
[src]

impl<Ctx: ScriptContext> DerivableKey<Ctx> for MnemonicWithPassphrase[src]

This is supported on crate feature keys-bip39 only.
Loading content...