1

I have a task where I need to set up some sort of a listener on a particular bitcoin addresses for incoming transactions, and once a transaction arrives, I need to call some function in my web service. Is it possible to have some sort of an event be triggered by the incoming bitcoin transaction that calls my web service? What technologies or tools are available that I could use for this task?

Furthermore, after the function in the web service has completed, I need to forward those received bitcoins to another address using that same web service. The web service can, if needed, be provided access to the private key for the address from which these bitcoins would be sent out. What tools/technologies could I use for this purpose?

1 Answer 1

2

I have a task where I need to set up some sort of a listener on a particular bitcoin addresses for incoming transactions, and once a transaction arrives, I need to call some function in my web service

If you are running Bitcoin Core, ZMQ can be used for listening to incoming transactions and blocks: https://bitcoindev.network/accessing-bitcoins-zeromq-interface/

This will provide you a live feed of new transactions added to mempool or blocks being mined. In the background you could process these and check if a Bitcoin address is used in any transaction.

Furthermore, after the function in the web service has completed, I need to forward those received bitcoins to another address using that same web service

If the above code returns any transaction in which address was used as output, you can use this information to create a transaction with createrawtransaction or createpsbt RPC. Sign transaction and broadcast it.

If you are looking for a library, it depends on the language used. Example: NBXplorer for .NET, JavaScript libraries

2
  • Thank you so much. I will look into both of these options. One other thing I should mention is that the blockchain I'm talking about is not actually bitcoin itself but a bitcoin clone blockchain with a very similar codebase. Could either of these options be customized to work with the bitcoin clone type blockchain or are they strictly limited to bitcoin only? Aug 31, 2021 at 10:29
  • Sorry I am not sure about this. Also its offtopic.
    – user103136
    Aug 31, 2021 at 12:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.