Module bdk::keys

source · []
Expand description

Key formats





A Single Descriptor Secret Key with optional origin information

A Single Descriptor Key with optional origin information

Output of a GeneratableKey key generation

Options for generating a [PrivateKey]

Contents of a “sortedmulti” descriptor


Container for public or secret keys

The MiniscriptKey corresponding to Descriptors. This can either be Single public key or a Xpub

A Secret Key that can be either a single key or an Xprv

Enum for extended keys that can be either xprv or xpub

Errors thrown while working with keys

Enum representation of the known valid ScriptContexts

Single public key without any origin or range information


Trait for keys that can be derived.

Trait that adds extra useful methods to ScriptContexts

Trait that allows generating a key with the default options

Trait for keys that can be generated

Trait for objects that can be turned into a public or secret DescriptorKey

The ScriptContext for Miniscript. Additional type information associated with miniscript that is used for carrying out checks that dependent on the context under which the script is used. For example, disallowing uncompressed keys in Segwit context


Create a set containing mainnet, testnet and regtest

Create a set only containing mainnet

Compute the intersection of two sets

Create a set containing testnet and regtest

Type Definitions

Alias type for a map of public key to secret key

Set of valid networks for a key