This guide explains Bitcoin Core ZMQ notifications in plain English. It focuses on what the subject is, why it matters and what a beginner should remember.
TL;DR
- What it is: Bitcoin Core 0.12.0 added ZeroMQ publish notifications for transaction and block hashes and raw serialised objects. The daemon acts as a write-only publisher; subscribers receive event hints without polling RPC.
- Why it matters: ZMQ provides fast, low-coupling notification hints, not durable truth. Reliable mining and monitoring consumers persist a cursor, detect gaps, reconcile with a validating node and secure the otherwise unauthenticated endpoint.
- Current position: Bitcoin Core 0.12.0 added ZeroMQ publish notifications for transaction and block hashes and raw serialised objects.
Bitcoin Core ZMQ notifications in simple English
Bitcoin Core ZMQ notifications: A pool can use notifications to wake template refresh or monitor transactions, but block-template validity still comes from RPC and local consensus validation.
Simple example
A node operator is checking Bitcoin Core ZMQ notifications. The historical documentation notes that a tip change notifies the new tip. The subscriber must retrieve and compare the chain from its last known block.
Key terms in plain English
- Bitcoin Core:
- Widely used software that validates Bitcoin and can provide wallet, network and operator tools.
- RPC:
- A command that software sends to a node to request information or a local action.
- Consensus:
- The shared rules full nodes use to decide whether blocks and transactions are valid.
- Node:
- A computer running Bitcoin software that checks data and communicates with other peers.
Four historical notifier types
Core 0.12 exposed hashtx, hashblock, rawtx and rawblock publishers configured with separate command-line or configuration options. Several topics could share one address. Hash bodies used binary bytes rather than printable hexadecimal, while raw topics carried whole serialised transactions or blocks.
PUB and SUB semantics
A subscriber must set a topic prefix or it receives nothing. PUB sockets do not track application acknowledgements and a late or disconnected subscriber misses prior messages. Self-healing reconnection restores the transport but does not replay gaps. Treat the feed as a prompt to query state, never as a complete event ledger.
No authentication
The publisher did not authenticate or authorise connecting clients. Endpoint exposure relied on IPC permissions, loopback binding, firewalling or another protected transport. A subscriber must also distrust data arriving at a configured address because another local process or network actor may be able to impersonate an unprotected publisher.
Reorganisation handling
The historical documentation notes that a tip change notifies the new tip; the subscriber must retrieve and compare the chain from its last known block. A single hashblock event does not state which blocks disconnected. Mining accounting, confirmations and alerts require an explicit active-chain reconciliation loop.
Mining integration boundary
A pool can use notifications to wake template refresh or monitor transactions, but block-template validity still comes from RPC and local consensus validation. Coalescing rapid events can be sensible, while treating every transaction message as a mandatory immediate template rebuild can create load and instability.
Sequence and version drift
Later Core releases expanded ZMQ message framing and sequence support. Consumers must follow the exact release documentation and test body byte order and topic names. A parser that assumes modern framing against a 0.12 publisher, or the reverse, may silently misread payloads.
Failure rehearsal
Start subscribers before and after the publisher, disconnect the network, overflow consumer processing and restart both ends. Create a regtest reorganisation and compare the local cursor with getbestblockhash. Confirm recovery queries close every gap and that alerts distinguish publisher loss from a quiet network.
Frequently asked questions
What is the main point of Bitcoin Core ZMQ notifications?
Bitcoin Core ZMQ notifications: A pool can use notifications to wake template refresh or monitor transactions, but block-template validity still comes from RPC and local consensus validation.
For Bitcoin Core ZMQ notifications, what should a beginner know about four historical notifier types?
Core 0.12 exposed hashtx, hashblock, rawtx and rawblock publishers configured with separate command-line or configuration options.
For Bitcoin Core ZMQ notifications, what should a beginner know about pub and SUB semantics?
A subscriber must set a topic prefix or it receives nothing. PUB sockets do not track application acknowledgements and a late or disconnected subscriber misses prior messages.
For Bitcoin Core ZMQ notifications, what should a beginner know about no authentication?
The publisher did not authenticate or authorise connecting clients. Endpoint exposure relied on IPC permissions, loopback binding, firewalling or another protected transport.
Conclusion
ZMQ provides fast, low-coupling notification hints, not durable truth. Reliable mining and monitoring consumers persist a cursor, detect gaps, reconcile with a validating node and secure the otherwise unauthenticated endpoint.
Primary sources
Check the current specification status and the documentation for the exact implementation you operate before moving production funds or changing a mining node.
Join the ASIC Mining Discussion
Members can read and join the discussion
Log in to read comments from other miners. Create a free account if you would like to ask a question or share your experience.
Membership helps us protect the discussion from spam and keep answers useful.