<p>This is done using heirarchical deterministic (HD) wallets. Using an <strong>extended</strong> private key, you can generate an infinite number of children, grandchildren, etc. private and public keys. <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" rel="nofollow noreferrer">BIP 32</a> lays out exactly how this works.</p>

<p>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 <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#master-key-generation" rel="nofollow noreferrer">Master Key Generation</a> 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.</p>

CC BY-SA 3.0
2017-07-27T13:00:22.667Z
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)?
mjbeyeler
CC BY-SA 3.0
2017-10-25T14:22:29.010Z
(1) Just one (2) No, it would be days of work with pen and paper.
Pieter Wuille
CC BY-SA 3.0
2017-07-27T12:49:40.640Z
2017-07-27T12:49:40.640Z
meshcollider
<p>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).</p>

<p>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?</p>

<p>Best regards</p>

<address-generation>
How can I conveniently generate new addresses for my public key?
mjbeyeler
# How can I conveniently generate new addresses for my public key?

(Asked by: username_0 on 2017-07-27)

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

**Tags:** address-generation


---

## 1 answers

### Answer by username_1 on 2017-07-27. Score: 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](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) 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](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#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.

> **Comments:**
> **username_0**: 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)?  
> **username_2**: (1) Just one (2) No, it would be days of work with pen and paper.  

---

