<p>If you intend to monitor an enormous number of addresses or output scripts, regular wallet software will probably not scale to your needs.</p>
<p>You may want to use a database based approach in conjunction with your own instance of blockchain explorer software (e.g. mempool.space, Esplora, or Electrum Server). If your needs scale beyond that, you may want to run your own indexer (see e.g. <a href="https://github.com/dpc/rust-bitcoin-indexer/wiki/How-to-interact-with-a-blockchain" rel="nofollow noreferrer">rust-bitcoin-indexer</a>).</p>
<p>I suggest that you do not assign each user a single address, but rather an extended pubkey, i.e. an entire series of address. While some users might still reuse addresses, this will enable your savvy users to use fresh addresses for each deposit which will vastly improve your and their financial privacy.</p>
<p>You may also find it useful to look into projects such as <a href="https://bitcoindevkit.org/" rel="nofollow noreferrer">BDK</a> and <a href="https://btcpayserver.org/" rel="nofollow noreferrer">BTCPay Server</a> which may meet your needs out of the box at least initially.</p>

CC BY-SA 4.0
2024-08-21T17:01:06.270Z
Hello, thanks a lot for you answer, I think I'm just gonna follow your advice, I'll just make a deposit page where the user gonna select which crypto he want to deposit (bitcoin in this case for example), and then I will redirect him to a page where I will show him the address where he need to deposit and I will monitor it using blockchain.info websocket (I'm still not aware of their limits, still waiting for an answer from them) and monitor it for a restricted time, like 30mins maybe, and after this time, the "deposit page" will no be usable anymore
Outlawz Molotov
CC BY-SA 4.0
2024-08-21T17:29:17.883Z
The problem here is that Bitcoin addresses remain valid indefinitely after you have handed them out, so stopping to monitor them after 30 minutes may lead to frequent support requests. I would suggest that you monitor each address in perpetuity after giving it out.—Otherwise, you may need to manually backfill frequently, as transactions taking more than 30 minutes for confirmation is not uncommon.
Murch
CC BY-SA 4.0
2024-08-21T18:25:29.217Z
Yes you are right, I've checked BTCPay and it's very interesting, I can add altcoins with it etc.. to it, that's pretty cool

Do you know if BTCPay respect the privacy of their customers ? I mean if they collect any data etc.. ?
Outlawz Molotov
CC BY-SA 4.0
2024-08-21T19:34:12.633Z
If you have a new question, please create another topic.
Murch
CC BY-SA 4.0
2024-08-21T16:55:32.023Z
2024-08-21T17:05:34.820Z
2024-08-21T17:05:34.820Z
Murch
<p>I'm actually making a crypto deposit gateway,</p>
<p>I succeed to create multiple public addresses with derivationPath using bitcoinjs-lib,
<strong>But the thing is I'd like to know what is the best way to monitor them</strong> ? (regarding to ressource cost and number of wallets I need to monitor)</p>
<p>Knowing that the number of address to monitor can be huge and exceed 10k for example (if I have 10k users).</p>
<p>The logic behind it is when a user create an account I'm gonna create him public address and assign it to him in database side, after that I just want to detect incoming transactions to be able to add him the amount present inside the transaction.</p>
<p>Regards,</p>

<blockchain><bitcoinjs><monitoring>
Monitor multiple p2wpkh addresses
Outlawz Molotov
# Monitor multiple p2wpkh addresses

(Asked by: username_0 on 2024-08-21)

I'm actually making a crypto deposit gateway,

I succeed to create multiple public addresses with derivationPath using bitcoinjs-lib,
**But the thing is I'd like to know what is the best way to monitor them** ? (regarding to ressource cost and number of wallets I need to monitor)

Knowing that the number of address to monitor can be huge and exceed 10k for example (if I have 10k users).

The logic behind it is when a user create an account I'm gonna create him public address and assign it to him in database side, after that I just want to detect incoming transactions to be able to add him the amount present inside the transaction.

Regards,

**Tags:** blockchain, bitcoinjs, monitoring


---

## 1 answers

### Answer by username_1 on 2024-08-21. Score: 0 | Accepted answer

If you intend to monitor an enormous number of addresses or output scripts, regular wallet software will probably not scale to your needs.

You may want to use a database based approach in conjunction with your own instance of blockchain explorer software (e.g. mempool.space, Esplora, or Electrum Server). If your needs scale beyond that, you may want to run your own indexer (see e.g. [rust-bitcoin-indexer](https://github.com/dpc/rust-bitcoin-indexer/wiki/How-to-interact-with-a-blockchain)).

I suggest that you do not assign each user a single address, but rather an extended pubkey, i.e. an entire series of address. While some users might still reuse addresses, this will enable your savvy users to use fresh addresses for each deposit which will vastly improve your and their financial privacy.

You may also find it useful to look into projects such as [BDK](https://bitcoindevkit.org/) and [BTCPay Server](https://btcpayserver.org/) which may meet your needs out of the box at least initially.

> **Comments:**
> **username_0**: Hello, thanks a lot for you answer, I think I'm just gonna follow your advice, I'll just make a deposit page where the user gonna select which crypto he want to deposit (bitcoin in this case for example), and then I will redirect him to a page where I will show him the address where he need to deposit and I will monitor it using blockchain.info websocket (I'm still not aware of their limits, still waiting for an answer from them) and monitor it for a restricted time, like 30mins maybe, and after this time, the "deposit page" will no be usable anymore  
> **username_1**: The problem here is that Bitcoin addresses remain valid indefinitely after you have handed them out, so stopping to monitor them after 30 minutes may lead to frequent support requests. I would suggest that you monitor each address in perpetuity after giving it out.—Otherwise, you may need to manually backfill frequently, as transactions taking more than 30 minutes for confirmation is not uncommon.  
> **username_0**: Yes you are right, I've checked BTCPay and it's very interesting, I can add altcoins with it etc.. to it, that's pretty cool  Do you know if BTCPay respect the privacy of their customers ? I mean if they collect any data etc.. ?  
> **username_1**: If you have a new question, please create another topic.  

---

