Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this communityAnybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
Creating an HD wallet as per BIP39, adapted from O'Reilly's Mastering Bitcoin by Andreas Antonopoulos
- Generate pseudo-random number as 32 hex characters
$ bx seed > entropy
- Convert random number to 12-word mnemonic "sentence" for backup
$ bx hd-mnemonic < entropy > words
- Q1 Presumably the checksumming was included?
$ bx mnemonic-decode < words
- Q2 Why would we need to go back?
- Derive the root / master key, basis for BIP32 derivation of the hierarchy of keys
$ bx hd-new < entropy > master
Q3 Why is the (supposedly optional) passphrase as salt left out?
Q4 I do not have access to run the bx tools ATM, are there detailed docs that show the --help output text?
Q5 Finally, is bx the canonical CLI tool for air-gapped tasks like creating new BIP39/BIP32 wallets, hashing / encoding different formats etc? I get a bit confused using the GUI / JS tools.
adapted from O'Reilly's Mastering Bitcoin by Andreas Antonopoulos
Note that the bx command set has since changed significantly.
Q1 Presumably the checksumming was included?
$ bx seed -b 512 > entropy $ bx mnemonic-new < entropy > words $ cat words injury motor machine bench toy repair thumb mushroom prevent toward expand rural then market endorse replace chief frozen forum model click payment fan mechanic dwarf hobby want innocent cloud ready violin boy provide faith favorite print broom save crowd only tonight track dinner nominee remind obtain pulp average $ bx mnemonic-to-seed < words 6705d4927c78a7ef9f409e652d0631214ee0757b44cd3de434f3c0f1a9d7e52f 5be3face8ee9092409f2eebb283a091601934b89939bcef0633bc9a646f8ef81
Note
- the above result agrees with https://iancoleman.io/bip39/
- the words "pulp" and "average" are both acceptable dictionary words. Repeated words are permissible in mnemonics AFAIK. We can use this to test checksumming.
$ sed 's/average/pulp/' words | bx mnemonic-to-seed WARNING: The specified words are not a valid mnemonic in any supported dictionary. cc546ef85e654fdefb6bd37ffec86ae5c5f1a0e9a28e1a252368510e6d05945f 35ebb8538a6c676fe72780390c33a4eeb5851da554061015fcbae4b96ad2fdaa
I guess that warning might be because of the checksum failure I induced.
Q2 Why would we need to go back?
wallet recovery?
Q3 Why is the (supposedly optional) passphrase as salt left out?
Because it is optional?
$ bx mnemonic-to-seed -h Usage: bx mnemonic-to-seed [-h] [--config value] [--language value] [--passphrase value] [WORD]... Info: Convert a mnemonic seed (BIP39) to its numeric representation. Options (named): -c [--config] The path to the configuration settings file. -h [--help] Get a description and instructions for this command. -l [--language] The language identifier of the dictionary of the mnemonic. Options are 'en', 'es', 'fr', 'it', 'ja', 'cs', 'ru', 'uk', 'zh_Hans', 'zh_Hant' and 'any', defaults to 'any'. -p [--passphrase] An optional passphrase for converting the mnemonic to a seed. Arguments (positional): WORD The set of words that that make up the mnemonic. If not specified the words are read from STDIN.
Q4 are there detailed docs that show the --help output text?
https://github.com/libbitcoin/libbitcoin-explorer says
Documentation is available on the wiki.
Which it is.
Q5 is bx the canonical CLI tool
No idea, sorry.
I guess you mean "most popular" as there are not really any lawmakers in Bitcoin who can make canon law. At least, not about which implementations you should use.
Some tools seem popular but I don't know of any credible survey results.
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments