Crate seed_utils

Source
Expand description

§seed-utils

Note: The word seed is interchangeably used for bip39 mnemonics.

  • Derive bip85 child seeds
  • Derive bip32 root xpubs and xprvs from seeds
  • Derive account xpubs and xprvs
  • XOR seeds
  • Truncate (reduce entropy to keep first n words of a seed)
  • Extend (extend entropy to add words to a seed)

Enums§

Error
All errors in this crate.
WordCount
Valid number of words in a mnemonic.

Functions§

derive_child_seeds
Derives child seeds of seed with an index range of [start, end). Each seed’s word count will be exactly word_count. Returns list of tuples containing the derived seeds and their indexes.
derive_root_xprv
Derives the master private key of a seed at the bip32 root.
derive_root_xpub
Derives the master public key of a seed at the bip32 root.
derive_xprvs_from_seed
Derives account extended private keys of a seed with an index range [start, end) and the derivation path of version. Returns a tuple of the derivation path and its derived xprv.
derive_xpubs_from_seed
Derives account extended public keys of a seed with an index range [start, end) and the derivation path of version. Returns a tuple of the derivation path and its derived xpub.
extend_seed
Extends a seed’s number of words to the desired length word_count by enxtending its entropy. The returned new seed will start with the same words as seed.
truncate_seed
Truncates a seed’s number of words to word_count by truncating its entropy.
xor_seeds
XORs multiple seeds and returns the resulting seed or None if seeds is empty. Can fail if a seed is not a valid bip39::Mnemonic.