Design a Cryptocurrency Wallet
HardSystem design · Crypto Payments · Coinbase
Design the custodial wallet service of a crypto platform like Coinbase. Users get deposit addresses, see balances and history, and send withdrawals, while the platform holds the actual coins on chain and maintains an auditable internal ledger.
In scope: the double-entry ledger, deposit detection with confirmations and reorgs, the withdrawal state machine, hot and cold wallet boundaries, key custody and signing policy, and reconciliation against the chain. Out of scope: the trading engine (see the exchange problem) and fiat banking.
Requirements
- Keep an immutable double-entry ledger; balances are derived, with every write keyed idempotently
- Credit deposits as available only after configurable confirmations, and handle reorgs with reversing entries
- Model withdrawals as an explicit state machine with a hold up front and safe handling of broadcast timeouts
- Hot/cold separation, no single complete key, policy enforced before signing, and continuous reconciliation