How can I generate a wallet address when given an Extended Public Key?
For example, an xpub key from Electrum?
I know this can be done with bitcoin and litecoin, is there a way to do it with Ethereum?
Thank you
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.
Sign up to join this communityethereumjs-wallet does support HDWallet and let you calculate the address corresponding to an extended public key
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')}`);