We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I use the following code to generate a bip32 xpub:
function getXpub(mne: string, format: string) { const seed = bip39.mnemonicToSeedSync(mne) const root = bip32.fromSeed(seed) const purpose = format === 'p2pkh' ? '44' : format === 'p2sh-segwit' ? '49' : '84' const path = `m/${purpose}'/1'/0'` const node = root.derivePath(path) return node.neutered().toBase58() }
It generates a correct xpub for legacy p2pkh addresses, but not for segwit addresses. How can I fix it to work with segwit properly?
The text was updated successfully, but these errors were encountered:
Found the answer here #927
Sorry, something went wrong.
@yuradmt mind sharing the snippet that worked?
No branches or pull requests
I use the following code to generate a bip32 xpub:
It generates a correct xpub for legacy p2pkh addresses, but not for segwit addresses. How can I fix it to work with segwit properly?
The text was updated successfully, but these errors were encountered: