Flowee the Hub — API documentation

Service/Double Spend

See absolutely all Double Spends a node gets.

This is a subscription style service. Clients can subscribe to receive all double spends detected and verified by the Hub.

Please be aware that this service sends ALL double spends seen by the hub, for most usages you likely want to use the Transaction Monitor or the Address Monitor services as those send double spend notifications filtered for your case.

A double spend notification is useful for unconfimed transactions because the network will only ever mine one of the two. What gets mined does not have to be the first transaction you have seen. (learn more), this message serves as a warning to be aware of the issue. Receiving parties might want to wait for a confirmation before they release the goods.

The service ID for this service is 21.

Messages

Subscribe

Subscribing doesn’t require any special field, just a simple message.

Hub / Double Spend Notifications. sId=21 mId=0

Unsubscribe

Unsubscribing doesn’t require any special field, just a simple message.

Hub / Double Spend Notifications. sId=21 mId=2

NewDoubleSpend

These messages are initiated by the service and don’t require a reply. The service sends a message for each double spend the hub notices.

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.

A full transaction
Hub / API. sId=21 mId=4
TxId: 4bytearray32-byte sha256 hash
Full raw transaction: 23bytearray

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.

Hub / API. sId=20 mId=4
TxId: 4bytearray32-byte sha256 hash
Double Spend Proof Data: 22bytearrayA full dsproof