Core Events
Subscribe to core ZMQ proxy events
Core subscriptions expose bitcoind’s ZMQ event stream over WebSocket. blockd receives raw ZMQ messages from bitcoind and re-shapes them into JSON events. These are lower-level events intended for applications that need direct chain data.
List of core subscriptions
Section titled “List of core subscriptions”| Subscription | Description |
|---|---|
core.hashblock | New block hash from bitcoind |
core.hashtx | New transaction hash from bitcoind |
core.rawblock | Raw block bytes from bitcoind |
core.rawtx | Raw transaction bytes from bitcoind |
core.sequence | Mempool and chain sequence events |
core.hashblock
Section titled “core.hashblock”Fires when bitcoind broadcasts a new block hash.
{ "subscriptions": [ { "subscribe": "core.hashblock" } ]}Event:
{ "event": "bitcoind_hashblock", "hash": "00000000590f69588b42f409796be4049ad8c4528e04f26f2fdabebbab7e0e18", "height": 909745, "time": 1755032952, "sequence": 0}blockd automatically calls getblockheader RPC to fetch height and time and adds
them to the event. If the getblockheader RPC call has not yet completed at the time of broadcast, height and time
will be absent from the event.
core.hashtx
Section titled “core.hashtx”Fires when bitcoind broadcasts a new transaction hash.
{ "subscriptions": [ { "subscribe": "core.hashtx" } ]}Event:
{ "event": "bitcoind_hashtx", "hash": "82cb1fc54a4d891d687c3898a7ebcd54da996e7f26e1fd6f2a21dc2f655194fa", "sequence": 0}core.rawblock
Section titled “core.rawblock”Fires when bitcoind broadcasts a new block.
{ "subscriptions": [ { "subscribe": "core.rawblock" } ]}Event:
{ "event": "bitcoind_rawblock", "data": "<hex>", "sequence": 0}data is the hex-encoded raw block bytes.
core.rawtx
Section titled “core.rawtx”Fires when bitcoind broadcasts a new transaction.
{ "subscriptions": [ { "subscribe": "core.rawtx" } ]}Event:
{ "event": "bitcoind_rawtx", "data": "<hex>", "sequence": 0}data is the hex-encoded raw transaction bytes.
core.sequence
Section titled “core.sequence”Fires on bitcoind mempool and chain sequence events.
{ "subscriptions": [ { "subscribe": "core.sequence" } ]}No args subscribes to all ops. To filter by op:
{ "subscriptions": [ { "subscribe": "core.sequence", "args": { "op": [ "block_connected", "block_disconnected", "tx_added", "tx_removed" ] } } ]}Event:
{ "event": "bitcoind_sequence", "op": "block_connected", "hash": "00000000590f69588b42f409796be4049ad8c4528e04f26f2fdabebbab7e0e18", "height": 909745, "time": 1755032952, "sequence": 0}For block_connected and block_disconnected events, blockd automatically calls
getblockheader RPC to fetch height and time and adds them to the event. These
fields are not present in the raw ZMQ message — blockd enriches them for you.
Fields present by op:
| Op | hash | height | time | mempool_sequence |
|---|---|---|---|---|
block_connected | block hash | ✓ | ✓ | — |
block_disconnected | block hash | ✓ | ✓ | — |
tx_added | tx hash | — | — | ✓ |
tx_removed | tx hash | — | — | ✓ |
sequence field
Section titled “sequence field”All core events include a sequence field — a monotonic counter from bitcoind’s ZMQ
publisher. Gaps in the sequence indicate missed messages, which may occur under high
load or during ZMQ disruptions. See zmq_outages under
ZMQ monitoring.
In production, monitor for gaps and treat them as a signal that your application may have missed events. If a gap is detected, re-execute relevant workflows and verify the current block tip to ensure your local state is current.
mempool_sequence is a separate monotonic counter tracking mempool state changes,
present only on tx_added and tx_removed ops.