6

After a few weeks of searching for an answer, I decided to ask here.

I want to accept a Bitcoin payment, to a specific wallet, and immediately, when the user approved the payment, to receive an indication that the payment was made.

The problem is, I don't want to wait until it is verified in a block, which takes around 10 minutes, I need the approval in seconds, not minutes.

How can I receive an indication that a Bitcoin transaction was occured to my wallet, in the last seconds?

Amin Shojaei
  • 105
  • 6
Ohad Levi
  • 63
  • 3
  • 1
    The standard Bitcoin client will show pending transactions as soon as they hit the network. There is some risk in accepting a zero confirmation transaction. If this is for a brick and mortar establishment it is not likely that a double spend attack can be performed. However online I would be more conservative. Particularly if the item being sold is not revocable such as a digital download. – Mark S. Feb 01 '14 at 19:05

1 Answers1

4

If using the walletnotify option in bitcoin.conf, you can get a notification any time a transaction occurs on the network that matches a bitcoin address in the wallet. To use this, of course, you'll have to keep Bitcoin-QT or bitcoind running at all times.

https://en.bitcoin.it/wiki/Running_Bitcoin

Once you have the transaction id, you'll have to look up the transaction, either at an online service like blockchain.io or use a bitcoind json-rpc command to learn more about the transaction and what action you would like to take.

rustyx
  • 167
  • 8
ChrisW
  • 930
  • 5
  • 12