Idempotency (Wallet)
A design property that guarantees processing the same wallet request more than once, for example after a timeout and retry, has the same effect as processing it once, so a bet is never double-charged.
Definition
Idempotency ensures that repeating an operation produces no additional effect beyond the first application. In wallet and betting systems, network timeouts and retries are inevitable: a client may not receive the response to a debit and resend it. Without idempotency, that retry could debit the player twice. The standard solution is an idempotency key, often a unique transaction or round identifier, that the wallet stores; if a request with a key it has already processed arrives again, it returns the original result instead of applying the change a second time. This makes debit and credit operations safe to retry, which is essential for seamless wallets where money moves across the network on every bet. It underpins correct balances and clean reconciliation.
Worked example
A slot sends a debit for round 12345 but the response is lost to a timeout, so it retries with the same round identifier. The wallet recognises 12345 as already processed, returns the original success without deducting again, and the player is charged exactly once.
Why it matters
For learners, it is the safeguard that stops a glitchy connection from taking your money twice. For professionals, idempotency is non-negotiable in wallet and betting APIs; getting it wrong causes double-debits, disputes and reconciliation breaks, so it is a core review point in any integration.