2

I'm just wondering if it's possible to generate HD address using xPub?

I tried to create HD address using BitWASP-PHP with the following path:

m / purpose' / coin_type' / account' / change / address_index

m/44/0'/0'/0/1

but the response is:

Can't derive a hardened key without the private key

I know that I can do it with Bip32 with the following path: 0/addressIndex

but I would like to use bip44.

1 Answer 1

2

Any derivation path with an apostrophe (') signifies that that index should use hardened derivation. Hardened derivation means that you can only use the master private key. So with just an xpub, you cannot derive the full path.

Usually what happens with BIP 44 is that you generate a master private key, derive the keys for the hardened parts of the path, and then use the public key of the last hardened part to derive the addresses using non-hardened derivation.

So you would derive the private key for m/44'/0'/0' using the master private key. Then take the xpub of that derived private key and derive the remaining keys with path m/0/i.

2
  • How to derive change address from m/0/i?
    – Tailer
    Commented Jan 22, 2018 at 3:12
  • 1
    The change addresses would be at m/1/i.
    – Ava Chow
    Commented Jan 22, 2018 at 3:21

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.