<blockquote>
<p><strong>adapted from O'Reilly's Mastering Bitcoin by Andreas Antonopoulos</strong></p>
</blockquote>
<p>Note that the bx command set has since changed significantly.</p>
<blockquote>
<p><strong>Q1 Presumably the checksumming was included?</strong></p>
</blockquote>
<pre><code>$ bx seed -b 512 &gt; entropy

$ bx mnemonic-new &lt; entropy &gt; 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 &lt; words
6705d4927c78a7ef9f409e652d0631214ee0757b44cd3de434f3c0f1a9d7e52f
5be3face8ee9092409f2eebb283a091601934b89939bcef0633bc9a646f8ef81
</code></pre>
<p>Note</p>
<ul>
<li>the above result agrees with <a href="https://iancoleman.io/bip39/" rel="nofollow noreferrer">https://iancoleman.io/bip39/</a></li>
<li>the words &quot;pulp&quot; and &quot;average&quot; are both acceptable dictionary words. Repeated words are permissible in mnemonics AFAIK. We can use this to test checksumming.</li>
</ul>
<pre><code>$ sed 's/average/pulp/' words | bx mnemonic-to-seed
WARNING: The specified words are not a valid mnemonic in any supported 
dictionary.
cc546ef85e654fdefb6bd37ffec86ae5c5f1a0e9a28e1a252368510e6d05945f
35ebb8538a6c676fe72780390c33a4eeb5851da554061015fcbae4b96ad2fdaa
</code></pre>
<p>I guess that warning <em>might be</em> because of the checksum failure I induced.</p>
<hr />
<blockquote>
<p><strong>Q2 Why would we need to go back?</strong></p>
</blockquote>
<p>wallet recovery?</p>
<hr />
<blockquote>
<p><strong>Q3 Why is the (supposedly optional) passphrase as salt left out?</strong></p>
</blockquote>
<p>Because it is optional?</p>
<pre><code>$ 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.
</code></pre>
<hr />
<blockquote>
<p><strong>Q4 are there detailed docs that show the --help output text?</strong></p>
</blockquote>
<p><a href="https://github.com/libbitcoin/libbitcoin-explorer" rel="nofollow noreferrer">https://github.com/libbitcoin/libbitcoin-explorer</a> says</p>
<blockquote>
<p><a href="https://github.com/libbitcoin/libbitcoin-explorer/wiki" rel="nofollow noreferrer">Documentation</a> is available on the wiki.</p>
</blockquote>
<p>Which it is.</p>
<hr />
<blockquote>
<p><strong>Q5 is bx the canonical CLI tool</strong></p>
</blockquote>
<p>No idea, sorry.</p>
<p>I guess you mean &quot;most popular&quot; as there are not really any lawmakers in Bitcoin who can make canon law. At least, not about which implementations you should use.</p>
<p>Some tools <em>seem</em> popular but I don't know of any credible survey results.</p>

CC BY-SA 4.0
2022-02-18T19:30:11.983Z
Thanks, great response! Not at all interested in general popularity, but sometimes there is somewhat a consensus among the experts around "the right tool for the job". Some other project may have a more modern comprehensive feature set for example. So, suggestions welcome.
HansBKK
CC BY-SA 4.0
2022-02-18T19:37:34.770Z
I am struggling to imagine a case where just having the raw hex entropy would be more useful. Certainly all decent wallets can be recovered using the mnemonic. And, if there were a passphrase as there should be, I never heard of that being asked for in conjunction with the raw entropy?
HansBKK
CC BY-SA 4.0
2022-02-19T11:57:19.043Z
https://bitcoin.stackexchange.com/a/112501/132451
HansBKK
CC BY-SA 4.0
2022-02-19T11:59:09.933Z
I came across a comment where Ian Coleman implied a recommendation to use libbitcoin-explorer (bx)
HansBKK
CC BY-SA 4.0
2022-02-19T12:11:56.053Z
http://www.petecorey.com/blog/2018/05/07/reversing-bip39-and-the-power-of-property-testing
HansBKK
CC BY-SA 4.0
2022-02-18T11:15:32.850Z
2022-02-18T11:44:04.663Z
2022-02-18T11:44:04.663Z
RedGrittyBrick
<p>Creating an HD wallet as per BIP39, adapted from O'Reilly's <em>Mastering Bitcoin</em> by Andreas Antonopoulos</p>
<ol>
<li>Generate pseudo-random number as 32 hex characters</li>
</ol>
<p><code>$ bx seed &gt; entropy</code></p>
<ol start="2">
<li>Convert random number to 12-word mnemonic &quot;sentence&quot; for backup</li>
</ol>
<p><code>$ bx hd-mnemonic &lt; entropy &gt; words</code></p>
<ul>
<li>Q1 Presumably the checksumming was included?</li>
</ul>
<p><code>$ bx mnemonic-decode &lt; words</code></p>
<ul>
<li>Q2 Why would we need to go back?</li>
</ul>
<ol start="3">
<li>Derive the root / master key, basis for BIP32 derivation of the hierarchy of keys</li>
</ol>
<p><code>$ bx hd-new &lt; entropy &gt; master</code></p>
<ul>
<li><p>Q3 Why is the (supposedly optional) passphrase as salt left out?</p>
</li>
<li><p>Q4 I do not have access to run the <em>bx</em> tools ATM, are there detailed docs that show the <em>--help</em> output text?</p>
</li>
<li><p>Q5 Finally, is <em>bx</em> 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.</p>
</li>
</ul>

CC BY-SA 4.0
2023-08-17T07:20:15.477Z
**Do not use `bx seed` because it does not generate secure mnemonic phrases.** More information: https://milksad.info
Zenul_Abidin
<bitcoin-cli><mnemonic-seed><passphrase>
How to use Bitcoin Explorer (bx) for BIP39?
HansBKK
# How to use Bitcoin Explorer (bx) for BIP39?

(Asked by: username_0 on 2022-02-18)

Creating an HD wallet as per BIP39, adapted from O'Reilly's *Mastering Bitcoin* by Andreas Antonopoulos

1. Generate pseudo-random number as 32 hex characters

`$ bx seed > entropy`

2. 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?

3. 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.

**Tags:** bitcoin-cli, mnemonic-seed, passphrase

> **Comments:**
> **username_1**: **Do not use `bx seed` because it does not generate secure mnemonic phrases.** More information: https://milksad.info  

---

## 1 answers

### Answer by username_2 on 2022-02-18. Score: 2 | Accepted answer

> **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](https://github.com/libbitcoin/libbitcoin-explorer/wiki) 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.

> **Comments:**
> **username_0**: Thanks, great response! Not at all interested in general popularity, but sometimes there is somewhat a consensus among the experts around "the right tool for the job". Some other project may have a more modern comprehensive feature set for example. So, suggestions welcome.  
> **username_0**: I am struggling to imagine a case where just having the raw hex entropy would be more useful. Certainly all decent wallets can be recovered using the mnemonic. And, if there were a passphrase as there should be, I never heard of that being asked for in conjunction with the raw entropy?  
> **username_0**: https://bitcoin.stackexchange.com/a/112501/132451  
> **username_0**: I came across a comment where Ian Coleman implied a recommendation to use libbitcoin-explorer (bx)  
> **username_0**: http://www.petecorey.com/blog/2018/05/07/reversing-bip39-and-the-power-of-property-testing  

---

