<p>I think there is some misconception, or we don't get your question right... One cannot create a "receive address" for an existing address. An address is based on a specific private/public key pair. I recommend looking up some fundamentals on wallets and the creation of addresses. A wallet is a collector of many keys, and one of the keys is used for (a generated) receive addresses. I think what you are asking might go into the direction of HD wallets... I provide some hints at the end. </p>

<p>In short, how to come from a string to an address: you have a private key (which can be your hexadecimal string), which is linked by ECDSA logic to a public key. This pubkey is hashed, some version bit and checksum logic, and finally base58 encoded. Look at <a href="http://gobittest.appspot.com/Address" rel="nofollow noreferrer">this page here</a>, it shows the different steps. Also <a href="https://bitcoin.stackexchange.com/questions/69315/how-are-compressed-pubkeys-generated/69366?noredirect=1#comment80625_69366">here in stackexchange</a> was a discussion specifically for compressed pubkeys, as the uncompressed keys aren't used widely anymore. </p>

<p>As long as you create many private/public keypairs (based on sha256 and "strings"), you can generate as many addresses as you like, and use one of them as receive address. However keep in mind, that if you generate yourself private/public keypairs, you are running into a trap! The keys need to be based on a certain randomness, and if you don't get it right, you will loose your funds. You have been warned :-)</p>

<p>Andreas' book "Mastering Bitcoin" is an amazing book that'll definitely get you some further insights. It's freely <a href="http://chimera.labs.oreilly.com/books/1234000001802/index.html" rel="nofollow noreferrer">available online here</a>. The chapter 4 on keys and 5 on wallets is what you'd be interested in :-)</p>

CC BY-SA 3.0
2018-02-09T10:07:28.993Z
2018-02-09T10:07:28.993Z
pebwindkraft
<p>From: <a href="https://en.bitcoin.it/wiki/Address#A_Bitcoin_address_is_a_single-use_token" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Address#A_Bitcoin_address_is_a_single-use_token</a></p>
<blockquote>
<h3>A Bitcoin address is a single-use token</h3>
<p>Like e-mail addresses, you can send bitcoins to a person by sending bitcoins to one of their addresses. However, unlike e-mail addresses, people have many different Bitcoin addresses and a unique address should be used for each transaction. Most Bitcoin software and websites will help with this by generating a brand new address each time you create an invoice or payment request.</p>
</blockquote>
<p>Your wallet software <em>should</em> (most do) let you create a new receiving address linked to your Private Key. When you receive new Bitcoin on the new receiving address it will show up in your wallet. I think this is what you want.</p>
<p>If you want to create a receiving address yourself from a &quot;string&quot;, I would suggest <a href="https://walletgenerator.net/" rel="nofollow noreferrer">walletgenerator.net</a>. When you open the site, click on <code>skip</code> and then try the Brain Wallet tab. Note that this will let you receive Bitcoin but, in order to see your balance or spend the Bitcoin you will have to import the Private Key into a Bitcoin Wallet. If the Private Key is lost or stolen, your Bitcoin are lost or stolen.</p>

CC BY-SA 3.0
2018-02-09T11:55:32.177Z
2018-02-09T11:55:32.177Z
2020-06-16T11:10:03.350Z
Willtech
<p>Use a deterministic wallet like <a href="https://electrum.org" rel="nofollow noreferrer">electrum</a>. It'll generate a seed mnemonic of 12 words that you can write down. All the addresses in your wallet are derived from that seed mnemonic. Don't try to generate your own seed. Humans are terrible at creating random numbers and if you make one of your own you will be stolen from. You must let the wallet make one for you.</p>

CC BY-SA 3.0
2018-02-09T08:43:26.003Z
Thank you, but I'm looking to programmatically create receive addresses for an existing address (i.e. not creating a new address from scratch).
timothyylim
CC BY-SA 3.0
2018-02-09T08:43:47.137Z
Please see: https://en.bitcoin.it/wiki/Address#A_Bitcoin_address_is_a_single-use_token
timothyylim
CC BY-SA 3.0
2018-02-09T08:17:32.410Z
2018-02-09T08:17:32.410Z
Abdussamad
<p>I already have a an address with Bitcoin and would like to generate <a href="https://en.bitcoin.it/wiki/Address#A_Bitcoin_address_is_a_single-use_token" rel="nofollow noreferrer">a receive address</a> using SHA256 hash which is based on a string. </p>

<p>I've found an example of creating an address using a SHA256 hash:</p>

<p><a href="https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/addresses.js#L19" rel="nofollow noreferrer">https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/addresses.js#L19</a></p>

<p>But I haven't found one to create a receive address from a base address using the same method. </p>

CC BY-SA 3.0
2018-02-09T06:06:36.443Z
I don't understand the question.  How do you want the new address to be related to the existing one?
Nate Eldredge
CC BY-SA 3.0
2018-02-09T06:22:11.667Z
https://en.bitcoin.it/wiki/Address#A_Bitcoin_address_is_a_single-use_token

