How to determine if a BTC payment has been done


Scenario: You have a website running on a remote server, and you want to accept BTC donations to a specific address (most likely yours) and to display a "Thank you" message automatically.

How do you determine programmatically if a payment to said address happened? Is it even possible?

Using bitcoind in this case is not possible because the Bitcoin wallet is not on the server, so what could one use?'s API?



Posted 2014-01-15T22:54:50.883

Reputation: 11


1 does work to monitor the blockchain. Here's a couple of other ideas...

  1. If the wallet server is connected to the internet, have it monitor the address (perhaps using the -walletnotify option) and then create a message queue (e.g. amazon sqs). When a wallet transaction happens PUSH the relevant info into the message queue. The web server then monitors the message queue, POPs the message and takes appropriate steps.

  2. You can also look into the Watch Only pull request for bitcoind. This pull request has not been incorporated into the main bitcoind, but you could compile it into your own modified version. You then would need to add the public address to the Watch Only wallet. This modified version of bitcoind could then reside on your web server without the fear of compromising private keys.



Posted 2014-01-15T22:54:50.883

Reputation: 126