Author

Topic: Creating public address from ethereum xpub (Read 116 times)

sr. member
Activity: 1064
Merit: 382
Hurrah for Karamazov!
June 01, 2018, 02:31:14 PM
#3
Is it possible to generate new ethereum public address from extended public key?
Thanks!

Have you ended up finding this...

Code:
var hdkey = require('ethereumjs-wallet/hdkey');

var extPubKey = 'xpub6ERoQFMqiUoTXAL56JpQYLq5FyXaZypJiKdsAbHKzMUQsSiJTNSMnBtYYRXxda9C6fUx6mMMqatUDNFSKxxXcpBcpPkTqVwyethpWiQN8p5';

var hdwallet = hdkey.fromExtendedKey(extPubKey);
var wallet = hdwallet.getWallet();
var address = wallet.getAddress();

console.log(`Address: 0x${address.toString('hex')}`);
Thanks for looking!
Yea, I got it but I am getting a build error everytime :/
Don't know what's going wrong.If there's any other way, that would be so helpful.
copper member
Activity: 630
Merit: 420
We are Bitcoin!
Is it possible to generate new ethereum public address from extended public key?
Thanks!

Have you ended up finding this...

Code:
var hdkey = require('ethereumjs-wallet/hdkey');

var extPubKey = 'xpub6ERoQFMqiUoTXAL56JpQYLq5FyXaZypJiKdsAbHKzMUQsSiJTNSMnBtYYRXxda9C6fUx6mMMqatUDNFSKxxXcpBcpPkTqVwyethpWiQN8p5';

var hdwallet = hdkey.fromExtendedKey(extPubKey);
var wallet = hdwallet.getWallet();
var address = wallet.getAddress();

console.log(`Address: 0x${address.toString('hex')}`);
sr. member
Activity: 1064
Merit: 382
Hurrah for Karamazov!
Is it possible to generate new ethereum public address from extended public key?
Thanks!
Jump to: