I will harden one bounded crypto-payment credit and purchase flow against duplicate webhooks, retries, and concurrent double spending.
The fixed sprint includes a written invariant, provider webhook idempotency, an atomic conditional balance debit, a unique purchase key, focused concurrency tests, reviewable code or migration changes, verification commands, and rollout/rollback notes.
A typical acceptance test starts with one test balance and fires two simultaneous full-balance purchases. Exactly one may succeed; the other must leave no second order and no negative balance. Duplicate webhook tests must prove one credit only.
Work is limited to sandbox or test-mode credentials and one agreed flow. Production private keys, seed phrases, custody operations, broad frontend work, and deployment are excluded. Work starts only after LaborX escrow is funded.
Verified dependency-free reference: https://github.com/bughunter-dotcom/atomic-ledger-concurrency-sample