
⛓️ Blockchain & Web3 · C4 Architecture · Pro
The main parts of a centralised crypto exchange: a matching engine, wallets split between hot and cold storage, deposits and withdrawals, and compliance checks.
C4 Architecture diagrams are part of Pro. Anyone can view this one; generating and editing it needs Pro.
Drawing diagram…
Crypto exchange: traders use web and mobile apps through an API gateway. The matching engine keeps the order book in memory and writes trades to a trade log. A ledger service tracks every user's balances. A wallet service manages hot wallets for daily withdrawals and cold wallets (offline, multi-signature) for most funds, and watches blockchain nodes for deposits. A compliance service does KYC, travel rule and sanctions screening for withdrawals.
C4Container
title Crypto Exchange
Person(trader, "Trader", "Buys and sells crypto")
System_Boundary(ex, "Exchange") {
Container(app, "Trading Apps", "React / React Native", "Charts and orders")
Container(gw, "API Gateway", "Go", "REST and WebSocket")
Container(me, "Matching Engine", "C++", "In-memory order book")
Container(led, "Ledger Service", "Java", "User balances")
Container(wal, "Wallet Service", "Go", "Deposits and withdrawals")
Container(comp, "Compliance Service", "Python", "KYC and screening")
ContainerDb(db, "Ledger DB", "PostgreSQL", "Balances and trades")
}
System_Ext(nodes, "Blockchain Nodes", "Bitcoin, Ethereum")
System_Ext(cold, "Cold Wallet", "Offline multi-signature")
Rel(trader, app, "Uses")
Rel(app, gw, "Orders and quotes")
Rel(gw, me, "Places orders")
Rel(me, led, "Settles trades")
Rel(led, db, "Reads/writes")
Rel(gw, wal, "Withdraw request")
Rel(wal, comp, "Screen withdrawal")
Rel(wal, nodes, "Broadcasts and watches")
Rel(wal, cold, "Refills hot wallet")How an exchange processes a crypto withdrawal safely: balance hold, 2FA, risk and address screening, signing, broadcast and confirmations.
How an NFT marketplace works: listings signed off-chain, metadata on IPFS, and sales settled by a marketplace smart contract.
How a team safely upgrades a smart contract behind a proxy: audit, testnet rehearsal, multi-signature approval and a timelock before the change goes live.
The states a blockchain transaction goes through from signing to final confirmation, including replacement and dropped transactions.
How a custodian separates internet-connected hot wallets from offline cold storage, with signing hardware and an air-gapped transfer process.
Where a decentralised app's parts run: frontend on IPFS, contracts on a layer-2 chain, and supporting services like RPC providers and an indexer.