Skip to Content
ReferenceZMQ Notifications

ZMQ Notifications

tidecoind can publish block and transaction notifications over ZeroMQ. ZMQ is useful for exchanges, explorers, indexers, and monitoring services that should react to new events without polling RPC constantly.

This page summarizes ../tidecoin/doc/zmq.md.

Build and Enable

ZeroMQ support must be built in:

cmake -B build -DWITH_ZMQ=ON

Then enable topics in tidecoin.conf or on the command line:

zmqpubrawblock=tcp://127.0.0.1:28332 zmqpubrawtx=tcp://127.0.0.1:28333 zmqpubsequence=tcp://127.0.0.1:28334

Topics

OptionTopicBody
-zmqpubrawtx=<address>rawtxSerialized transaction
-zmqpubhashtx=<address>hashtxReversed 32-byte transaction hash
-zmqpubrawblock=<address>rawblockSerialized block
-zmqpubhashblock=<address>hashblockReversed 32-byte block hash
-zmqpubsequence=<address>sequenceBlock connect/disconnect and mempool add/remove events

Every message has three parts:

topic | body | 4-byte little-endian sequence number

Use the sequence number to detect missed notifications.

Sequence Topic Events

Event markerMeaning
CBlock connected
DBlock disconnected
ATransaction added to mempool
RTransaction removed from mempool for a non-block reason

For block topics, reorganizations require the subscriber to query the node and walk from its last known block to the new tip.

High Water Mark

Each notification type supports an outbound high-water-mark option:

zmqpubrawtxhwm=10000 zmqpubrawblockhwm=10000

Tune HWM values for indexers and exchanges that may briefly fall behind. ZMQ can drop messages under pressure; subscribers must detect gaps and repair from RPC.

Security

ZMQ has no authentication or authorization at the Tidecoin topic layer. Bind it to localhost or a trusted network only. Treat all received data as untrusted until validated through your node or indexer.

See also: REST API, Node & Operations / REST and ZMQ, Monitoring Integration.

Last updated on