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?

3 Answers 3


Do it with ethers:

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


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, 2019 at 5:41
  • OP mentioned mnemonic + passphrase: there's no passphrase in there. how is this the accepted answer ?
    – Syffys
    Jan 12 at 13:49

Just in case someone comes here later, in the recent version of ethers, HDNODE has been moved to the utils method. So, in modification to @George's answer above;

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

You can use ethers Lib: https://www.npmjs.com/package/ethers

import { ethers } from "ethers";

newWallet = async () => {
    let password = prompt("Password");

    if (password) {
      var randomSeed = ethers.Wallet.createRandom();


      function callback(progress) {
        console.log("Encrypting: " + parseInt(progress * 100) + "% complete");

      let encryptPromise = randomSeed.encrypt(password, callback);

      encryptPromise.then(function (json) {

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.