Digital Asset Custody: Models, Controls, and the Ledger Layer
Post your first withdrawal hold
Clone Formance Ledger on GitHub, run it locally, and post the withdrawal hold example from Part 2.
Post your first withdrawal hold
Clone Formance Ledger on GitHub, run it locally, and post the withdrawal hold example from Part 2.
Digital asset custody determines where client assets sit and who holds the keys to move them. When a withdrawal goes wrong, regulators such as the Securities and Exchange Commission (SEC) and supervisors under the Markets in Crypto-Assets Regulation (MiCA) test the ledger beneath the custody arrangement, whether the firm is an exchange or a neobank adding digital assets next to fiat.
On February 21, 2025, attackers drained about $1.5 billion in Ethereum from Bybit's multisig cold wallet by showing signers a disguised transaction, and the Federal Bureau of Investigation (FBI) attributed the theft to North Korea's TraderTraitor group. The signers approved a transaction that looked legitimate on their screens, so the signing control passed even though the transaction was wrong. A security review covers the signing side. Only a ledger can show what was approved, which client holds which position, and which deposits are final.
Digital asset custody has three parts, and each depends on the other two. The custody model decides who holds the keys and how much proof the chain carries. Key controls (quorum approval, address allowlists, and velocity limits) each need a ledger-side posting that enforces them. The ledger layer records both in a per-client register, with accounts for available, pending, and final balances.
Self-custody with segregated addresses, omnibus custody with a per-client register, and third-party or sub-custody are the three common digital asset custody models. Each one decides who holds the keys and how much of a client's position the chain can prove, which sets what your ledger must prove on its own.
Each custody model moves part of the proof burden from the chain onto your ledger. Two layers carry that burden: legal custody and technical key control.
With segregated addresses, the chain carries most of the position proof because each address holds one client's assets. An omnibus account leaves the chain showing a single balance shared by many clients, so a given client's position exists only in your per-client register.
Regulators expect a per-client register of positions. For omnibus funds, that register is what separately accounts for each client's share. A balance table that a webhook overwrites cannot produce it on demand.
Under every model, client ownership and deposit and withdrawal states are ledger facts.
One address per client keeps the chain close to the per-client register, but your ledger still owns the mapping from address to client and the split between pending and available. You generate and control the keys, and each address holds the assets of one client only.
The chain knows an address holds USD Coin (USDC) but doesn't know which client it belongs to.
An omnibus model requires the ledger to hold every client's position. You control the keys to the omnibus addresses, and every client deposit and withdrawal crosses them.
Without a per-client register, an omnibus structure cannot surface missing customer assets, because the omnibus balance never says whose assets are missing. The per-client register must also retain provenance: the source and status of funds. A client's settled deposit must remain distinct from an unconfirmed deposit and from the custodian's operating float.
A regulated custodian holds the keys, and you hold a claim on the custodian. Your ledger records that claim and reconciles it to the custodian's statement.
The custodian's daily position file is an external statement, and your per-client register has to agree with it. When they differ, you must be able to explain the register. Keep a warehousing promises view of what the custodian holds on your behalf next to each client's position.
| Model | Who holds the keys | What the chain proves | What your ledger must prove |
| Self-custody, segregated addresses | You | Most of each client's position | Address-to-client mapping, pending vs. available |
| Omnibus with per-client register | You | One omnibus balance | Every client's position, summing to the omnibus balance |
| Third-party or sub-custody | A regulated custodian | The custodian's holdings | Your claim, reconciled to the custodian's statement |
Every key-side control needs a ledger-side counterpart, or the ledger will record a movement the key policy was supposed to stop. A key control is a rule that limits what the signing keys can do. Quorum approval, address allowlists, and velocity limits each get a ledger-side counterpart below. Regardless of the signing scheme, the ledger sees only the approval outcome.
The examples below assume you hold or relay the signing keys. Under sub-custody, you post the hold when you send the instruction to the custodian, and the release when the custodian confirms the transfer.
Formance Ledger is an open-source, programmable core ledger that unifies fiat and digital assets with regulatory-grade traceability. Each counterpart below becomes a posting in it, and the per-client register is a view over its posting history.
Approval state belongs in the per-client register as well as the signer. Our design rule is that available balance decreases only through a posting that names the control which placed the hold and ensures ledger integrity.
In an omnibus model, a withdrawal request moves funds from available to a pending-withdrawal account as soon as the request is accepted, so signers cannot spend the available balance twice while they review.
In this example, client 4471 requests a 1,500,000 USDC withdrawal and starts with sufficient settled funds in @users:4471:available. The account @users:4471:withdrawal:pending holds funds awaiting approval, and @platform:chains:ethereum records movements on Ethereum.
The hold posting moves the amount from available to pending. The client's spendable balance already reflects the request. A second request for the same funds fails on insufficient balance, because @users:4471:available no longer holds the amount and the posting carries no overdraft clause.
After the quorum signs and the transaction broadcasts, the release posting moves the same amount from pending to @platform:chains:ethereum. That posting carries the approval reference, destination address, and on-chain hash as metadata.
Each step posts atomically as its own transaction, because double-entry accounting requires every debit to have an equal credit. Both legs of each posting therefore succeed or fail together.
The two postings below are written in Numscript, Formance's purpose-built language for describing financial transactions. The first places the hold when the request is accepted, and the second releases the held funds after approval.
// WITHDRAWAL_HOLD
// Event: hold funds on withdrawal request acceptance
send [USDC/6 1500000000000] (
source = @users:4471:available
destination = @users:4471:withdrawal:pending
)
set_tx_meta("event_type", "withdrawal_hold")
set_tx_meta("withdrawal_id", "wd-2026-10-19-88213")
set_tx_meta("approval_state", "awaiting_quorum")
// WITHDRAWAL_RELEASE
// Event: release held funds after quorum approval and broadcast
send [USDC/6 1500000000000] (
source = @users:4471:withdrawal:pending
destination = @platform:chains:ethereum
)
set_tx_meta("event_type", "withdrawal_release")
set_tx_meta("withdrawal_id", "wd-2026-10-19-88213")
set_tx_meta("approval_ref", "quorum-2of3-9f31c")
set_tx_meta("destination_address", "0x9b…")
set_tx_meta("onchain_tx_hash", "0x7c1e…a94d")Withdrawals should only go to addresses the client has verified. Teams commonly verify an address by having the client sign a message with it or by sending a small test payment, then adding it to the list.
Store verified addresses as metadata on the client's allowlist account, @users:4471:allowlist, together with each address's verification method and date. The release posting carries the destination address as metadata.
The ledger records that metadata but does not check it, so your application's pre-posting check must refuse to submit the release posting unless the destination address exists in the client's allowlist. The same check stops staff from sending funds to an unlisted address.
Daily and hourly withdrawal ceilings become balance checks on a per-client outflow allowance account that holds issued credits, which are separate from client USDC. The example below shows the daily limit. An hourly limit follows the same pattern with its own allowance account.
Issue the day's allowance in CREDITS/0 from @world into @users:4471:limits:daily:allowance, with one credit representing one whole USDC of withdrawal capacity.
The ledger then enforces the cap as an ordinary balance check. Record dates in transaction timestamps and keep them out of account paths. Retire unused credits before issuing the next day's allowance.
Extend every release transaction with a send moving the corresponding credits from the allowance into @users:4471:limits:daily:consumed, without an overdraft clause to enforce the cap.
When the allowance is exhausted, the entire release transaction fails due to insufficient funds, and your application must log the failure in its own withdrawal-request log, including the withdrawal ID and the reason.
The ledger layer is where models and controls become records. A small set of accounts records every custody model and key control, in a per-client register that also tracks how unconfirmed deposits move to final. An examiner can test each account against one question: what the client owns, what is awaiting approval, what is not yet final and which controls apply.
The per-client register is a view over the ledger's posting history. A client's fiat leg and digital asset leg can sit in one account tree, so the register covers both. The accounts used in this article form that tree:
The accounts answer each examiner question. Available shows what the client owns, pending accounts show what awaits approval or finality, and allowlist and limit accounts show which controls apply.
Credit each deposit to a pending account at first sight, move it to available only at the settlement finality depth you chose for the asset, and never let a withdrawal draw on pending.
A deposit passes through four states: seen in the mempool (the accumulation of unconfirmed transactions) or a fresh block, pending in the ledger, final at the chosen depth, and available to the client. If the chain drops the transaction before it reaches the depth (a chain reorganization, or reorg), the state is removed, and a reversal posting unwinds the pending credit.
The reversal is a new posting that unwinds the credit and keeps the history intact. The original credit moved the amount from @platform:chains:ethereum to @users:4471:deposit:pending. The reversal moves the same amount back, with metadata naming the original event hash and the reason.
A point-in-time query for the moment between the credit and reversal returns the pending balance that existed then. The hold posting from the withdrawal sources only from @users:4471:available, so a reorged deposit cannot fund a payout that has already broadcast.
Idempotency keys prevent a re-delivered chain event or duplicate webhook from producing a second credit. Use the on-chain event hash as the idempotency key for pending credits, and use a derived key for the promotion from pending to available. Idempotent postings keyed on the event hash keep a retry from corrupting the per-client register.
Confirmation depth is a per-asset risk decision, which highlights the importance of understanding transaction finality.
The chain shows only addresses and balances, and the custodian's signing policy decides who can move assets. Neither can tell you which client owns a position, which withdrawals await approval, or which deposits are final. Ask which client positions your ledger could not reconstruct before you pick a confirmation depth.
Because the ledger carries that proof, it is the first piece to build and test. Formance was built as open-source infrastructure, so you can test your own client account tree against the ledger before you commit to a design.