THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

Building Payment Monitoring Interfaces with WATCH

permalink THAMER
#bitcoin#payments#sdk#software-engineering#wab

Research status: Theoretical SDK design. Examples are illustrative and have not been built or tested against the live engine.

Monitoring model

WATCH CREATE registers a payment observation request; WATCH LIST provides observations. A specialized SDK should keep the engine watch identifier distinct from its local order identifier. The documented expected_sat and ttl_sec inputs describe the watch request; do not infer a guaranteed settlement deadline from the TTL. Preserve the original engine status and interpret it only through documented semantics.

Conceptual Python adapter

def poll_order(order, adapter, store):
    observations = adapter.watch_list(order.wallet_scope)
    match = next((x for x in observations
                  if x.watch_id == order.watch_id), None)
    if match is None:
        return store.record_poll_gap(order.id)
    return store.append_observation(order.id, match)

This is normalized SDK pseudocode, not the wire schema. The adapter must handle pagination if supported, authentication, deadlines and response validation. A missing entry is not proof of nonpayment. Never turn a failed poll into an unpaid observation.

Lifecycle and concurrency

Persist registration attempts before dispatch. If the response is lost, use documented reconciliation or operator review rather than assuming that registration never happened. Multiple workers should use a durable lease or compare-and-set operation to prevent duplicate fulfillment. Poll with bounded backoff and jitter; avoid an unbounded loop for every invoice. Keep observation timestamps and last successful poll time distinct.

A SEEN observation can support an application decision under an explicitly chosen risk policy, but does not itself prove confirmation or irreversible settlement. Late payments require an application review policy even if a watch has expired. Do not assume the engine will retain or observe expired watches indefinitely.

Acceptance plan

Use fixtures for missing watches, duplicated responses, malformed payloads and stale observations. Run a live Testnet watch with a known payment and record first observation, transaction status and confirmation separately. Test restart recovery using the saved watch identifier and documented engine behavior. No live result is asserted here.

Primary reference

https://thamer.org/api

Related reading in this series

https://thamer.org/docs/wab-sdk-designing-bitcoin-sdk
https://thamer.org/docs/wab-sdk-api-engine-application-boundaries
https://thamer.org/docs/wab-sdk-wallet-identity-management
https://thamer.org/docs/wab-sdk-cross-language-interfaces
https://thamer.org/docs/wab-sdk-typed-json-contracts
https://thamer.org/docs/wab-sdk-authentication-credential-management
https://thamer.org/docs/wab-sdk-wallet-creation-restoration
https://thamer.org/docs/wab-sdk-receive-address-interfaces
https://thamer.org/docs/wab-sdk-balance-utxo-management
https://thamer.org/docs/wab-sdk-transaction-execution
https://thamer.org/docs/wab-sdk-idempotency-retry-strategies
https://thamer.org/docs/wab-sdk-wallet-recovery-local-lifecycle
https://thamer.org/docs/wab-sdk-payment-sdk-design
https://thamer.org/docs/wab-sdk-invoice-abstractions
https://thamer.org/docs/wab-sdk-confirmation-settlement-states
https://thamer.org/docs/wab-sdk-immutable-fee-policy
https://thamer.org/docs/wab-sdk-payment-reconciliation

Questions & Answers

Explore all questions →

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects