3

I'm trying to create an ethereum account using web3-js by providing a mnemonic + passphrase (created with BIP39-js) but can't seem to find an implementation of web3.eth.accounts.create() that accepts both the mnemonic and the passphrase.

Is it not supported or am I missing something on how to implement it?

6

Do it with ethers:

const ethers = require('ethers');
const mnemonic = await ethers.HDNode.entropyToMnemonic(ethers.utils.randomBytes(16));
const wallet = ethers.Wallet.fromMnemonic(mnemonic);

P.S.

Here is a community you can find ask more questions about it:

  • 1
    In the meantime it is: ethers.utils.HDNode.entropyToMnemonic – heinob Feb 17 at 5:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.