Every custodial crypto product is, underneath the trading screens and the mobile app, a system for holding other people's keys and proving at any moment that the money is where the books say it is. That system is what I mean by crypto custody architecture: the key layer, the wallet topology, the deposit and withdrawal pipelines, the ledger that records all of it, and the governance that decides who may move what.
This page is the hub for everything I write about custody. It walks the whole architecture once, end to end, at the level of a design review. Each section ends with the deeper article that covers it in detail, where one exists. If you are building or auditing a custodial exchange, a wallet product or a crypto-to-fiat rail, start here.
What custody means in a system diagram
Regulators define custody as safeguarding client assets. Engineers need something more concrete. In practice a custodial system has three layers, and most architecture mistakes come from blurring the lines between them.
- The key layer. Where private keys or key shares live and how a signature is produced. HSMs, MPC nodes, a third-party custodian's infrastructure, or a mix. Nothing here knows what a customer is.
- The custody service layer. Wallet and address provisioning, transaction construction, policy checks, signing orchestration, broadcast, and chain observation. This layer knows about assets and addresses but should not own balances.
- The ledger and business layer. Customer accounts, balances, holds, fees, and the journal that records every movement. This is the system of record. Everything else is a counterparty it reconciles against.
The single most useful rule I know: balances live in the ledger, never in the wallet. A wallet balance is a fact about a chain. A customer balance is a liability on your books. They should agree, and a job should check that they do, but they are not the same number and one must never be copied into the other.
Custody models and where the keys live
The first decision is who controls key material, and it shapes everything after it.
- Self-custody with HSMs or multisig. You hold the keys in hardware security modules, or split control across several on-chain signers. Maximum control, maximum operational burden: key ceremonies, backups, physical security, staff vetting, and an audit story you have to write yourself.
- MPC threshold signing. The key never exists in one place. Several parties each hold a share and jointly produce a signature. Protocols such as GG20 made this practical for ECDSA chains. It gives you policy flexibility and no single point of compromise, at the price of a distributed signing system you must run and understand.
- Third-party custodian. A licensed provider holds the keys behind an API and a policy engine. You trade control for their controls, their insurance and their audit reports. The engineering problem becomes integration, idempotency and not coupling your business logic to one vendor.
- Hybrid. The common end state for a regulated venue: a custodian for the bulk of client assets, a separately governed operational wallet for hot liquidity, and the ability to run two providers side by side for resilience.
Layered on any of these is the temperature model. Hot wallets sign automatically within tight limits. Warm wallets need human approval. Cold storage is offline and slow by design. The engineering question is not which tier to use but how value flows between them, who approves each flow, and how the ledger represents assets that are in transit between tiers.
Deep dive coming: key management options compared, with the operational cost of each.
Wallet topology: omnibus, segregated and everything between
Once you know where keys live, you decide how customer assets map onto addresses.
- Omnibus. One pooled wallet per asset holds everyone's funds. Each customer gets a unique deposit address, and deposits are swept into the pool. Cheap to operate, simple to manage liquidity, but segregation exists only in your ledger.
- Segregated. Each customer has their own wallet, and funds are not commingled on chain. Stronger protection in insolvency and easier to prove, but fees multiply and liquidity management becomes a routing problem.
- Segregated client pool. The usual regulatory middle: client assets are held in wallets separate from the firm's own assets, pooled across clients, with per-client entitlements in the ledger. VARA's custody rules and MiCA both push in this direction.
Chains complicate the picture. Account-model chains (Ethereum, Tron) give every customer an address cheaply but make sweeping a gas cost. UTXO chains (Bitcoin) make address generation trivial but require careful coin selection. Memo-and-tag chains (XRP, Stellar) share one address and distinguish customers by a tag, which means a missing tag is a support ticket and a customer-facing warning. Your asset registry should carry all of these properties, and your routing layer should read them rather than hard-code them.
The deposit pipeline
Deposits look passive and are anything but. The pipeline has five stages, and each has a failure mode that costs money.
- Provision an address. Generate or request a deposit address for a customer and asset, persist the mapping, and remember which provider or key owns it. Addresses are sticky: they belong to the key that generated them for as long as any customer has them saved.
- Observe the chain. Either run your own indexers or consume a provider's events. Treat both as hints. The authoritative check is a read against the chain or the custodian's API.
- Apply the confirmation policy. The number of confirmations before you credit is a risk decision per asset, set by you, not inherited from a vendor's default. Store it in the asset registry.
- Credit the ledger. Post a journal entry: debit the custody asset account, credit the customer liability. This is the only step that changes a balance, and it must be idempotent on the deposit's chain identity.
- Sweep. Move funds from deposit addresses to the operational pool on a schedule that balances gas cost against hot-wallet exposure. Sweeps are internal transfers and should post as such, never as customer activity.
Reorgs are the case that separates a demo from a production system. A deposit credited at three confirmations that disappears in a six-block reorg is a real loss if the customer has already traded or withdrawn. The defensive posture is a confirmation threshold tied to the chain's reorg history, holds on freshly credited value for the riskiest assets, and a compensating ledger entry rather than a deleted row when the worst happens.
The withdrawal pipeline
Withdrawals are where custody systems lose money, so this is the pipeline that deserves the most design time. The shape I have converged on:
request → intent recorded → policy checks → approvals → routed to signer/provider
→ signed → broadcast → confirmed → settled in ledger
- Intent first. Write the withdrawal to your ledger, with an identifier you generated, before anything touches a network. A retry must find the same intent, not create a new one.
- Policy as data. Per-asset and per-customer limits, address whitelists, velocity checks, Travel Rule beneficiary data, and sanctions screening run against the intent and record their verdicts. The engine is boring on purpose: it evaluates rules stored as data so compliance can change a threshold without a deploy.
- Approvals by quorum. Above a limit, humans approve. Who, how many, and from which roles is itself policy. Approvals are journal entries in an audit log, with the approver's identity and the exact payload they saw.
- Routing and signing. Choose the provider or signer based on asset, amount and capability, pin the choice to the intent, and submit. Fee estimation, nonce management and replacement of stuck transactions live here.
- Settlement. The ledger moves from a pending hold to a final debit only when your confirmation policy is met. Nothing reverses out of settled. Corrections are new entries.
The hard part is idempotency across the gap between "we submitted" and "we know what happened". A timeout there does not mean failure; it means unknown, and unknown must be a first-class state that a recovery job resolves by reading back from the provider. Two of my articles cover this in depth.
Read next: Designing provider-agnostic crypto custody, on the custody port, status mapping and running two providers. Then Idempotency in payment systems, explained, on why intents and keys you generate are the only reliable protection. Deep dive coming: withdrawal pipelines, approvals, limits and audit trails.
The ledger is the system of record
I came to engineering from accounting, and this is the part of custody that the accounting habit maps onto directly. The ledger is double-entry. Every movement of value is a journal entry with at least two legs that sum to zero, and the entries are immutable once posted.
A minimal chart of accounts for a custodial exchange looks like this:
- Customer liabilities, one per customer and asset, with available and held sub-balances.
- Custody assets, one per wallet or custodian account and asset, mirroring what is actually on chain.
- In-transit accounts for deposits awaiting confirmation, sweeps in flight and withdrawals submitted but not settled.
- Fees and revenue, so that network fees and your own fees are visible and reconcilable, not lost in rounding.
Reconciliation is what makes the ledger trustworthy. Scheduled jobs compare three things: your ledger's custody asset balances, the custodian's reported balances, and the chain itself. Differences are explained by in-transit entries or they are alerts. Done daily, this catches a mis-mapped decimal or a missed status transition the same day. It is also the raw material for proof of reserves, which is becoming an expectation rather than a differentiator.
Deep dive: Reconciling ledger, balance and custody state (coming), on the job design, what explains a break, and the alert thresholds that actually work.
Key governance and the policy engine
Keys are only as safe as the rules about who may use them. Governance is the set of controls that turns a signing capability into a custody service.
- Separation of duties. The person who requests a movement cannot approve it. The engineer who deploys the policy engine cannot change a limit in production without a second party.
- Quorum and roles. Approvals require M of N from defined roles, with higher thresholds for larger amounts, new destinations and cold storage movements.
- Key ceremonies and recovery. How keys or shares are generated, backed up, and recovered is documented, rehearsed and witnessed. NIST SP 800-57 is the reference most auditors expect you to have read.
- Audit trail. Every policy evaluation, approval, signature and broadcast is logged with who, what, when and the exact payload. The log is append-only and retained for the period your regulator sets.
- Emergency procedures. A kill switch that halts withdrawals, a tested path to rotate a compromised key, and a plan for a custodian outage that does not involve guessing.
The CryptoCurrency Security Standard is a useful checklist for this layer, and the VARA custody rulebook sets expectations for licensed venues in Dubai. Neither tells you how to build it, which is why the policy engine deserves the same design care as the signing path.
Operating it
A custody architecture is judged in its worst week, not its launch week. The operational concerns worth designing for from the start:
- Provider outages. If one custodian is down, can withdrawals route to another, and can deposits still be observed? This is the operational-resilience question regulators ask, and the architectural answer is the custody port described in the provider-agnostic article.
- Chain incidents. Reorgs, halted chains, contentious hard forks and congested fee markets. Each needs a runbook and ideally a feature flag that pauses a single asset without touching the rest.
- Stuck and dropped transactions. A sweeper over every non-terminal transfer older than a threshold, with the ability to bump fees or re-broadcast through the provider.
- Monitoring that means something. Reconciliation breaks, webhook lag, confirmation delays per asset, hot-wallet balance against its ceiling, and policy engine rejections by rule. Dashboards for the desk, pages for the on-call.
- Drills. Rehearse a custodian failover, a key rotation and a withdrawal halt before you need any of them.
A reference architecture
Putting the layers together, the shape most regulated custodial products converge on looks like this:
┌──────────────┐ ┌──────────────┐ ┌───────────────────────────┐
│ Public API │──▶│ Policy engine│──▶│ Withdrawal orchestrator │
│ (intents) │ │ (rules+quorum│ │ intent → route → submit │
└──────────────┘ └──────────────┘ └─────────────┬─────────────┘
│ custody port
┌────────────────┼────────────────┐
▼ ▼ ▼
┌────────────┐ ┌────────────┐ ┌────────────┐
│ Adapter A │ │ Adapter B │ │ Self-signed│
│ (custodian)│ │ (custodian)│ │ (MPC/HSM) │
└─────┬──────┘ └─────┬──────┘ └─────┬──────┘
└───────────────┼───────────────┘
▼
┌──────────────┐ ┌──────────────┐ ┌───────────────────────────┐
│Chain observer│──▶│ Ledger │◀──│ Reconciliation jobs │
│ + webhooks │ │ double-entry │ │ ledger vs custodian vs │
│ (hints only) │ │ system of │ │ chain, daily │
└──────────────┘ │ record │ └───────────────────────────┘
└──────────────┘
every box writes to an append-only audit log
Three properties make it work. The ledger is the only place a balance changes. The custody port keeps vendors replaceable. And every arrow that moves value is idempotent on an identifier you generated.
The series
This hub will grow as the deep dives are published. Current and planned articles:
- Designing provider-agnostic crypto custody: the custody port, status mapping, idempotent withdrawals and the migration path to a second provider.
- Idempotency in payment systems, explained: the foundation every withdrawal pipeline stands on.
- Reconciling ledger, balance and custody state (coming): the three sources of truth, the job design, alert thresholds and proof of reserves.
- Key management options compared: HSM, MPC and custodial APIs (coming).
- Withdrawal pipelines: approvals, limits and audit trails (coming).
If you are designing one of these systems and want a second pair of eyes, this is the kind of work I take on.
Written from public vendor documentation, published regulation and general industry practice. It does not describe the architecture, controls or operations of any employer or client. Views are my own.
