<p>You can host your own Bitcore Web services <a href="https://bitcore.io" rel="nofollow noreferrer">Bitcore</a></p>

<p>You can do things like as follows.</p>

<ol>
<li><p>User present QR with the random address using this library <a href="https://github.com/bitpay/bitcore-lib" rel="nofollow noreferrer">Bitcore Library</a></p></li>
<li><p>User sends payment using wallet.</p></li>
<li><p>Website will be listening to transaction broadcasted by customer wallet.</p></li>
</ol>

<p>Here is the resource for a payment protocol read it thorough you will get an idea. <a href="https://bitcore.io/api/paypro/" rel="nofollow noreferrer">Bitcore Pay Pro</a></p>

<p>Talking about 0-conf: Once a transaction is sent, it is broadcasted immediately even if the next block has a few minutes before its found. If you as a merchant running  a node has capability to verify the transactions.</p>

<p>You can host your own BWS. No need to rely on 3rd party.</p>

<p>For more please refer to bws docs.</p>

CC BY-SA 3.0
2018-04-11T19:53:52.433Z
2018-04-12T19:01:02.127Z
2018-04-12T19:01:02.127Z
Saransh Sharma
<p>You can use the <a href="https://insticce.com/api" rel="nofollow noreferrer">insticce.com api</a> to generate unique addresses for your app. It will hit a callback url of your choice when payment is received. </p>

<p>It also forwards all payments immediately to a forwarding address of your choice. You have the option to wait for a confirmation before getting notified if you like. </p>

<p>If you accept zero conf you will be notified, and also receive the payment at your forwarding address within seconds of the customer hitting "send". </p>

<p>It works on testnet, mainnet and uses cashaddr format.</p>

CC BY-SA 3.0
2018-02-12T06:43:39.450Z
2018-02-12T06:43:39.450Z
curtwphillips
<p>I am currently working on a Bitcoin Cash related project with the goal of helping contribute to the ecosystem. I am getting to the point where I will soon be ready to start integrating with the protocol, but I am not quite sure how to proceed. The workflow I am looking for goes something like this:</p>

<ol>
<li>User visits my website</li>
<li>User is presented a QR code that is for a specific payment amount (always $0.25 usd)</li>
<li>User scans QR code and submits payment</li>
<li>Website is listening for the broadcast of the payment (0-conf), and as soon as the network broadcasts the payment, a callback is executed therefore the user's session knows that their payment has been received.</li>
</ol>

<p>I know the Bitcoin Cash Fund project is currently working on a bitcoincash.js library but it's not ready yet. Since that is the case, I assume I am going to have to fork the current bitcoin core js library and make it work with the cashaddr format to generate addresses for the QR codes.</p>

<p>The other piece that I am unclear about is how to go about listening for broadcasted txns. I see there is a blockchain.info websocket server, which I assume since they announced full support for BCH, that it will work with BCH:
<a href="https://blockchain.info/api/api_websocket" rel="nofollow noreferrer">https://blockchain.info/api/api_websocket</a></p>

<p>But, from what I can tell, I don't think it's possible to use the testnet?</p>

<p>So that is making me wonder if relying on a 3rd party for this, especially with it being 0-conf, is a bad idea? If so, I assume the answer is to run my own node and somehow have my own websocket server query it at regular intervals. Is that correct?</p>

<p>Also, on the topic of pub/sub for this, what is the best way for the client know a payment was made for that specific user? Is it to just generate a new address with each visit to the site? Or is it to include some sort of uuid as metadata with the txn?</p>

<bitcoin-cash><zero-confirmation>
How to integrate 0-conf BCH payments into a web app?
patrick
# How to integrate 0-conf BCH payments into a web app?

(Asked by: username_0 on 2018-02-09)

I am currently working on a Bitcoin Cash related project with the goal of helping contribute to the ecosystem. I am getting to the point where I will soon be ready to start integrating with the protocol, but I am not quite sure how to proceed. The workflow I am looking for goes something like this:

1. User visits my website
2. User is presented a QR code that is for a specific payment amount (always $0.25 usd)
3. User scans QR code and submits payment
4. Website is listening for the broadcast of the payment (0-conf), and as soon as the network broadcasts the payment, a callback is executed therefore the user's session knows that their payment has been received.

I know the Bitcoin Cash Fund project is currently working on a bitcoincash.js library but it's not ready yet. Since that is the case, I assume I am going to have to fork the current bitcoin core js library and make it work with the cashaddr format to generate addresses for the QR codes.

The other piece that I am unclear about is how to go about listening for broadcasted txns. I see there is a blockchain.info websocket server, which I assume since they announced full support for BCH, that it will work with BCH:
<https://blockchain.info/api/api_websocket>

But, from what I can tell, I don't think it's possible to use the testnet?

So that is making me wonder if relying on a 3rd party for this, especially with it being 0-conf, is a bad idea? If so, I assume the answer is to run my own node and somehow have my own websocket server query it at regular intervals. Is that correct?

Also, on the topic of pub/sub for this, what is the best way for the client know a payment was made for that specific user? Is it to just generate a new address with each visit to the site? Or is it to include some sort of uuid as metadata with the txn?

**Tags:** bitcoin-cash, zero-confirmation


---

## 2 answers

### Answer by username_1 on 2018-04-11. Score: 1

You can host your own Bitcore Web services [Bitcore](https://bitcore.io)

You can do things like as follows.

1. User present QR with the random address using this library [Bitcore Library](https://github.com/bitpay/bitcore-lib)
2. User sends payment using wallet.
3. Website will be listening to transaction broadcasted by customer wallet.

Here is the resource for a payment protocol read it thorough you will get an idea. [Bitcore Pay Pro](https://bitcore.io/api/paypro/)

Talking about 0-conf: Once a transaction is sent, it is broadcasted immediately even if the next block has a few minutes before its found. If you as a merchant running a node has capability to verify the transactions.

You can host your own BWS. No need to rely on 3rd party.

For more please refer to bws docs.


---

### Answer by username_2 on 2018-02-12. Score: 0

You can use the [insticce.com api](https://insticce.com/api) to generate unique addresses for your app. It will hit a callback url of your choice when payment is received.

It also forwards all payments immediately to a forwarding address of your choice. You have the option to wait for a confirmation before getting notified if you like.

If you accept zero conf you will be notified, and also receive the payment at your forwarding address within seconds of the customer hitting "send".

It works on testnet, mainnet and uses cashaddr format.


---

