Concurrent Receiving Address Allocation in Bitcoin Applications
Research status: Engineering analysis based on the stated product architecture and Bitcoin standards. Proposed examples and tests are illustrative; no new live execution is claimed.
Allocation is different from derivation
A deterministic hierarchy answers which key belongs to an index. It does not answer which customer should receive that index. A concurrent application needs an allocation policy that prevents accidental assignment of the same destination to unrelated orders. WAB's CURL-first interface permits clients in different languages, but HTTP access alone does not establish exactly-once allocation.
Application contract
A proposed application record contains order_id, wallet_id, network, wallet_type, address, and allocation_state. Keep BTC KEY out of this record. Use a unique order identifier and persist the returned address before presenting it to the buyer. An application database can enforce uniqueness within the relevant wallet and network scope. These are application fields, not a documented WAB response schema.
NEW -> ALLOCATING -> ASSIGNED -> PRESENTED
-> UNCERTAIN -> RECONCILE
A timeout after a receive request is ambiguous: the engine may have processed it even though the client lost the response. Do not assume retrying the request returns the same address unless the receive contract explicitly guarantees it. If no allocation lookup exists, retain the uncertain record and use a conservative recovery workflow. A skipped unused index is preferable to attributing a payment to the wrong customer, provided discovery can handle the gap.
Concurrency and recovery
A single application allocator can serialize requests for one wallet. Multiple independent installations require additional coordination if they allocate from the same deterministic range. Local locking on one host cannot protect another host. Do not infer global allocation uniqueness from local database atomicity.
Proposed acceptance tests
Run parallel Testnet receive requests, simulate a dropped response, restart the client and compare persisted order mappings. Restore the wallet and verify that funded destinations remain discoverable. Report duplicate addresses, unused indices and uncertain allocations separately. These tests are proposed, not completed. The engine remains unchanged; the application owns its order-level state.
Primary references and related research
- [Flying Wallet architecture](/docs/wab-philosophy-flying-wallet-architecture)
