← Back
Home › Systems › Payments and commerce

p2p-payments

Payments and commerce | p2p-payments — bank-network and wallet person-to-person payments: alias directory (phone/email → account token), real-time authorisation against bank cores, settlement over RTP/push-to-card rails, payee confirmation and scam scoring, request-to-pay, small-business acceptance

Zelle (Early Warning, bank-owned), Venmo (PayPal), Cash App (Block)

SystemTechniques · 28Primitives · 79 p2p-payments Deterministic simulation testingdistributed · medium: Run the whole system in one thread under a seeded scheduler with simulated network, disk and clock, so every failure replays from its seed.›Exactly once processingdistributed · medium: Idempotent producers plus transactional offset+output commits for effectively-once resultsPrimary-backup replicationdistributed · medium: One node orders all writes and ships them to standbys; the acknowledgement rule (none, one, all) sets what a crash loses, and an external arbiter decides who takes over.›Saga patterndistributed · medium: Split a cross-service operation into local transactions, each paired with an undo; on failure run the undos in reverse, or retry forward.›Transactional outboxdistributed · medium: Write the event as a row in the same local transaction as the state change; a relay publishes it later at-least-once, so state and events never diverge.›Authorization holdsfinance · medium: Pending vs posted balances: auth holds, incremental auths, partial captures and hold expiryPayment state machinefinance · medium: Persisted state machine for a payment lifecycle (authorize, capture, void, refund) that treats timeouts as unknown, retries with the same key and applies webhooks idempotently.›Idempotency keysfinance · low: Client-chosen unique key per logical operation, stored with a request fingerprint and the final response, so retries replay the first result instead of acting twice.›Double-entry ledgerfinance · low: Append-only journal of transactions whose postings sum to zero per currency; balances are derived, so money can only move, never appear or vanish.›Hdr histogramdata-structures · low: Log-linear bucketed histograms with bounded relative error for latency percentilesIso 20022 messagesfinance · low: ISO 20022 XML payment and securities messages (pacs, pain, camt, sese): structure and validationMoney representationfinance · low: Store money as integer minor units with an explicit currency exponent, compute in wider integers, and round once with a named rounding mode.›Reconciliationfinance · low: Match internal ledger records against bank and processor statements by reference, then amount and date window; every unmatched or mismatched item becomes an exception.›Process supervisionhardware-os · low: A parent process starts services, reaps their exits and restarts them under a delay and burst-limit policy, then stops them with SIGTERM before SIGKILL.›Phonetic name matchingsearch-sort · low: Reduce names to phonetic keys (Soundex, Metaphone, Double Metaphone) so differently spelled but similar-sounding names collideK anonymity hash prefixsecurity · low: Querying a breach/blocklist by sending only a short hash prefix and matching suffixes locallyMutual TLSsecurity · low: TLS where the client also proves a certificate key, so every connection carries a verified, rotatable machine identity.›Graceful drainingsystems · low: On a termination signal, stop taking new work, finish in-flight work until a deadline, tell clients to reconnect elsewhere, then exit; clients resume from a token.›Cooperative schedulingconcurrency · low: Green threads/coroutines yielding at await points on a user-space schedulerRecord replaydistributed · low: Record every nondeterministic input (time, randomness, I/O, model and tool outputs, per-tick player input) and re-execute deterministically for debugging, replays and state rebuildPRNGs (PCG, xoshiro)numerics · low: Small, fast, statistically strong non-cryptographic generators: PCG32 and xoshiro256**, with seeding, parallel streams and unbiased ranges.›Consumer offsetsdistributed · low: Each consumer group stores one integer per partition, the next position to read, so a restarted consumer resumes where it left off with at-least-once delivery.›Event deduplication windowdistributed · low: Keep the ids of recently accepted events for a time window and drop repeats; memory stays bounded by rotating time buckets instead of per-entry timers.›+ 21 more techniques+ 63 more primitives

Similar systems

Share the most building blocks with this one.