<p>When you say simplified code it's hard to tell where you are going wrong.</p>
<p>Here's an example of how you can derive a bip44 key pair from a mnemonic using bitcoinjs-lib v3.3.2</p>
<pre><code>let mnemonicInput = 'width bicycle axis tell burst outdoor tray episode where they forest meadow enhance twin focus';
let seedHex = bip39.mnemonicToSeedSync(mnemonicInput).toString('hex');

//&quot;14a3235efb14b096e8cc3082b89e0b629ec5c7b2c6621343b2657cb61853b0830623e97b8aeac416d3377b4da90a4838d9aea4d83e0117fd833049305af46f10&quot;

let root = bitcoin.HDNode.fromSeedHex(seedHex);
let deriv = 44;
let account = 0;
let change = 0;
let index = 0;

let acct = root.derivePath(&quot;m/&quot;+deriv+&quot;'/0'/&quot;+account+&quot;'&quot;);
let xpub = acct.neutered().toBase58();
let pair = acct.derivePath(change+&quot;/&quot;+index).keyPair;

let wifkey = pair.toWIF();
let address = pair.getAddress();

//&quot;address&quot;:&quot;1BogrbApan5Q9xEFEzwPioRu3ogYkzAQZU&quot;
//&quot;wifkey&quot;:&quot;L46hcht5ue2tsSKmPEV2v41CrGU8DEJAP1w7XYPbvJ72v5NBPsPF&quot;
</code></pre>

CC BY-SA 4.0
2021-05-10T04:06:02.337Z
2021-05-10T04:06:02.337Z
m1xolyd1an
<p>I'm trying to go from seed phrase/mnemonic to payable address using BIP 44.  Here is a simplified version of the code I'm using.  However, when I compare with <a href="https://iancoleman.io/bip39/" rel="nofollow noreferrer">https://iancoleman.io/bip39/</a> the private, public, and address don't match up.</p>
<pre><code>var mnemonic = require('bitcore-mnemonic')
var bitcore = require('bitcore-lib')

var code = new mnemonic(&quot;width bicycle axis tell burst outdoor tray episode where they forest meadow enhance twin focus&quot;);

var xpriv = code.toHDPrivateKey(bitcore.Networks.livenet);
var derived = xpriv.derive(&quot;m/44'/0'/0'/0/0&quot;)

var privateKey = derived.privateKey
var publicKey = derived.publicKey
var address = new bitcore.Address(publicKey)

console.log(`address: ${address}`)
console.log(`privateKey: ${privateKey}`)
console.log(`publicKey: ${publicKey}`)
</code></pre>
<p>This code outputs:</p>
<pre><code>address: 14TomZRSGPtoPGy9HZA8WfX2veMbDXyAAJ
privateKey: 34fb6aee170bb41fe47f97ab601fea589620cf182ecf031688c25e5491c2c06f
publicKey: 027869eb83bbb44621c868fbd2a31daed4a0f8dbaa73d3fd79a597cdb1afcc9d1d
</code></pre>
<p>However when I go to <a href="https://iancoleman.io/bip39/" rel="nofollow noreferrer">https://iancoleman.io/bip39/</a>
it give as the first address with this seed phrase to be:</p>
<pre><code>path: m/44'/0'/0'/0/0
address: 1BogrbApan5Q9xEFEzwPioRu3ogYkzAQZU
public: 0236f0bf97fa766301e1137bef8377e6f6063b8a576bda57220c7ab6cf531cc992
private: L46hcht5ue2tsSKmPEV2v41CrGU8DEJAP1w7XYPbvJ72v5NBPsPF
</code></pre>

<bip32-hd-wallets><address-generation><mnemonic-seed><bitcore><bip44>
Deriving payable address from mnemonic using BIP44
Alexis
# Deriving payable address from mnemonic using BIP44

(Asked by: username_0 on 2021-05-09)

I'm trying to go from seed phrase/mnemonic to payable address using BIP 44. Here is a simplified version of the code I'm using. However, when I compare with <https://iancoleman.io/bip39/> the private, public, and address don't match up.

```
var mnemonic = require('bitcore-mnemonic')
var bitcore = require('bitcore-lib')

var code = new mnemonic("width bicycle axis tell burst outdoor tray episode where they forest meadow enhance twin focus");

var xpriv = code.toHDPrivateKey(bitcore.Networks.livenet);
var derived = xpriv.derive("m/44'/0'/0'/0/0")

var privateKey = derived.privateKey
var publicKey = derived.publicKey
var address = new bitcore.Address(publicKey)

console.log(`address: ${address}`)
console.log(`privateKey: ${privateKey}`)
console.log(`publicKey: ${publicKey}`)

```

This code outputs:

```
address: 14TomZRSGPtoPGy9HZA8WfX2veMbDXyAAJ
privateKey: 34fb6aee170bb41fe47f97ab601fea589620cf182ecf031688c25e5491c2c06f
publicKey: 027869eb83bbb44621c868fbd2a31daed4a0f8dbaa73d3fd79a597cdb1afcc9d1d

```

However when I go to <https://iancoleman.io/bip39/>
it give as the first address with this seed phrase to be:

```
path: m/44'/0'/0'/0/0
address: 1BogrbApan5Q9xEFEzwPioRu3ogYkzAQZU
public: 0236f0bf97fa766301e1137bef8377e6f6063b8a576bda57220c7ab6cf531cc992
private: L46hcht5ue2tsSKmPEV2v41CrGU8DEJAP1w7XYPbvJ72v5NBPsPF

```

**Tags:** bip32-hd-wallets, address-generation, mnemonic-seed, bitcore, bip44


---

## 1 answers

### Answer by username_1 on 2021-05-10. Score: 2 | Accepted answer

When you say simplified code it's hard to tell where you are going wrong.

Here's an example of how you can derive a bip44 key pair from a mnemonic using bitcoinjs-lib v3.3.2

```
let mnemonicInput = 'width bicycle axis tell burst outdoor tray episode where they forest meadow enhance twin focus';
let seedHex = bip39.mnemonicToSeedSync(mnemonicInput).toString('hex');

//"14a3235efb14b096e8cc3082b89e0b629ec5c7b2c6621343b2657cb61853b0830623e97b8aeac416d3377b4da90a4838d9aea4d83e0117fd833049305af46f10"

let root = bitcoin.HDNode.fromSeedHex(seedHex);
let deriv = 44;
let account = 0;
let change = 0;
let index = 0;

let acct = root.derivePath("m/"+deriv+"'/0'/"+account+"'");
let xpub = acct.neutered().toBase58();
let pair = acct.derivePath(change+"/"+index).keyPair;

let wifkey = pair.toWIF();
let address = pair.getAddress();

//"address":"1BogrbApan5Q9xEFEzwPioRu3ogYkzAQZU"
//"wifkey":"L46hcht5ue2tsSKmPEV2v41CrGU8DEJAP1w7XYPbvJ72v5NBPsPF"

```


---

