/* Author: Robert Lie (mobilefish.com) More information about this file, see: https://www.mobilefish.com/developer/blockchain/blockchain_quickguide_ethereum_tools.html Usage: - Generate the public addresses based on the mnemonic words. - Rename this file to bip44_mnemonic_example1.js - Run this script, type: bip44_mnemonic_example1.js */ var Mnemonic = require('bitcore-mnemonic'); var EthereumBip44 = require('ethereum-bip44'); var secret = "venture around leisure ocean census obey theory spring buzz stick donor broom"; var code = new Mnemonic(secret, Mnemonic.Words.ENGLISH); console.log(code.toString()); var HDPrivateKey = code.toHDPrivateKey(); var derivedPubKey = HDPrivateKey.derive("m/44'/60'/0'/0").hdPublicKey; console.log(derivedPubKey.toString()); // create the hd wallet var wallet = EthereumBip44.fromPublicSeed(derivedPubKey.toString()); console.log("Public addresses:"); // output the first address console.log(wallet.getAddress(0)); // output the second address console.log(wallet.getAddress(1))