<p>I believe by now you should've figured it out but if you haven’t this is how I resolved it.</p>
<pre><code>const ecc = require('tiny-secp256k1')
const { BIP32Factory } = require('bip32')
// You must wrap a tiny-secp256k1 compatible implementation
const bip32 = BIP32Factory(ecc)
</code></pre>
<p>With this you should be able to access these methods.</p>
<p><code>fromSeed, fromBase58, fromPublicKey, fromPrivateKey</code></p>

CC BY-SA 4.0
2022-06-25T15:14:17.907Z
2022-06-25T15:14:17.907Z
iamnotstatic
<p>I am trying to run the below code to print the private key, the Public key and the mnemonics, but getting <code>Uncaught TypeError: bip32.fromSeed is not a function</code> :</p>
<pre><code>//Import dependencies
const bip32 = require('bip32')
const bip39 = require('bip39')
const bitcoin = require('bitcoinjs-lib')

//Define the network
const network = bitcoin.networks.bitcoin //use networks.testnet for testnet

// Derivation path
const path = `m/49'/0'/0'/0` // Use m/49'/1'/0'/0 for testnet

let mnemonic = bip39.generateMnemonic()
const seed = bip39.mnemonicToSeedSync(mnemonic)
let root = bip32.fromSeed(seed, network)

let account = root.derivePath(path)
let node = account.derive(0).derive(0)
let btcAddress = bitcoin.payments.p2pkh({
  pubkey: node.publicKey,
  network: network,
}).address

console.log(`
Wallet generated:
 - Address  : ${btcAddress},
 - Key : ${node.toWIF()}, 
 - Mnemonic : ${mnemonic}
     
`)
</code></pre>
<p>I understand that this could mean the API no longer provides .fromSeed function, so what would be the replacement for it? the <a href="https://github.com/bitcoinjs/bip32/blob/master/README.md" rel="nofollow noreferrer">README</a> is not very clear.</p>
<p>Thank you,</p>

CC BY-SA 4.0
2022-04-13T16:33:27.060Z
Are you sure the bip32 module was installed properly?  Do any of the bip32 functions work such as `bip32.fromBase58('xprvSomeRandomXpriv...')`.
m1xolyd1an
<bip32-hd-wallets><javascript>
Uncaught TypeError: bip32.fromSeed is not a function
spraveenitpro
# Uncaught TypeError: bip32.fromSeed is not a function

(Asked by: username_0 on 2022-04-13)

I am trying to run the below code to print the private key, the Public key and the mnemonics, but getting `Uncaught TypeError: bip32.fromSeed is not a function` :

```
//Import dependencies
const bip32 = require('bip32')
const bip39 = require('bip39')
const bitcoin = require('bitcoinjs-lib')

//Define the network
const network = bitcoin.networks.bitcoin //use networks.testnet for testnet

// Derivation path
const path = `m/49'/0'/0'/0` // Use m/49'/1'/0'/0 for testnet

let mnemonic = bip39.generateMnemonic()
const seed = bip39.mnemonicToSeedSync(mnemonic)
let root = bip32.fromSeed(seed, network)

let account = root.derivePath(path)
let node = account.derive(0).derive(0)
let btcAddress = bitcoin.payments.p2pkh({
  pubkey: node.publicKey,
  network: network,
}).address

console.log(`
Wallet generated:
 - Address  : ${btcAddress},
 - Key : ${node.toWIF()}, 
 - Mnemonic : ${mnemonic}
     
`)

```

I understand that this could mean the API no longer provides .fromSeed function, so what would be the replacement for it? the [README](https://github.com/bitcoinjs/bip32/blob/master/README.md) is not very clear.

Thank you,

**Tags:** bip32-hd-wallets, javascript

> **Comments:**
> **username_1**: Are you sure the bip32 module was installed properly?  Do any of the bip32 functions work such as `bip32.fromBase58('xprvSomeRandomXpriv...')`.  

---

## 1 answers

### Answer by username_2 on 2022-06-25. Score: 6

I believe by now you should've figured it out but if you haven’t this is how I resolved it.

```
const ecc = require('tiny-secp256k1')
const { BIP32Factory } = require('bip32')
// You must wrap a tiny-secp256k1 compatible implementation
const bip32 = BIP32Factory(ecc)

```

With this you should be able to access these methods.

`fromSeed, fromBase58, fromPublicKey, fromPrivateKey`


---

