With getrawmempool it gets me txids, however it just dumps the whole mempool on me. This isn't convenient if I want to quickly detect new transactions. Is it possible to only get newly broadcasted transactions?

Is there another way to sort of stream them from bitcoin-core into my program?

2 Answers 2


You can use the ZMQ interface to receive a ZMQ notification when a new transaction is received. You can have it give you the txid, the raw transaction, or both.


I think what you are looking for is walletnotify. You can set on bitcoin.conf file.

For example


That will call /home/process_tx.sh passing as parameter the transaction hash Or you can also run bitcoind with using -walletnotify

bitcoind -walletnotify=/home/process_tx.sh

  • 1
    As far as I understand, walletnotify only notifies of transactions made to the address that belong to that wallet. I'm interested in collecting all transactions that are broadcasted.
    – orion3
    Aug 17, 2017 at 4:20
  • In that case, you should use ZMQ as sugest by @Andrew Chow
    – carvmarc
    Aug 17, 2017 at 15:08

Your Answer

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

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