[−][src]Trait bdk::keys::GeneratableKey
Trait for keys that can be generated
The same rules about ScriptContext
and ValidNetworks
from ToDescriptorKey
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
ToDescriptorKey
: the generated keys can be directly used in descriptors if Self
is also
ToDescriptorKey
.
Associated Types
type Entropy: AsMut<[u8]> + Default
[src]
Type specifying the amount of entropy required e.g. [u8;32]
type Options
[src]
Extra options required by the generate_with_entropy
type Error: Debug
[src]
Returned error in case of failure
Required methods
pub fn generate_with_entropy(
options: Self::Options,
entropy: Self::Entropy
) -> Result<GeneratedKey<Self, Ctx>, Self::Error>
[src]
options: Self::Options,
entropy: Self::Entropy
) -> Result<GeneratedKey<Self, Ctx>, Self::Error>
Generate a key given the extra options and the entropy
Provided methods
pub fn generate(
options: Self::Options
) -> Result<GeneratedKey<Self, Ctx>, Self::Error>
[src]
options: Self::Options
) -> Result<GeneratedKey<Self, Ctx>, Self::Error>
Generate a key given the options with a random entropy
Implementations on Foreign Types
impl<Ctx: ScriptContext> GeneratableKey<Ctx> for Mnemonic
[src]
This is supported on crate feature
keys-bip39
only.type Entropy = [u8; 32]
type Options = (MnemonicType, Language)
type Error = Option<ErrorKind>
pub fn generate_with_entropy(
(mnemonic_type, language): Self::Options,
entropy: Self::Entropy
) -> Result<GeneratedKey<Self, Ctx>, Self::Error>
[src]
(mnemonic_type, language): Self::Options,
entropy: Self::Entropy
) -> Result<GeneratedKey<Self, Ctx>, Self::Error>
impl<Ctx: ScriptContext> GeneratableKey<Ctx> for ExtendedPrivKey
[src]
type Entropy = [u8; 32]
type Options = ()
type Error = Error
pub fn generate_with_entropy(
_: Self::Options,
entropy: Self::Entropy
) -> Result<GeneratedKey<Self, Ctx>, Self::Error>
[src]
_: Self::Options,
entropy: Self::Entropy
) -> Result<GeneratedKey<Self, Ctx>, Self::Error>
impl<Ctx: ScriptContext> GeneratableKey<Ctx> for PrivateKey
[src]
type Entropy = [u8; 32]
type Options = PrivateKeyGenerateOptions
type Error = Error
pub fn generate_with_entropy(
options: Self::Options,
entropy: Self::Entropy
) -> Result<GeneratedKey<Self, Ctx>, Self::Error>
[src]
options: Self::Options,
entropy: Self::Entropy
) -> Result<GeneratedKey<Self, Ctx>, Self::Error>