Monitor non-wallet bitcoin addresses for new transactions

0

This is usual checkout functionality. Show address to the user and needs to monitor it for new transaction during n minutes. Addresses are not unique for each payment.

Optional:it would be good to have listener for transaction with certain incoming amount, but this is optional.

blockchain.info have something similar, but I want to it using local bitcoin-qt from .Net application.

*Update: this should be done for non-wallet addresses/transactions.

Alex

Posted 2014-11-27T09:24:19.167

Reputation: 163

Answers

1

Bitcoin-qt has several limitations when it comes to this type of thing. There are only really two ways to do this.

  1. Use the listunspents RPC call to watch the balance for a particular address, and compute the total balance. Then trigger your call on the backend from your .net application.

  2. Use the external wallet-notify bitcoind option that sends transaction data to your .net process via a script, parse the result to determine the payment. This can cause problems on high volume sites as it spawns external processes per wallet notify.

Finally, you can only use this method to interact with addresses registered to the local bitcoind. Either addresses it controls, or that you have manually loaded.

Matt

Posted 2014-11-27T09:24:19.167

Reputation: 520

Addresses are not mine. Users who selling enter their addresses online. What does it mean "registered to the local bitcoind"? Can I do it without private key?Alex 2014-11-27T20:26:46.890

I don't believe so. Your best bet is to use a service that already does this, there are several api services that address this exact use case. If you want to monitor arbitrary addresses then you would need additional software. For example Bitpay's nodejs bitcore could be used to connect to bitcoind and scan incoming 0 confirmation transactions for addresses you were interested in. Bitcoind won't do this out of the box.Matt 2014-11-27T23:46:32.330

So, if services which can monitor addresses exist, so it is possible. And I want to know how they implemented to see is it worth to have own implementation or use them.Alex 2014-11-28T14:11:50.220

As I said, they don't do this with standard bitcoind. They either modify bitcoind to start pushing transaction information to an external source, or they use a project like bitcore to access that information on the network, then write their own bindings / software.Matt 2014-11-28T15:59:11.033

Does the first option require polling?Jus12 2016-10-30T16:13:15.413

Yes, the first option would be polling.MattyB 2016-12-04T18:27:11.910

1

In order to monitor specific receiving addresses for incoming transactions through the RPC API you should make use of the listreceivedbyaddress method. Adding these parameters: listreceivedbyaddress(0, true) will also return zero-confirmation and empty addresses.

The most efficient way to monitor all incoming transactions with a specific amount is by calling listsinceblock, keeping track of the last scanned-by-your-app block and passing it as a parameter: listsinceblock(lastScannedBlockHash, targetConfirmations) so you effectively scan only the new block, which is very fast and lightweight.

A battle-tested library for performing the above in .net is BitcoinLib which also comes as a NuGet packet:

George Kimionis

Posted 2014-11-27T09:24:19.167

Reputation: 2 824

I think your example is only for "your wallet" transactions. I just found another way to find my tx: -getblockcount -getblockhash {index} -getblock {hash}

  • loop for: getrawtransaction {txid} I can find my transaction by address , but this is ONLY for confirmed tx. How I can look at unconfirmed tx???
  • < – Alex 2014-12-01T21:17:32.357

@Alex that is correct, however it wasn't clear in your original question that you had to also scan non-wallet transactions. You can obtain a list of unconfirmed transactions by calling getrawmempool which returns transactions in your memory pool where they reside until (and if) they get confirmed. You can then call: getrawtransaction &lt;txId&gt; 1 against that collection and examine each transaction in depth.George Kimionis 2014-12-02T00:17:09.787

0

If you gonna do this. Lets say RPCCMDS+.net server is better than bitcoin-qt server which betters than bicoind.exe server.If you don't owe those addresses ,just ask blockchain API for mercy.

Willipm

Posted 2014-11-27T09:24:19.167

Reputation: 283

0

Since 0.10, bitcoind has support for watch-only addresses. https://bitcoin.org/en/developer-reference#importaddress

jdb6167

Posted 2014-11-27T09:24:19.167

Reputation: 162