An escrow is an on-chain contract that holds tokens for their owners while something is pending, such as an order waiting to fill, a cash-out waiting for the bank, or a custody gateway withdrawal waiting to be paid. Each escrow has one controller, such as a trading venue, a custody gateway or a bank rail wallet, which locks the owners' units and pays them out.
Without an escrow, each feature would keep its own pooled balance and accounting. Every DALP system, the set of contracts an organisation deploys on a network, gets an escrow factory so every controller shares the same lock, payout and compliance rules. A holder of the token's custodian role can still move an owner's units out of an escrow with a forced transfer, even while the owner is frozen.
What holds tokens in an escrow
Three features request an escrow from the factory. Each escrow receives a label at creation so operators can tell escrows apart.
An XvP settlement does not use an escrow. Each sender's leg sits in the settlement contract itself until the settlement executes, cancels or expires. XvP settlement explains that flow.
When a controller deposits for an owner, the escrow pulls the tokens from an approval the owner gave the escrow itself. A trader approves the venue's escrow once, and a bank rail client approves the rail wallet's escrow before a cash-out, so the escrow never takes more than the owner approved.
Who controls an escrow
An escrow has exactly one controller, fixed at creation, and no roles of its own. Only the controller locks, unlocks, relocks and pays. A controller that needs a second arrangement requests a second escrow from the factory.
Several other paths can still move units out of an escrow without the controller:
- A token custodian through a forced transfer.
- A lost-wallet recovery that moves unlocked units to the replacement wallet.
- A corporate action that mints to or burns from the escrow by design, or the close of a rights issue that burns lapsed rights.
- A token feature attached by the token's governance role.
- A system manager or the add-on registry replacing the escrow implementation contract.
Directly on the token contract, the Supply management role can also burn at the escrow's address, the Custodian role can freeze the escrow or force a recovery of its whole balance, and a replacement wallet can recover that balance once an identity manager marks the escrow lost. The Platform API and the Console refuse those direct requests, as What the platform refuses on an escrow explains.
Two kinds of caller can create an escrow: an add-on factory registered in the system, or a wallet holding the system's escrow manager role. The bank rail is not an add-on, so it creates an escrow for its rail wallet through the escrow manager route. A zero-address controller is refused.
Each escrow receives its own on-chain identity, registered with a country the creator names, and is placed on the system's compliance bypass list so owners can deposit into it. A transfer into a bypass-listed address skips recipient-side eligibility rules such as country lists, identity lists and identity verification. The address block list still checks the escrow's address.
Every escrow runs the implementation the factory points to. A holder of the system manager role, or the add-on registry, can move that pointer and upgrade every escrow of the system at once. The factory asks for no second approval and checks only that the new code reports two ERC-165 interfaces: the escrow interface and the interface of a contract with its own on-chain identity.
What the escrow books
Per token and per owner, the escrow keeps an unlocked balance and any number of locks. The unlocked balance is what the owner may withdraw, returned by the API as free and shown in the Console as “Free”.
- Deposit. Books an amount to the owner's unlocked balance. The owner deposits directly, or the controller deposits on the owner's behalf using the owner's approval. The escrow must receive the exact amount it books, so fee-on-transfer or rebasing tokens revert.
- Withdrawal. Pays the caller's unlocked balance to the caller. It is refused while the token reports the caller frozen.
- Lock. Holds units until a date, after which the owner may take them back. A lock can also carry no owner exit for units the owner already agreed to hand over, such as a matched trade.
Every unit an owner deposits is booked, so what the escrow owes stays at or below its token balance. The exception is a token that moves tokens out itself, covered in Sweep, and what the escrow cannot prevent. The contract's owed view reports total debt per token, and lockOf reports one lock, returning all zeros for an unopened identifier.
The controller picks each lock's identifier. An identifier can be used once and stays used after the lock empties, so every lock and event remains unambiguous. A new lock's end date must lie in the future unless the lock carries no owner exit.
How a controller moves units
Only the controller posts moves, and a call applies its list of moves all or nothing. There are five move kinds.
An Unlock, Relock, Pay or Book can take the whole remainder of a lock. A Relock that would move nothing reverts, so relocking an emptied lock fails. A Pay from the unlocked balance that names anyone other than the owner reverts: a controller moves an owner's unlocked units to someone else only by locking them first and paying the lock.
A Book makes no call to the token, so it runs no compliance check. It still refuses a frozen lock owner, and a recipient that is the zero address or the escrow itself. The trading venue uses Book to park a delivery leg whose receiver the token refused: the units wait in the receiver's unlocked balance, and the receiver's withdrawal runs token compliance again.
A Pay is the token's own transfer from the escrow, so token compliance runs on it and the owner's freeze check applies. A Pay never names the zero address or the escrow itself. A recipient on the compliance bypass list gets the answer the token's compliance gives any transfer to it: the escrow adds no rule of its own. A lock paid into a second, bypass-listed escrow therefore moves, but every Pay or sweep out of that escrow is again the token's own transfer, so the units still reach only a wallet the token admits.
Anyone may reclaim an expired lock. Reclaim books the remaining lock back to its owner's unlocked balance and calls no token, so token rules cannot block it. A lock with no owner exit can never be reclaimed.
Deposits and withdrawals move the unlocked balance, the controller locks from it, and a lock leaves by unlock, reclaim, relock or a Pay under token compliance.
The escrow claim and token compliance
Some compliance rules check how long the sender has held the units. Because every payout comes from the escrow, those rules would block payouts until the escrow itself had held the units long enough.
The factory issues a dalpEscrow claim to each escrow's identity, shown in the Console under the topic “Escrow account”. By default the platform binds a time-lock rule to that claim as a sender exemption. A sender carrying the claim skips the refusal check while the rule stays in accounting-only mode and still records the transfer.
When an owner deposits into an escrow, sender-side rules such as the time lock and the address block list run with the owner as sender. Recipient-side rules such as country lists, identity lists, identity verification and transfer approval skip the escrow because it sits on the bypass list.
A payout from a lock runs the recipient's rules with the escrow as sender. So that a rule scoped to the sender, such as one that blocks US receivers of an NL seller, still judges the owner, the escrow first asks the token's compliance whether the recipient may receive from the owner. A refusal fails the payout with ReleaseRefused and the units stay in the owner's lock. This check runs only the recipient-eligibility rules that carry a sender scope. Holding rules and transfer approval are not part of it. A payout to the lock's own owner, and a booking, ask nothing. The trading venue asks the question when a trade fills and delivers a held trade without asking it again.
Under an issuance-based time lock, units leaving the escrow take the escrow's oldest units with their original unlock times, so a withdrawal or payout never restarts the holding clock. A receipt-based time lock restarts the recipient's holding clock on each receipt. Composable token describes the compliance modules.
A minimum-holding rule lists dalpEscrow among its exempt claims by default. The escrow's own pool can therefore sit below the minimum, while the owner on a deposit and the recipient on a payout still have to clear it. The issuer can change or remove either setting in the token's compliance settings.
The factory receives its own identity in the same transaction that installs it, so no other account can bind one to its address first. It issues the dalpEscrow claim once the system has registered that topic and trusts the factory's identity to issue it. Until a system has both, new escrows receive no claim, these exemptions do not apply, and anyone may add the claim later through the factory.
A corporate action re-bases the escrow
A stock split, bonus issue or other corporate action that changes every holder's units by a ratio mints to or burns from the escrow the change the ratio makes to its owners' free balances and locks. It also freezes the escrow for that token until the action ends, so the escrow refuses deposits, withdrawals, payouts, forced transfers and recoveries meanwhile, as Freeze until the action ends describes.
Sweep, and what the escrow cannot prevent
Tokens can reach an escrow address by a plain transfer that books them to no owner. A sweep pays out the exact token balance that exceeds what the escrow owes, and only the controller may call it. When the balance is at or below total debt, the sweep reverts.
Directly on the token contract, privileged calls can still force-transfer from the escrow's address, burn from it, recover its whole balance to another wallet or apply a negative rebase. Each can leave the escrow owing more than it holds. The platform refuses the burn, the forced transfer and both recoveries on its own routes, as What the platform refuses on an escrow lists, while a direct contract call, a negative rebase or a rights-issue close burn can still reach the escrow.
When an escrow owes more than it holds
Every minute, the platform reads on chain what each indexed escrow owes and holds across every token with debt or an open case. When an escrow owes more than it holds, the platform opens a critical “Escrow balance shortfall” case of kind escrow-ledger-deficit for each organisation using that system.
The case names the escrow, token, amount owed, balance and shortfall in base units. Users with the Owner or Platform administrator role work it on Cases, and webhooks receive operations.case.opened, as Operations describes.
Nothing returns missing units automatically. Inspect recent burns, forced transfers and supply changes at the escrow's address to find what moved the units out, then return the shortfall by minting or transferring to the escrow. The platform resolves the case on the next pass once the balance covers total debt. Resolving a case manually while the shortfall remains opens it again on the next pass.
While the platform cannot read an escrow system, for example because its network does not respond, it leaves open cases unchanged and logs a warning naming the chain_id and system_address.
The observability chart ships two alerts for this check, described in Alerts that show a recovery risk:
EscrowLedgerDeficit(critical): fires when a network has at least one escrow and token in deficit for 5 minutes.EscrowLedgerSweepFailing(warning): fires when 10 or more passes fail within 15 minutes for 5 minutes.
While a system cannot be read, the deficit count keeps its last value, so EscrowLedgerDeficit can stay quiet for a new deficit or keep firing for a repaired one. Route both alerts to the team working operations cases.
Forced transfer
A holder of the token's custodian role can move an owner's units out of an escrow even while the owner is frozen. The transfer draws the owner's unlocked balance first, then each lock the caller names in order, emitting an event that names each lock and amount drawn.
Locks belonging to another owner or token are refused, as is an amount exceeding the unlocked balance plus the listed locks. Through the Platform API, a lock that is no longer open is also refused. While a corporate action freezes the escrow for the token, forced transfers are refused until the action ends. For a DALP token the caller must hold the custodian role, and for a plain ERC-20 only the controller may call it. Either way the recipient must be accepted by the token.
Through the Platform API, a token custodian calls POST /api/ with the token, owner, recipient, amount, up to 32 lock identifiers, wallet verification and an Idempotency-Key header. That route also enforces bank-rail cash-out rules that the escrow contract itself does not check. Empty an escrow the old wallet controls lists those rules, and Escrows in the Console shows how to look up locks.
The token's own route, POST /api/, refuses a forced transfer from an escrow with 422 TOKEN_ (DALP-12117) because it would move units without updating escrow books. Use the escrow route instead.
Recovering a lost wallet
Once identity recovery marks a wallet lost, that wallet's key can no longer move its escrow balance. The escrow refuses its withdrawals, the venue's payouts from its free balance and new orders that would lock it, with the error ClaimantWalletLost (DALP-4531).
Anyone may move a lost wallet's unlocked balance to its replacement wallet. The escrow follows the recovery chain to its last wallet, up to eight recoveries deep, and pays only while the token does not report the lost wallet frozen. For a DALP token the escrow reads the token's own identity registry. For every other token, a stablecoin or another issuer's ERC-3643 token included, it reads the system's identity registry. Because the identity manager role marks a wallet lost and names its replacement, that role decides where the units go.
Identity recovery pays these balances itself. Once the recovery is recorded on chain and the user's wallets are swapped, it waits for the indexer to reach the chain at that point and cancels every order the lost wallets signed on a trading venue of the system, so those orders stop matching. The venue's submitter wallet, which holds the venue's submitter role, raises each lost wallet's order epoch by one, and the venue closes the orders and returns their locks to the lost wallet's unlocked balance. The recovery waits for those locks, for up to ten minutes once the cancels are final on chain. It then reads the lost wallet's unlocked balance in every escrow of the system on chain and pays each one to the replacement wallet. A balance the escrow cannot pay shows in the recovery's token recovery failures with the escrow's address, for example when the token has frozen the lost wallet. Ask a custodian to lift the freeze, then run the recovery again. A lost wallet that never had an identity is not marked lost, so its escrow balance is reported instead and moves only by forced transfer.
Units that reach the lost wallet's unlocked balance after the recovery wait in the escrow: a lock released later, an order lock the venue had not returned when the wait ended, or a trade leg. On the trading venue, a held trade that settles after the recovery books the lost seller's or buyer's leg to that unlocked balance instead of paying it, and an immediate fill that would pay a lost wallet fails as a refused transfer. The recovery names each order lock still held when it finished in its token recovery failures. Ask the venue operator to retry or reconcile that order's escrow refund.
To pay what waits there, an identity manager sends POST /api/ with the escrow, the token and the lost wallet, confirmed with wallet verification. The platform checks that the wallet belonged to that user, that the identity registry marks it lost, that the escrow belongs to the organisation's system and that the wallet holds an unlocked balance there. It then sends the escrow's recover from the identity manager's wallet. The request names no destination: the escrow pays the end of the recovery chain. The route refuses while a recovery of that user is still running, because the recovery pays these balances itself. Anyone can also send recoverTokens to the escrow directly.
What the platform refuses on an escrow
The token contract itself does not refuse a burn, freeze, forced transfer or recovery at an escrow's address. The Platform API and the Console refuse these requests before signing because each would destroy, block or move units owed to owners.
Two platform paths burn from an escrow by design: a corporate action re-bases it and keeps its books level, and the close of a rights issue burns lapsed rights across every holder including escrows. See Review, then run it.
Each Platform API refusal names the escrow in its message and data.escrowAddress, signs nothing and does not change on retry. If a batch names several escrows, the whole request is refused and data.escrowAddress names the first. Frozen v1 equivalents return 422 INPUT_ with the same DALP-12118, DALP-12119 or DALP-12117 identifier.
The platform recognises escrows from its own index of escrows created by each system's factory. An escrow created moments before a request can still be indexing. If the platform cannot read that index, it refuses the request as a retryable platform error and sends nothing.
The platform does not refuse an escrow's address on Block addresses in Global controls. Because payouts and withdrawals run the address block list against the escrow's address, blocking an escrow stops every withdrawal and payout for every owner.
To stop one owner's units in an escrow, freeze that owner's own wallet using Block on the token's Blocklist tab or a wallet restriction. While frozen, the owner cannot withdraw and locks cannot pay out or book, though a custodian's forced transfer from the escrow still runs. A partial freeze of the owner's wallet does not reach units in escrow.
Reading escrows
A platform administrator or organisation owner can list escrows and inspect balances, locks and history. Every other caller receives not found, as does any request for an escrow outside the caller's system or under an archived factory.
The list route supports filter[addonKind] (trading-venue or other, covering custody gateways and bank rail wallets), sorting and meta.facets counts. The balances, locks and events routes each take a page window and their own sort.
A lock status is open while units remain. Once emptied, its status records the move that emptied it: unlocked, relocked, paid, booked, reclaimed or forced.
The Console shows the same escrows under Asset lifecycle › Escrows, described in Escrows.
Related pages
- Composable token: the compliance modules that decide whether a deposit or a payout passes.
- Custody gateway: an add-on that asks the factory for one escrow per client gateway.
- Custody receipt: the token a client returns to its gateway, locked in the gateway's escrow, when it withdraws.
- Trading venue: an add-on that holds an order's committed units in its escrow until a fill, a cancel or expiry.
- XvP settlement: settlement that holds each side's leg in its own contract until the exchange.
- Bank rail API: the cash-out flow that locks a client's tokens in the rail wallet's escrow.