<blockquote>
  <p>How much UTXO each address should have to consider generating new address to avoid address re-using?</p>
</blockquote>

<p>Preventing address re-use by itself means that an address should not be used more than once. So unless, someone sends you two outputs to the same address in the same transaction (highly unlikely) you are going to end up with one UTXO per address. Preventing address re-use helps your privacy. For example, say you used an address to receive funds from your customer. If you use the same address again, these customers can actually scan the blockchain to see how much amount you have received from others. Not re-using addresses more than once helps protect your privacy.</p>

<blockquote>
  <p>When new address generated, from my understanding , I've to scan following address for each address derivation path to see if each index have fund or not?</p>
</blockquote>

<p>Depends on what address format are you using for your payment gateway. If you have always generated bech32 addresses, you need not scan the blockchain for P2PKH addresses to see the amount received from your customers. You only need to scan the blockchain for the addresses that you have generated (receiving or change).</p>

CC BY-SA 4.0
2019-06-30T06:38:44.177Z
I still don't get it how to handle address scanning,let's say I don't use P2PKH addresses anymore, over time, When transactions grow and that means generating more new address, Is there good way to handle address scanning considering speed and performance? for example If single user does have 100 transaction(100 addresses?), Should I scan 100 blockchain addresses to find out how much funds user have? In over time, when I have more users and they also generate address does it not going out of control?
Nobit
CC BY-SA 4.0
2019-06-30T07:17:20.377Z
@nobit You cannot do away without scanning the blockchain. If you want to generate more addresses, you would need to scan them to see you have not magically received some funds (after their use) or if there is a leak in the private keys and your bitcoins got spent.
Ugam Kamat
CC BY-SA 4.0
2019-06-30T04:16:53.407Z
2019-06-30T04:16:53.407Z
Ugam Kamat
<blockquote>
  <p>What's best way to scan addresses without submitting so much request (for each index) to blockchain explorer to scan funds?</p>
</blockquote>

<p>You should <strong>not</strong> build your service to trust some third party blockchain explorer service. If you are handling payments from customers, you should be running your own node, and looking to it for confirmation of payments. </p>

CC BY-SA 4.0
2019-06-30T19:06:12.637Z
2019-06-30T19:06:12.637Z
chytrik
<p>I'm developing bitcoin payment processing application.</p>

<p>I've two question to ask:</p>

<ol>
<li>In each bip32 address, How much UTXO each address should have to consider generating new address to avoid address re-using? for example If address A used twice should I generate a new address or does it have specified number for address re-use before generating new one?</li>
<li>When new address generated, from my understanding , I've to scan following address for each address derivation path to see if each index have fund or not:

<ul>
<li>Legacy</li>
<li>Segwit</li>
<li>Change address for Legacy</li>
<li>Change address for Segwit</li>
</ul></li>
</ol>

<p>What's best way to scan addresses without submitting so much request (for each index) to blockchain explorer to scan funds?</p>

<p>Thanks in advance.</p>

<address-generation><bip32-hd-wallets><utxo><bitcoin-wallet-app>
Bitcoin address generation and UTXO scanning
Nobit
# Bitcoin address generation and UTXO scanning

(Asked by: username_0 on 2019-06-29)

I'm developing bitcoin payment processing application.

I've two question to ask:

1. In each bip32 address, How much UTXO each address should have to consider generating new address to avoid address re-using? for example If address A used twice should I generate a new address or does it have specified number for address re-use before generating new one?
2. When new address generated, from my understanding , I've to scan following address for each address derivation path to see if each index have fund or not:
   * Legacy
   * Segwit
   * Change address for Legacy
   * Change address for Segwit

What's best way to scan addresses without submitting so much request (for each index) to blockchain explorer to scan funds?

Thanks in advance.

**Tags:** address-generation, bip32-hd-wallets, utxo, bitcoin-wallet-app


---

## 2 answers

### Answer by username_1 on 2019-06-30. Score: 1 | Accepted answer

> How much UTXO each address should have to consider generating new address to avoid address re-using?

Preventing address re-use by itself means that an address should not be used more than once. So unless, someone sends you two outputs to the same address in the same transaction (highly unlikely) you are going to end up with one UTXO per address. Preventing address re-use helps your privacy. For example, say you used an address to receive funds from your customer. If you use the same address again, these customers can actually scan the blockchain to see how much amount you have received from others. Not re-using addresses more than once helps protect your privacy.

> When new address generated, from my understanding , I've to scan following address for each address derivation path to see if each index have fund or not?

Depends on what address format are you using for your payment gateway. If you have always generated bech32 addresses, you need not scan the blockchain for P2PKH addresses to see the amount received from your customers. You only need to scan the blockchain for the addresses that you have generated (receiving or change).

> **Comments:**
> **username_0**: I still don't get it how to handle address scanning,let's say I don't use P2PKH addresses anymore, over time, When transactions grow and that means generating more new address, Is there good way to handle address scanning considering speed and performance? for example If single user does have 100 transaction(100 addresses?), Should I scan 100 blockchain addresses to find out how much funds user have? In over time, when I have more users and they also generate address does it not going out of control?  
> **username_1**: @username_0 You cannot do away without scanning the blockchain. If you want to generate more addresses, you would need to scan them to see you have not magically received some funds (after their use) or if there is a leak in the private keys and your bitcoins got spent.  

---

### Answer by username_2 on 2019-06-30. Score: 1

> What's best way to scan addresses without submitting so much request (for each index) to blockchain explorer to scan funds?

You should **not** build your service to trust some third party blockchain explorer service. If you are handling payments from customers, you should be running your own node, and looking to it for confirmation of payments.


---

