Bitcoin-com / bitbox-sdk

BITBOX SDK for Bitcoin Cash
https://developer.bitcoin.com/bitbox
MIT License
89 stars 62 forks source link

How to derive address from xPub with BCH? #196

Open j4nos opened 3 years ago

j4nos commented 3 years ago

I need to derive the first address belongs to an xPub.

I checked this documentation: https://github.com/Bitcoin-com/bitbox-sdk/blob/master/docs/hdnode.md#fromxpub

I tried this code:

bitbox.HDNode.fromXPub("xpub6D2vLmZcXc...").derivePath("m/44'/145'/0'/0");

but it returned this error:

not a master node

It seems bitbox.HDNode.fromXPub("xpub6D2vLmZcXc...")returns not master node?!

Do you have any idea how to derive in BCH?

It is important, I do no have any seed, only xPub!

Képernyőfotó 2021-03-16 - 20 24 41