1

I generated a private key using dice, then wrote a script to konvert that private key to its corresponding public key in its secp256k1 elliptic curve format (a 65-byte number beginning with 04).

Now, I read that there is a very large number of different addresses that one can generate from a single private key, so now I'd like to do exactly that: I would like to generate some random addresses, because I would like to use a different address for each transaction to my private key. Are thera already existing script that generate a certain number of addresses from a private/public key, or do any of you have instructions how I could write it myself?

Best regards

1

This is done using heirarchical deterministic (HD) wallets. Using an extended private key, you can generate an infinite number of children, grandchildren, etc. private and public keys. BIP 32 lays out exactly how this works.

A private key on its own cannot do this, you need an extended private key, which is a private key plus a chain code. So you will have to generate a chain code to go with your private key you've created, or use the private key you've created as a seed for a new extended private key as described in the Master Key Generation section of BIP 32. Once you've done this, you can use your private key and chain code to generate extended children keys, and use them to generate children of children (grandchildren) to your heart's content. Just remember to back up your master private key and chain code because if you lose that, you won't be able to regenerate the child keys.

  • Okay, I see. In this case I have two follow up questions: (1) So how many addresses are there per private key? Just one, or two (maybe each public key component (x and y) has its own address?)? (2) Is the prodedure of generating this master key and deriving compatible normal private keys feasible without computer (e.g. using dice)? – Mandel Jul 27 '17 at 13:00
  • (1) Just one (2) No, it would be days of work with pen and paper. – Pieter Wuille Oct 25 '17 at 14:22

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.