<p>This doesn't sound correct to me.</p>

<ol>
<li><p>You're relying on a centralized service to fetch blocks.  What if their system has an error and sends you incorrect data?<br>
What if their service is unreachable?</p></li>
<li><p>It doesn't seem like you have any way to handle blockchain reorganization.  You might end up crediting a payment twice, or crediting where a double spend was successful in a competing chain.</p></li>
</ol>

<p>Consider looking into something like <a href="https://github.com/btcpayserver/btcpayserver-doc" rel="nofollow noreferrer">BTCpay</a> which FOSS self-hosted bitcoin payment processor.</p>

CC BY-SA 4.0
2018-12-31T15:41:05.973Z
I've been thinking [Blockchain.com](http://blockchain.com) is a trusted service and we can rely on them and I don't want to maintain a node on my server.

For the (2.), I fetch only blocks that have at least n confirmations and fetch only 1 block (1 time) at any height. I haven't known any other mechanism to handle blockchain reorganization.

Do you think electrum.org or a centralized service is a better choice in my case? Thank you.
Luong Nguyen
CC BY-SA 4.0
2018-12-31T16:55:37.417Z
Blockchain[dot]com is definitely not a trusted service.  Really there are not _any_ trusted services in bitcoin.  WRT electrum, it's a bit better but you will lose all your privacy in the process.   I still believe something like BTCpay is your best bet.
arubi
CC BY-SA 4.0
2018-12-31T06:56:53.130Z
2018-12-31T06:56:53.130Z
arubi
<p>I'm implementing a Bitcoin payment system that generates bitcoin address for each user to deposit.
I use BitcoinJ to generate user's addresses and <code>rawblock</code> API from <a href="https://www.blockchain.com/api/blockchain_api" rel="nofollow noreferrer">Blockchain.com</a> to get every single block to check if my addresses are in any transaction output, then my system increases the user's internal balance.</p>

<p>I save scanned block height in the database and send a request for a new block every 10 minutes.</p>

<p>Is that solution correct? (I need testnet so I cannot use their Wallet Service)</p>

<p>Thank you.</p>

<blockchain.info><deposit>
Detect received transactions of thousands of Bitcoin addresses
Luong Nguyen
# Detect received transactions of thousands of Bitcoin addresses

(Asked by: username_0 on 2018-12-31)

I'm implementing a Bitcoin payment system that generates bitcoin address for each user to deposit.
I use BitcoinJ to generate user's addresses and `rawblock` API from [Blockchain.com](https://www.blockchain.com/api/blockchain_api) to get every single block to check if my addresses are in any transaction output, then my system increases the user's internal balance.

I save scanned block height in the database and send a request for a new block every 10 minutes.

Is that solution correct? (I need testnet so I cannot use their Wallet Service)

Thank you.

**Tags:** blockchain.info, deposit


---

## 1 answers

### Answer by username_1 on 2018-12-31. Score: 2 | Accepted answer

This doesn't sound correct to me.

1. You're relying on a centralized service to fetch blocks. What if their system has an error and sends you incorrect data?  
   What if their service is unreachable?
2. It doesn't seem like you have any way to handle blockchain reorganization. You might end up crediting a payment twice, or crediting where a double spend was successful in a competing chain.

Consider looking into something like [BTCpay](https://github.com/btcpayserver/btcpayserver-doc) which FOSS self-hosted bitcoin payment processor.

> **Comments:**
> **username_0**: I've been thinking [Blockchain.com](http://blockchain.com) is a trusted service and we can rely on them and I don't want to maintain a node on my server.  For the (2.), I fetch only blocks that have at least n confirmations and fetch only 1 block (1 time) at any height. I haven't known any other mechanism to handle blockchain reorganization.  Do you think electrum.org or a centralized service is a better choice in my case? Thank you.  
> **username_1**: Blockchain[dot]com is definitely not a trusted service.  Really there are not _any_ trusted services in bitcoin.  WRT electrum, it's a bit better but you will lose all your privacy in the process.   I still believe something like BTCpay is your best bet.  

---

