<p>Any website that is handling user funds should be running a node to ensure they have an accurate view of the network. Depending on an API introduces trust of a third party into the situation, which is an unnecessary risk.</p>
<p>As a developer, you can then simply customize the gap limit to suit your business’ needs. In many cases this likely just means increasing the gap limit to a larger number.</p>

CC BY-SA 4.0
2020-07-25T18:46:18.873Z
2020-07-25T18:46:18.873Z
chytrik
<p>I've read the other questions involving this, including <a href="https://bitcoin.stackexchange.com/questions/48090/how-to-solve-blockchain-20-address-gap-limit-problem">How to solve Blockchain 20 address gap-limit problem?</a> and <a href="https://bitcoin.stackexchange.com/questions/58439/blockchain-gap-limit">Blockchain gap limit</a> which don't actually remedy the issue in a practical sense, only further explain why it exists.</p>
<p>I understand why the gap exists, how it works, and how Blockchain.info handles it. (Both with callbacks, checkgap API requests, returning an error when the gap reaches over 20, etc)
My question is, what can I, as a developer, do to prevent exhausting this gap? Is this even a valid method for handling a larger website's Bitcoin deposits from users? Do I just have to hope that 20 users don't generate an address for fun, sending operations into a standstill?</p>

<blockchain.info><xpub><gap-limit>
How to actually handle the xPub gap limit when receiving Bitcoin deposits?
Ral
# How to actually handle the xPub gap limit when receiving Bitcoin deposits?

(Asked by: username_0 on 2020-07-25)

I've read the other questions involving this, including [How to solve Blockchain 20 address gap-limit problem?](https://bitcoin.stackexchange.com/questions/48090/how-to-solve-blockchain-20-address-gap-limit-problem) and [Blockchain gap limit](https://bitcoin.stackexchange.com/questions/58439/blockchain-gap-limit) which don't actually remedy the issue in a practical sense, only further explain why it exists.

I understand why the gap exists, how it works, and how Blockchain.info handles it. (Both with callbacks, checkgap API requests, returning an error when the gap reaches over 20, etc)
My question is, what can I, as a developer, do to prevent exhausting this gap? Is this even a valid method for handling a larger website's Bitcoin deposits from users? Do I just have to hope that 20 users don't generate an address for fun, sending operations into a standstill?

**Tags:** blockchain.info, xpub, gap-limit


---

## 1 answers

### Answer by username_1 on 2020-07-25. Score: 0 | Accepted answer

Any website that is handling user funds should be running a node to ensure they have an accurate view of the network. Depending on an API introduces trust of a third party into the situation, which is an unnecessary risk.

As a developer, you can then simply customize the gap limit to suit your business’ needs. In many cases this likely just means increasing the gap limit to a larger number.


---

