derive_bitcoin_addresses

Function derive_bitcoin_addresses 

Source
pub fn derive_bitcoin_addresses(
    mnemonic_phrase: &str,
    derivation_path_str: Option<&str>,
    network: Option<Network>,
    bip39_passphrase: Option<&str>,
    is_change: Option<bool>,
    start_index: Option<u32>,
    count: Option<u32>,
) -> Result<GetAddressesResponse, DerivationError>
Expand description

Derives multiple Bitcoin addresses from a single mnemonic by iterating through a range of indices.

§Arguments

  • mnemonic_phrase - A BIP39 mnemonic phrase (space-separated words)
  • derivation_path_str - The derivation path. Can be either a base path (e.g., “m/84’/0’/0’”) or a full path (e.g., “m/84’/0’/0’/0/0”). If a full path is provided, only the base part (up to the account level) will be used.
  • network - Optional network type. Default is Network::Bitcoin.
  • bip39_passphrase - Optional BIP39 passphrase. Default is an empty string.
  • is_change - Optional boolean indicating whether to derive change addresses (1) or receiving addresses (0). Default is false (receiving).
  • start_index - Optional starting index. Default is 0.
  • count - Optional number of addresses to generate. Default is 1.

§Returns

  • Result<GetAddressesResponse, DerivationError> - Collection of address information or an error

§Errors

  • Same error types as derive_bitcoin_address