Flowee the Hub — API documentation

Service/AddressMonitor

Address Monitor Service

This service, with service-id 17 is a subscription service. A connected peer can subscribe to a list of bitcoin-addresses and as long as the connection stays open the Hub will monitor incoming transactions and blocks for matches, which it will report by sending messages to the peer.

The service ID for this service is 17.

Messages

Subscribe

We use a BitcoinScriptHashed tag which is a sha256, send as a 32-byte bytearray. subscriptions and detection happens, not exactly on address, but on the entire output-script. The entire output script is hashed giving a nice constant size identifier we use instead of an address.

The API is not meant to be user-facing, as such things like address encoding, cash-address etc are irrelevant to this API.

You need to convert the address to an actual script (typically starting with OP_DUP) and hash that in order to get to the BitcoinScriptHashed.

SubscribeReply

Unsubscribe

TransactionFound

These messages are initiated by the service and don’t require a reply. The service sends a message for each transaction that touches one of the subscribed addresses. One message is sent to the client if accepted into mempool, another when accepted in a block.

DoubleSpendFound

These messages are initiated by the service and don’t require a reply. The service sends a message for each double spend that touches one of the subscribed addresses.

DoubleSpendFound based on transactions

When a node itself detects a double spend it will have both transactions available and you will be able to get the full transaction that double spends one in the mempool. API users can naturally use the livetx service to fetch that transaction too.

DoubleSpendFound based on double-spend-proof

Peers exchange double spend proof messages so even if the node you are connected to didn’t observe two conflicting transactions we still get a notification of such an event happening.

A double spend proof holds cryptographic proof that the sender created two conflicting transactions spending the same money.