Author

Topic: HD Key Derivation Help (Read 211 times)

staff
Activity: 3458
Merit: 6793
Just writing some code
October 18, 2018, 12:01:34 AM
#2
I have implemented public BIP 32 derivation in a project of mine, you can look at the implementation here: https://github.com/achow101/HWI/blob/master/hwilib/bip32.py. The function that does the derivation is CKDpub and it takes as arguments: the parent public key as bytes, the parent chaincode as bytes, and the index of the child to derive as an integer.

It will only derive a child key at a particular index. You can derive keys at paths by using a loop to derive the child at each step in the path until you get to the final child.

If all you need is public derivation, then you can use that code. It is provided under the MIT license.
jr. member
Activity: 34
Merit: 8
October 17, 2018, 10:35:28 AM
#1
Greetings,

  I am trying to create a python routine/function that would take an input of a xpub public key from a HD wallet, and return list of public addresses / change addresses
  We wont have access to the xpriv, or the seed.

  Ive spend a good amount of time trying to put this together by looking through other projects, and diving through alot of docs.    I was hoping I could get some advise or help.

Thx
merclyn
Jump to: