<p>It looks like it is working. Go to <a href="https://www.coinomi.com/recovery-phrase-tool.html" rel="nofollow noreferrer">https://www.coinomi.com/recovery-phrase-tool.html</a> and make sure to enter the following:</p>

<p><strong>BIP39 Recovery Phrase</strong> : <code>eight better wealth display father cave suffer game sign health fit exchange noble tunnel poet remember owner letter submit illness cage calm dry noble</code></p>

<p><strong>Coin</strong> : Bitcoin</p>

<p><strong>BIP32 Derivation Path</strong> (In BIP32 Tab): <code>m/0'/0</code></p>

<p>Result:</p>

<p><strong>Derived Addresses</strong>  </p>

<pre><code>m/0'/0/0`   169zFhK1WTuxfhgY6bmzE9zP1godCfZr2V
m/0'/0/1    17tdSW83Vjw23TdQsmZDtBAupan9WiGGd5
m/0'/0/2    17bYSjEXwZxMgVkRRt9pJgDgExiX8Xht3b
</code></pre>

CC BY-SA 4.0
2018-07-24T17:58:42.890Z
hmm thanks, i was using the site wrongly. but just another question, I can get the public key from this code `root.derivePath("m/0'/0/0").publicKey.toString('hex')` and I get "02db987662b3f1a84c8465ac710de96106ba65aef63d0967e605b802d5fd2579e5" with is correct, but with private key, that doens't work, do you know how I can display my private key for path 0/0? (I resolved it by myself, the solution was to use root.derivePath("m/0'/0/0").toWIF()
Caio Souza Andrade
CC BY-SA 4.0
2018-07-24T15:56:58.607Z
2018-07-24T15:56:58.607Z
JBaczuk
<p>i'm learning about bitcoin, and bitcoinjs-lib (<a href="https://github.com/bitcoinjs/bitcoinjs-lib" rel="nofollow noreferrer">https://github.com/bitcoinjs/bitcoinjs-lib</a>)</p>

<p>I created a dummy wallet on coinomi using this mnemonic ('eight better wealth display father cave suffer game sign health fit exchange noble tunnel poet remember owner letter submit illness cage calm dry noble')</p>

<p>and i'm trying to generate a Deterministic wallet with it.</p>

<p>Here is my code</p>

<blockquote>
  <p>const bip39 = require('bip39')<br>
  const bip32 = require('bip32')<br>
  const bitcoin = require('bitcoinjs-lib')<br>
  const network = bitcoin.networks.bitcoin;<br>
  function getAddress (node) {<br>
  return bitcoin.payments.p2pkh({ pubkey: node.publicKey, network}).address<br>
  }<br>
  const mnemonic = 'eight better wealth display father cave suffer game
  sign health fit exchange noble tunnel poet remember owner letter
  submit illness cage calm dry noble'<br>
  console.log('Testing mnemonic: ',bip39.validateMnemonic(mnemonic))<br>
  const seed = bip39.mnemonicToSeed(mnemonic)<br>
  const root = bip32.fromSeed(seed)<br>
  console.log("m/0'/0/1 ->",getAddress(root.derivePath("m/0'/0/1")));<br>
  console.log("m/0'/0/2 ->",getAddress(root.derivePath("m/0'/0/2")));  </p>
</blockquote>

<p>.</p>

<p>and this is the output that i got</p>

<p>.</p>

<blockquote>
  <p>Testing mnemonic: true<br>
  m/0'/0/1 -> 17tdSW83Vjw23TdQsmZDtBAupan9WiGGd5<br>
  m/0'/0/2 -> 17bYSjEXwZxMgVkRRt9pJgDgExiX8Xht3b  </p>
</blockquote>

<p>Then I go to (<a href="https://www.coinomi.com/recovery-phrase-tool.html" rel="nofollow noreferrer">https://www.coinomi.com/recovery-phrase-tool.html</a>) to test if my results are correct, and it isn't, could someone help me with this please. How to fix the code?</p>

<bitcoin-core><bitcoinjs><deterministic-wallets>
Bitcoinjs-lib help with deterministc wallet
Caio Souza Andrade
# Bitcoinjs-lib help with deterministc wallet

(Asked by: username_0 on 2018-07-24)

i'm learning about bitcoin, and bitcoinjs-lib (<https://github.com/bitcoinjs/bitcoinjs-lib>)

I created a dummy wallet on coinomi using this mnemonic ('eight better wealth display father cave suffer game sign health fit exchange noble tunnel poet remember owner letter submit illness cage calm dry noble')

and i'm trying to generate a Deterministic wallet with it.

Here is my code

> const bip39 = require('bip39')  
> const bip32 = require('bip32')  
> const bitcoin = require('bitcoinjs-lib')  
> const network = bitcoin.networks.bitcoin;  
> function getAddress (node) {  
> return bitcoin.payments.p2pkh({ pubkey: node.publicKey, network}).address  
> }  
> const mnemonic = 'eight better wealth display father cave suffer game
> sign health fit exchange noble tunnel poet remember owner letter
> submit illness cage calm dry noble'  
> console.log('Testing mnemonic: ',bip39.validateMnemonic(mnemonic))  
> const seed = bip39.mnemonicToSeed(mnemonic)  
> const root = bip32.fromSeed(seed)  
> console.log("m/0'/0/1 ->",getAddress(root.derivePath("m/0'/0/1")));  
> console.log("m/0'/0/2 ->",getAddress(root.derivePath("m/0'/0/2")));

.

and this is the output that i got

.

> Testing mnemonic: true  
> m/0'/0/1 -> 17tdSW83Vjw23TdQsmZDtBAupan9WiGGd5  
> m/0'/0/2 -> 17bYSjEXwZxMgVkRRt9pJgDgExiX8Xht3b

Then I go to (<https://www.coinomi.com/recovery-phrase-tool.html>) to test if my results are correct, and it isn't, could someone help me with this please. How to fix the code?

**Tags:** bitcoin-core, bitcoinjs, deterministic-wallets


---

## 1 answers

### Answer by username_1 on 2018-07-24. Score: 0 | Accepted answer

It looks like it is working. Go to https://www.coinomi.com/recovery-phrase-tool.html and make sure to enter the following:
BIP39 Recovery Phrase : eight better wealth display father cave suffer game sign health fit exchange noble tunnel poet remember owner letter submit illness cage calm dry noble
Coin : Bitcoin
BIP32 Derivation Path (In BIP32 Tab): m/0'/0
Result:
Derived Addresses 
m/0'/0/0`   169zFhK1WTuxfhgY6bmzE9zP1godCfZr2V
m/0'/0/1    17tdSW83Vjw23TdQsmZDtBAupan9WiGGd5
m/0'/0/2    17bYSjEXwZxMgVkRRt9pJgDgExiX8Xht3b

> **Comments:**
> **username_0**: hmm thanks, i was using the site wrongly. but just another question, I can get the public key from this code `root.derivePath("m/0'/0/0").publicKey.toString('hex')` and I get "02db987662b3f1a84c8465ac710de96106ba65aef63d0967e605b802d5fd2579e5" with is correct, but with private key, that doens't work, do you know how I can display my private key for path 0/0? (I resolved it by myself, the solution was to use root.derivePath("m/0'/0/0").toWIF()  

---

