Implement Idempotency for Bitcoin Send Requests
Goal
Simulate two identical send requests with the same client-generated idempotency token.
Exercise
Store the first accepted request and its transaction identity, then make repeated requests return the same logical result instead of constructing a second transaction.
Verify your result
- Write down the expected behavior before running the exercise.
- Test one valid case and at least two invalid or unexpected cases.
- Confirm that errors are visible and that no sensitive values appear in logs.
- Save the observations so the procedure can be repeated.
Safety note
A retry after a timeout must reconcile existing state before any new broadcast.
Next step
Read the [related guide](/docs/bitcoin-transaction-broadcast-retry) before extending the exercise.
