I'm working a project in nodejs which involves getting address/public key info from supplied xpub string. I've managed to do this on multiple other cryptocurrencies, but have run into problems with XLM (stellar).

Using the bip32 library, I'm trying the following:

const xpub = "...";

const root = bip32.fromBase58(xpub);

But this results in error 'network is invalid'. If I try the 'dummy' network values as found deep in code on https://iancoleman.io/bip39/

const network = { bip32: {public: 0, private: 0}, messagePrefix: '', pubKeyHash: 0, scriptHash: 0, wif: 0, }

const root = bip32.fromBase58(xpub, network);

I've also had a look at stellar-base and stellar-sdk libraries, but can't see a clear/easy to achieve this.

So the question, is this the correct approach for XLM, or is it handled differently for XLM?

I'm new to the stellar world, so probably just missing something easy/obvious.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.