[Ethereum] Web3 create account from mnemonic + passphrase

bip39hd-walletsjavascriptweb3js

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?

Best Answer

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:

Related Topic