<p>This is a pretty broad question that also has some opinion/preference nuances.</p>
<p>To try to answer your question, yes, a new address for each new deposit.</p>
<p>Whether these funds by default go to a hot wallet or cold wallet is a preference and will differ depending on the exchange.</p>
<p>I would suggest that best practice would be to have all user deposit funds going to cold addresses in a cold wallet, and separately have a hot wallet that funds are sent from. This means you need enough funds in a hot wallet to maintain daily user withdrawal requests. Eventually cold funds will be moved to the hot wallet to make up for spent funds, which I suppose is what you mean when you say &quot;only that address gets topped up and withdrawn from.&quot; But your scenario implies address re-use so instead think of the same idea but topping up a hot wallet vs a single address.</p>

CC BY-SA 4.0
2022-01-02T20:51:29.247Z
So in the hot wallet withdrawals, would address reuse still happen? For example, an address contains 2 btc but a user only wants to withdraw 1 btc. Would the address need to be reused in another withdrawal(s) to get rid of the remaining balance?
Bob Marshall
CC BY-SA 4.0
2022-01-03T05:21:18.237Z
No you spend the full amount and send the left over to a change address.
m1xolyd1an
CC BY-SA 4.0
2022-01-02T05:21:22.673Z
2022-01-02T05:21:22.673Z
m1xolyd1an
<p>Suppose users on an exchange deposit bitcoin to different addresses using the HD wallet structure. Now suppose a user wants to withdraw bitcoin to an external address.</p>
<p>How would this whole process be done behind the scenes? I'm assuming the following happens:</p>
<p>A new address is generated for each deposit. Also, one address stores coins up to a certain amount, and the rest gets transferred into a cold wallet. This is done by making a transaction to this address when a deposit happens as long as the address contains bitcoin under some threshold. Then when withdrawals occur, only that address gets topped up and withdrawn from. This makes it easy to know which address contains coins that can be withdrawn from, and this address will contain a large enough amount of bitcoin so multiple transactions across different addresses aren't needed for a withdrawal.</p>
<p>Is this what happens in practice?</p>

<transactions><exchanges><bip32-hd-wallets>
How do exchanges manage deposits and withdrawals?
Bob Marshall
# How do exchanges manage deposits and withdrawals?

(Asked by: username_0 on 2022-01-02)

Suppose users on an exchange deposit bitcoin to different addresses using the HD wallet structure. Now suppose a user wants to withdraw bitcoin to an external address.

How would this whole process be done behind the scenes? I'm assuming the following happens:

A new address is generated for each deposit. Also, one address stores coins up to a certain amount, and the rest gets transferred into a cold wallet. This is done by making a transaction to this address when a deposit happens as long as the address contains bitcoin under some threshold. Then when withdrawals occur, only that address gets topped up and withdrawn from. This makes it easy to know which address contains coins that can be withdrawn from, and this address will contain a large enough amount of bitcoin so multiple transactions across different addresses aren't needed for a withdrawal.

Is this what happens in practice?

**Tags:** transactions, exchanges, bip32-hd-wallets


---

## 1 answers

### Answer by username_1 on 2022-01-02. Score: 2 | Accepted answer

This is a pretty broad question that also has some opinion/preference nuances.

To try to answer your question, yes, a new address for each new deposit.

Whether these funds by default go to a hot wallet or cold wallet is a preference and will differ depending on the exchange.

I would suggest that best practice would be to have all user deposit funds going to cold addresses in a cold wallet, and separately have a hot wallet that funds are sent from. This means you need enough funds in a hot wallet to maintain daily user withdrawal requests. Eventually cold funds will be moved to the hot wallet to make up for spent funds, which I suppose is what you mean when you say "only that address gets topped up and withdrawn from." But your scenario implies address re-use so instead think of the same idea but topping up a hot wallet vs a single address.

> **Comments:**
> **username_0**: So in the hot wallet withdrawals, would address reuse still happen? For example, an address contains 2 btc but a user only wants to withdraw 1 btc. Would the address need to be reused in another withdrawal(s) to get rid of the remaining balance?  
> **username_1**: No you spend the full amount and send the left over to a change address.  

---

