Local Wallet State, Atomic Operations and Bitcoin Reconciliation
Research status: Engineering philosophy based on the stated product design and prior laboratory reports. Proposed tests and examples are illustrative; no new live execution is claimed.
Three different meanings of completion
WAB is designed around discrete wallet operations exposed through CURL and JSON. A local database update, an accepted API request and a confirmed Bitcoin transaction are not the same event. Atomicity of a local operation must not be generalized into atomicity across a database, a network broadcast and blockchain consensus.
The engine uses local bbolt state. A database transaction can provide local consistency within its own scope, but the precise transaction boundaries of WAB require source inspection and failure testing. Bitcoin confirmation remains asynchronous and can change after a chain reorganization.
A client-side state model
REQUESTED -> RESPONSE_RECEIVED -> NETWORK_OBSERVED -> CONFIRMED
| |
+-> OUTCOME_UNCERTAIN +-> RECONCILEDThis is an illustrative application model, not a list of official WAB status values. A timeout can occur after an operation has already produced an effect. The client must not automatically issue a fresh spending request merely because the original HTTP response was lost. Preserve the documented request identity and follow the API's retry contract.
Evidence from the laboratory
The reported HTLC experiment observed an externally broadcast redemption in a block while the wallet transaction-status query returned unknown. Subsequent UTXO and balance reconciliation identified the confirmed output. The distinction is important: transaction tracking and wallet ownership reconciliation can expose different views of the same chain event.
Proposed crash-consistency study
On a disposable Testnet instance, record request identifiers, observed transaction identifiers and expected outputs. Introduce controlled interruptions before and after broadcast in a test harness, then compare recovered state with chain evidence. A successful run must account for every spend and must not create duplicate payments. Do not infer that these crash cases have already been tested.
The application should retain uncertainty as an explicit state rather than presenting a false success or failure to its user.
Primary references and related research
- [Related laboratory research](/docs/wab-agent-balance-reconciliation)
- [Bitcoin Sovereignty as a Software Architecture](/docs/wab-philosophy-sovereignty-architecture)
- [Testnet3 and Sepolia settlement](/ask/wab-testnet3-sepolia-settlement)
