<p>This is called Hierarchical Deterministic key derivation. </p>

<p>New public keys, and by extension Bitcoin addresses, can be generated from a set of parent public keys. This way, the front-end of Shape-shift never needs to communicate with a "hot wallet" and can generate a new set of addresses for every user transaction.</p>

<p>To spend from these addresses, Shapeshift simply derives the corresponding private key (server-side) from its parent private keys.</p>

<p>Child private and public keys can be derived in parallel (front/back-ends), maintaining a fire-wall between them.</p>

<p><strong>Intro to HD Wallets</strong></p>

<p>For details on HD key derivation works, check a recent talk of mine at Scaling Bitcoin: <a href="https://youtu.be/OVvue2dXkJo" rel="nofollow noreferrer">https://youtu.be/OVvue2dXkJo</a>
Slides here: <a href="https://teachbitcoin.github.io/wallets.html#/5" rel="nofollow noreferrer">https://teachbitcoin.github.io/wallets.html#/5</a></p>

CC BY-SA 4.0
2018-11-29T19:55:00.977Z
2018-11-29T19:55:00.977Z
James C.
<p>I am not aware on the way how shapeshift has implemented their solution, maybe a developer from this company reads this forum and can provide an  answer. </p>

<p>Generally there are two approaches for different addresses on a webpage: </p>

<p>1.) the background is running a bitcoin <strong>core node</strong> (or any other wallet software which fits their needs), and everytime a user visits the webpage, the server asks the node for "getnewaddress", and displays this to the browser. There might then be some logic in their back office app, to convert/move values to the correct "other chain".</p>

<p>2.) usage of <strong>HD keys</strong>. HD keys come with xpriv and xpub, which can generate a set of 2^31 keys from a single privkey. There is a slight problem with this, these HD keys cannot be handed out easily to the customer, cause they are derived from a single privkey. But for the shape shift service it is more than sufficient, cause they use "one-time" addresses...</p>

CC BY-SA 4.0
2018-05-17T01:34:54.233Z
They do not necessarily need to use an HD wallet nor do they need to use Bitcoin Core. They can just be generating random private keys as is the traditional way to generate private keys using any software that they want.
Ava Chow
CC BY-SA 3.0
2018-03-15T11:44:00.203Z
And how could I generate HD keys? Do I need a full cryptocurrency node for this?
marc
CC BY-SA 3.0
2018-03-15T11:50:09.810Z
not sure about your question... generally you don't need a full node. It  depends what you have. You can code your own library (assuming there is some programming experience), you could use libraries (need to do a search, they are available for many programming languages), you can use ready made tools (another search in the forum) or at the end even use Electrum wallet, and type the key's letters and numbers by hand ... well, not really... I recommend to read Andreas' book "Mastering Bitcoin", chapter 5 on wallets, which helps to understand how these keys are generated.
pebwindkraft
CC BY-SA 3.0
2018-03-15T11:58:43.683Z
Yes, I could generate an HD wallet with Electrum, or Trezor and many other hot/cold wallets. But I need to create the addresses on a server and be able to perform transactions. So these wallets are not suitable for this case.
marc
CC BY-SA 3.0
2018-03-15T10:35:28.000Z
2018-03-15T10:35:28.000Z
pebwindkraft
<p>I found that ShapeShift generates new address for each transaction. How do they do that? Is it possible to exchange the coins in the same manner as ShapeShift do, but without the creation of new address? </p>

<exchanges><shapeshift.io>
How do services like ShapeShift generate new addresses
marc
# How do services like ShapeShift generate new addresses

(Asked by: username_0 on 2018-03-15)

I found that ShapeShift generates new address for each transaction. How do they do that? Is it possible to exchange the coins in the same manner as ShapeShift do, but without the creation of new address?

**Tags:** exchanges, shapeshift.io


---

## 2 answers

### Answer by username_1 on 2018-11-29. Score: 1

This is called Hierarchical Deterministic key derivation.

New public keys, and by extension Bitcoin addresses, can be generated from a set of parent public keys. This way, the front-end of Shape-shift never needs to communicate with a "hot wallet" and can generate a new set of addresses for every user transaction.

To spend from these addresses, Shapeshift simply derives the corresponding private key (server-side) from its parent private keys.

Child private and public keys can be derived in parallel (front/back-ends), maintaining a fire-wall between them.

**Intro to HD Wallets**

For details on HD key derivation works, check a recent talk of mine at Scaling Bitcoin: <https://youtu.be/OVvue2dXkJo>
Slides here: <https://teachbitcoin.github.io/wallets.html#/5>


---

### Answer by username_2 on 2018-03-15. Score: 0

I am not aware on the way how shapeshift has implemented their solution, maybe a developer from this company reads this forum and can provide an answer.

Generally there are two approaches for different addresses on a webpage:

1.) the background is running a bitcoin **core node** (or any other wallet software which fits their needs), and everytime a user visits the webpage, the server asks the node for "getnewaddress", and displays this to the browser. There might then be some logic in their back office app, to convert/move values to the correct "other chain".

2.) usage of **HD keys**. HD keys come with xpriv and xpub, which can generate a set of 2^31 keys from a single privkey. There is a slight problem with this, these HD keys cannot be handed out easily to the customer, cause they are derived from a single privkey. But for the shape shift service it is more than sufficient, cause they use "one-time" addresses...

> **Comments:**
> **username_0**: And how could I generate HD keys? Do I need a full cryptocurrency node for this?  
> **username_2**: not sure about your question... generally you don't need a full node. It  depends what you have. You can code your own library (assuming there is some programming experience), you could use libraries (need to do a search, they are available for many programming languages), you can use ready made tools (another search in the forum) or at the end even use Electrum wallet, and type the key's letters and numbers by hand ... well, not really... I recommend to read Andreas' book "Mastering Bitcoin", chapter 5 on wallets, which helps to understand how these keys are generated.  
> **username_0**: Yes, I could generate an HD wallet with Electrum, or Trezor and many other hot/cold wallets. But I need to create the addresses on a server and be able to perform transactions. So these wallets are not suitable for this case.  
> **username_3**: They do not necessarily need to use an HD wallet nor do they need to use Bitcoin Core. They can just be generating random private keys as is the traditional way to generate private keys using any software that they want.  

---

