BIP 39 Mnemonics Reference¶
By default, Minsc ships with the BIP 39 wordlist for English only. To support other languages, enable the bip39-all-languages feature.
bip39()
¶
Generate a random BIP 39 mnemonic phrase.
Shorthand for bip39::rand() when called with no arguments or an integer argument.
Convert the mnemonic into an Xpriv.
Shorthand for bip39::to_xpriv() when the first argument is a string.
Note:
bip39()assumes the English wordlist. Usebip39::rand()/bip39::to_xpriv()directly for other languages.
Minsc source code: src/stdlib/bip39.minsc:2
Generate a random BIP 39 mnemonic phrase.
word_count must be one of 12 (the default), 15, 18, 21 or 24.
For example:
>>> bip39::rand()
Also possible using bip39().
Rust source code: src/stdlib/bip39.rs:31
bip39::to_seed()
¶
Convert the mnemonic into a 512-bit seed.
For example:
>>> bip39::to_seed("pill canvas solve muscle orchard brave miracle liberty vehicle broccoli canal above")
Rust source code: src/stdlib/bip39.rs:57
bip39::to_xpriv()
¶
Convert the mnemonic into a seed, then convert the seed into an Xpriv.
For example:
>>> bip39::to_xpriv("pill canvas solve muscle orchard brave miracle liberty vehicle broccoli canal above")
Aliased as xpriv::from_mnemonic() and also possible using bip39().
Minsc source code: src/stdlib/bip39.minsc:8
Convert the mnemonic back to the entropy used to generate it.
For example:
>>> bip39::to_entropy("pill canvas solve muscle orchard brave miracle liberty vehicle broccoli canal above")
Rust source code: src/stdlib/bip39.rs:48
Create the mnemonic phrase from the given entropy.
Entropy must be a multiple of 32 bits (4 bytes) and 128-256 bits in length.
For example:
>>> bip39::from_entropy(0xa4c4373bc8c9c036a35c07f1e38c8400)
Rust source code: src/stdlib/bip39.rs:40