Bitcoin SEEN to Executable Action: Event-Driven Services Without Waiting for Confirmations
For many digital services, latency matters. A buyer may expect a license, access token, receipt, or digital item soon after broadcasting a Bitcoin transaction. A proposed WAB pattern treats WATCH SEEN as an event that can trigger a predefined action.
The event sequence
The application creates an order and obtains a receiving address through an authorized RECEIVE workflow. It records the expected address, amount, network, order identifier, and expiration policy. A WATCH component observes relevant transaction activity. When a matching payment is seen, a Go handler evaluates the event and performs the configured action.
Conceptually:
ORDER -> RECEIVE -> WATCH -> MATCHED_SEEN -> ACTION
SEEN means the transaction was observed in the mempool or by the watch pipeline. It does not mean inclusion in a block, irreversible settlement, or guaranteed eventual confirmation. The operator explicitly chooses whether immediate fulfillment is worth the risk of replacement, eviction, or double spending.
Matching before acting
A transaction ID alone is insufficient to match an invoice. The handler needs to verify the network, destination output, amount actually paid, and order association. Payment values should be represented in integer satoshis. Multiple outputs, partial payments, and reused addresses require explicit handling rather than assumptions.
Exactly-once business effects
WATCH events can be delivered repeatedly, and a process can crash after an external action but before recording success. A durable bbolt state machine should store event IDs, order IDs, and fulfillment states. Handlers should be idempotent whenever possible, and ambiguous outcomes should be reconciled instead of blindly retried. A vending machine, for example, must not dispense twice because the same transaction was seen twice.
Confirmation is a separate policy
Applications needing more assurance can query TXID STATUS and delay or re-evaluate fulfillment. The fast path should not silently become a confirmation-waiting path for every product. Different products can adopt different risk policies without changing the Bitcoin engine.
Where this fits
The same event-to-action structure can issue a receipt, activate an account, publish an advertisement, or instruct a trusted device controller. The action itself remains developer-defined and allowlisted; an AI model cannot invent arbitrary commands to execute on the host.
Status: Proposed automation architecture. The behavior of any specific deployed WATCH implementation must be verified against its actual API contract.
