So basically i am trying to create my own crypto wallet application in python, i have generated the random entropy, calculated the checksum, generated the 12 words and then generated the root seed using pbkdf2, but after generating the seed I'm kinda lost, i dont know how i can generate the master key and the chaincode, and then generating the public and private keys, lets put for example i have this root seed 1f8c67bc66355f62f6c63752803599cc6e4a05eac6dd63e05e858329f3656ed3c868bd428a4218b4eb92e0fe5e774874c4ab270b8d1377ddc0aea6a797682342 what should i do with it to generate the master private key and then the following child public/private keys? thanks, i'm very new to this in general so sorry if there is any issue with my question

1 Answer 1


Read BIP32 and BIP44. Also learnmeabitcoin.com under HD Wallets and Derivation Paths.

Walk through the open source software implementations step by step.

As a user, Bitcoin Explorer (bx) examples, iancoleman's site code, bitaddress

generate wallets from the command line, bash scripts using Bitcoin Bash Tools etc.

Have a thorough understanding of what these tools are doing as a user before trying to replicate it as a coder

  • i read it a few times but i still didnt understand at all, maybe im doing something wrong ... also i dont want to generate wallets from the command line or any bash scripts i want to create an python code from scratch that does it, i have already generated the seed what i need now is to generate the chain code and the master private key but i cant figure out exactly how i can generate those...
    – user132741
    Commented Mar 2, 2022 at 9:12
  • @user132741 If you can be more specific, people will be more able to help. Can you say exactly which line in BIP32 is holding you up the most? Commented Mar 2, 2022 at 9:15
  • @RedGrittyBrick i am having trouble to understand this topic of the BIP32 documentation: github.com/bitcoin/bips/blob/master/… , my problem is i dont know what to do after hashing the entropy to get the master seed, i dont know exactly how to be more clear but lets give an example of this seed i generated just now d213b3de1949e716b2e5fb96ae62efa0c27843debf4372e8840ebc7f87024f6cb10126e51bbfecd362ac21105edef4c799b09c973d05a5b566b5173e185e7927 what i do exactly with it to generate the master private key ?
    – user132741
    Commented Mar 2, 2022 at 9:22
  • Do you have a library that implements HMAC-SHA512? Commented Mar 2, 2022 at 9:50

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.