Trait bdk::keys::GeneratableKey [−][src]
pub trait GeneratableKey<Ctx: ScriptContext>: Sized { type Entropy: AsMut<[u8]> + Default; type Options; type Error: Debug; fn generate_with_entropy(
options: Self::Options,
entropy: Self::Entropy
) -> Result<GeneratedKey<Self, Ctx>, Self::Error>; fn generate(
options: Self::Options
) -> Result<GeneratedKey<Self, Ctx>, Self::Error> { ... } }
Expand description
Trait for keys that can be generated
The same rules about ScriptContext
and ValidNetworks
from IntoDescriptorKey
apply.
This trait is particularly useful when combined with DerivableKey
: if Self
implements it, the returned GeneratedKey
will also implement it. The same is true for
IntoDescriptorKey
: the generated keys can be directly used in descriptors if Self
is also
IntoDescriptorKey
.
Associated Types
Required methods
fn generate_with_entropy(
options: Self::Options,
entropy: Self::Entropy
) -> Result<GeneratedKey<Self, Ctx>, Self::Error>
[src]
fn generate_with_entropy(
options: Self::Options,
entropy: Self::Entropy
) -> Result<GeneratedKey<Self, Ctx>, Self::Error>
[src]Generate a key given the extra options and the entropy
Provided methods
Implementations on Foreign Types
type Options = PrivateKeyGenerateOptions
fn generate_with_entropy(
options: Self::Options,
entropy: Self::Entropy
) -> Result<GeneratedKey<Self, Ctx>, Self::Error>
[src]Implementors
This is supported on crate feature
keys-bip39
only.