Does Bitcoin Core ZMQ Guarantee Delivery of Every Event?
No. Bitcoin Core ZMQ uses a publish-subscribe notification model. A subscriber can miss events while disconnected, during startup or when it cannot consume messages quickly enough. The publisher does not maintain a durable replay log for each subscriber.
Can a subscriber detect missing messages?
The multipart notification counter can reveal gaps in a stream. Handle wraparound and publisher restarts, and remember that a gap before the first received notification cannot necessarily be detected from the counter alone.
How should a wallet recover?
Obtain a fresh state snapshot using RPC, reconcile the active chain and local mempool, and rebuild affected wallet records. Buffer incoming notifications during synchronization and handle duplicate events safely. Periodic reconciliation is useful even when no gap has been detected.
A notification is evidence of an event observed by a particular node, not proof that every peer saw the same event. Do not use notification delivery alone as a guarantee of payment settlement.
Primary references
Bitcoin Core ZMQ documentation: https://github.com/bitcoin/bitcoin/blob/master/doc/zmq.md
