DEV Community

ishwar
ishwar

Posted on

1 3

Create ethereum address | Ethereum HD wallet

/*
BIP39: Mnemonic code for generating deterministic keys , BIP39 - used to manage your recovery seed and recovery words. Abstract. This BIP describes the implementation of a mnemonic code or mnemonic sentence – a group of easy to remember words – for the generation of deterministic wallets. It consists of two parts: generating the mnemonic, and converting it into a binary seed
*/
let bip39 = require("bip39");

/*
A lightweight wallet implementation. At the moment it supports key creation and conversion between various formats.
To use BIP32 HD wallets, first include the hdkey submodule,
For the seed i suggest to use bip39.
*/
let hdkey = require('ethereumjs-wallet');

 let wallet_hdpath = "m/44'/60'/0'/0/";
 let hdwallet = hdkey.fromMasterSeed(bip39.mnemonicToSeed(seed));
 let wallet = hdwallet.derivePath(wallet_hdpath + index).getWallet();
Enter fullscreen mode Exit fullscreen mode

Now from wallet you can get privatekey and address both

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs