I am trying to understand how to generate addresses from 1 mnemonic for multiple cryptocurrencies.

I needed a read-only wallet, so I guess I need to use an xpub key. But I am struggling to understand wallet tree structure and how to accomplish it.

Till now I am able to do this.

const bip39 = require('bip39')
var HDKey = require('hdkey')

const mnemonic = bip39.generateMnemonic()
const seed = bip39.mnemonicToSeedSync(mnemonic).toString('hex')
let hdkey = HDKey.fromMasterSeed(Buffer.from(seed, 'hex'))
var childkey = hdkey.derive("m/0/0/1")

let publicExtendedKey = hdkey.publicExtendedKey;

My requirement is a user can save 1 mnemonic on his side, and I have a public key using which I can generate addresses for multiple cr

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.