0

I am little bit confused or not able to get the right Address Node Public key from Account XPUB.

What i have Done :

1==> Get the Account XPUB [78Bytes]

2==> SHA-256

3==> SHA-256 Again

4==> Created Extended XPUB (XPUB + 4 Start Byte of Step 3]

5==> Base 58 ENC

6==> hdnode_deserialize()

7==> Account Node -> Change Node

8==> Change Node -> Address Node.

But Not able to get the right Public Address.

Please let me know if i have done something wrong ?

  • 1
    What you want to achieve (derivation protocol) is precisely described and detailed in BIP32 github.com/bitcoin/bips/blob/master/… ... – darosior Jan 18 at 15:41
  • I just want to get the Address Node Public Address by Account XPUB .. – Amish Sharma Jan 18 at 15:58
  • i am writing my own application and somehow not able to get the right result and seek someone help – Amish Sharma Jan 18 at 15:58
0

To go from account xpub to address, you must first derive an xpub at the External index (0) or Internal index (1), then derive another xpub from the External/Internal xpub. Take the public key from the resulting xpub and this is the public key used for the address.

For a detailed explanation of extended public keys and how to derive child public keys, take a look at the BIP32 documentation. For a not-as-in-depth breakdown of deriving addresses from an extended public key (which is exactly what you're trying to do), I have written this writeup.

| improve this answer | |
  • can you explain it further more, see what steps i have followed to derive Address Node Public Key. is there anything wrong in my implementation or pseudo code ? – Amish Sharma Jan 19 at 5:05
  • @AmishSharma Your implementation/pseudocode is very wrong and not even close to what actually happens. Please read my answer, specifically the second link. – Septem151 Jan 19 at 14:45
  • Sorry, but i i have done some mistake due to which i was not able to derive right address .. My Pseudocode is perfectly fine .. By mistake i called hdnode_private_ckd() instead of hdnode_public_ckd().. – Amish Sharma Jan 19 at 15:05
  • Thanks for your time and feedback.. appreciate it – Amish Sharma Jan 19 at 15:05
  • @AmishSharma Please be careful with whatever you are doing. Your pseudocode does not do what you are asking in your question. – Septem151 Jan 19 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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