It should just be a one-time use address that is actually part of the base address.
timothyylim
CC BY-SA 3.0
2018-02-09T06:27:04.167Z
I don't know what you mean by "part of".  What exactly do you want to be able to do?
Nate Eldredge
CC BY-SA 3.0
2018-02-09T06:51:07.980Z
I'm trying to generate a one-time-use address:

https://en.bitcoin.it/wiki/Address#A_Bitcoin_address_is_a_single-use_token

whose funds will be stored in the main address.
timothyylim
<address-generation><sha256>
How do you generate a receive address from a string?
timothyylim
# How do you generate a receive address from a string?

(Asked by: username_0 on 2018-02-09)

I already have a an address with Bitcoin and would like to generate [a receive address](https://en.bitcoin.it/wiki/Address#A_Bitcoin_address_is_a_single-use_token) using SHA256 hash which is based on a string.

I've found an example of creating an address using a SHA256 hash:

<https://github.com/bitcoinjs/bitcoinjs-lib/blob/master/test/integration/addresses.js#L19>

But I haven't found one to create a receive address from a base address using the same method.

**Tags:** address-generation, sha256

> **Comments:**
> **username_1**: I don't understand the question.  How do you want the new address to be related to the existing one?  
> **username_0**: https://en.bitcoin.it/wiki/Address#A_Bitcoin_address_is_a_single-use_token  It should just be a one-time use address that is actually part of the base address.  
> **username_1**: I don't know what you mean by "part of".  What exactly do you want to be able to do?  
> **username_0**: I'm trying to generate a one-time-use address:  https://en.bitcoin.it/wiki/Address#A_Bitcoin_address_is_a_single-use_token  whose funds will be stored in the main address.  

---

## 3 answers

### Answer by username_2 on 2018-02-09. Score: 2 | Accepted answer

I think there is some misconception, or we don't get your question right... One cannot create a "receive address" for an existing address. An address is based on a specific private/public key pair. I recommend looking up some fundamentals on wallets and the creation of addresses. A wallet is a collector of many keys, and one of the keys is used for (a generated) receive addresses. I think what you are asking might go into the direction of HD wallets... I provide some hints at the end.

In short, how to come from a string to an address: you have a private key (which can be your hexadecimal string), which is linked by ECDSA logic to a public key. This pubkey is hashed, some version bit and checksum logic, and finally base58 encoded. Look at [this page here](http://gobittest.appspot.com/Address), it shows the different steps. Also [here in stackexchange](https://bitcoin.stackexchange.com/questions/69315/how-are-compressed-pubkeys-generated/69366?noredirect=1#comment80625_69366) was a discussion specifically for compressed pubkeys, as the uncompressed keys aren't used widely anymore.

As long as you create many private/public keypairs (based on sha256 and "strings"), you can generate as many addresses as you like, and use one of them as receive address. However keep in mind, that if you generate yourself private/public keypairs, you are running into a trap! The keys need to be based on a certain randomness, and if you don't get it right, you will loose your funds. You have been warned :-)

Andreas' book "Mastering Bitcoin" is an amazing book that'll definitely get you some further insights. It's freely [available online here](http://chimera.labs.oreilly.com/books/1234000001802/index.html). The chapter 4 on keys and 5 on wallets is what you'd be interested in :-)


---

### Answer by username_3 on 2018-02-09. Score: 0

From: <https://en.bitcoin.it/wiki/Address#A_Bitcoin_address_is_a_single-use_token>

> ### A Bitcoin address is a single-use token
>
> Like e-mail addresses, you can send bitcoins to a person by sending bitcoins to one of their addresses. However, unlike e-mail addresses, people have many different Bitcoin addresses and a unique address should be used for each transaction. Most Bitcoin software and websites will help with this by generating a brand new address each time you create an invoice or payment request.

Your wallet software *should* (most do) let you create a new receiving address linked to your Private Key. When you receive new Bitcoin on the new receiving address it will show up in your wallet. I think this is what you want.

If you want to create a receiving address yourself from a "string", I would suggest [walletgenerator.net](https://walletgenerator.net/). When you open the site, click on `skip` and then try the Brain Wallet tab. Note that this will let you receive Bitcoin but, in order to see your balance or spend the Bitcoin you will have to import the Private Key into a Bitcoin Wallet. If the Private Key is lost or stolen, your Bitcoin are lost or stolen.


---

### Answer by username_4 on 2018-02-09. Score: 0

Use a deterministic wallet like [electrum](https://electrum.org). It'll generate a seed mnemonic of 12 words that you can write down. All the addresses in your wallet are derived from that seed mnemonic. Don't try to generate your own seed. Humans are terrible at creating random numbers and if you make one of your own you will be stolen from. You must let the wallet make one for you.

> **Comments:**
> **username_0**: Thank you, but I'm looking to programmatically create receive addresses for an existing address (i.e. not creating a new address from scratch).  
> **username_0**: Please see: https://en.bitcoin.it/wiki/Address#A_Bitcoin_address_is_a_single-use_token  

---

