Using ZeroMQ of bitcoind to monitor addresses? I'm developing a system which should monitor incoming transactions for the local addresses (addresses in this node's wallet).

It would be great to use high-performance ZeroMQ for this. Is it possible?

I know I can receive notifications about new transactions from it. But notification only contains transaction ID. How do I know if it's related to one of the local addresses?

Do I need to make RPC call for each transaction to find it's output address? This seems extremely ineffective, cause there a lot of new transactions and by making so many RPC calls I will just flood the server.

Is there a better option?
Actually, it's pretty much possible!

You will have to listen for rawtx topic of ZeroMQ in order to retrieve binary representation of the transaction descriptor.

Then you should parse the transaction body and extract Bitcoin addresses from it's output scripts. You could either do this manually, or use some third-party library. No need to make RPC calls!

References:


Bitcoin Transaction Format
Bitcoin Script Format