I am having difficulty reproducing the private key and address using the mnemonic and HD path provided by Ganache.


weird farm vast surge upper truth answer end radar impact mind jeans

HD Path


enter image description here

enter image description here

JS Code to Reproduce Keys/Addresses

var hdkey = require('ethereumjs-wallet/hdkey')

let rootNode = hdkey.fromMasterSeed('weird farm vast surge upper truth answer end radar impact mind jeans')
console.log('Address: ', rootNode.derivePath("m/44'/60'/0'/0/0").getWallet().getAddressString())
console.log('Private Key: ', rootNode.derivePath("m/44'/60'/0'/0/0").getWallet().getPrivateKeyString())

JS Output

Address: 0xccb154949e497124538e918fbc3146500ebbe38e

Private Key: 0xa0f34e8dddc55fb9a59a00f58499faa96bebfe1b47b5b821f6f2bb303895c309

Question: Why are the address and private key produced by the JS code (ethereumjs-wallet) different from the one in Ganache?

Using Ganache 1.2.2 on Mac OSX, ethereumjs-wallet 0.6.2


Your Answer

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

Browse other questions tagged or ask your own question.