Reference
What it does
The escrow module holds tenant funds against active leases. When a deployment is created, the tenant funds an escrow account; when leases form, payment obligations draw against that balance. Providers can verify collateral exists before committing capacity, and tenants know funds move only under settlement rules — not at a counterparty's discretion.
Escrow accounts track deposits, settlements, and withdrawals as auditable state transitions. If a balance runs dry, the associated leases close for non-payment; when a deployment closes, any unspent balance returns to the tenant.
Why it exists: Payment risk kills open marketplaces: providers won't serve strangers on the promise of a future invoice, and tenants won't prepay strangers either. On-chain escrow removes both counterparty risks at once — funds are provably committed but provably not yet transferred.
State
Primary objects
| Concept | Definition |
|---|---|
Escrow account | The on-chain balance a tenant funds against a deployment's payment obligations. |
Drawdown | The settlement-triggered transfer from escrow toward a provider's earned balance. |
Messages
Messages & queries
Message and query surfaces are documented at implementation level in the module docs ↗ and the source ↗. The objects above are the state those messages create and transition.
Connections
Module interactions
-
x/marketEvery lease is backed by a funded escrow account from creation. -
x/settlementSettled usage line items draw down escrow into provider payouts. -
x/deploymentDeployments fund and reclaim the escrow behind their leases.
Flows
Core flow
- Fund — Tenant funds escrow. The deployment's escrow account opens with real budget behind it — demand arrives collateralized.
- Verify — Providers check collateral. Capacity commits only after collateral is provably in place and visible on-chain.
- Draw — Settlement draws down. Each cleared usage record converts into a drawdown toward the provider's earned balance.
- Refund — Remainders return. Unspent balances flow back to the tenant when the deployment closes.
Questions
Asked about x/escrow
What is an escrow account?
The on-chain balance a tenant funds against a deployment's payment obligations — deposits, settlements, and withdrawals tracked as auditable state transitions.
What is a drawdown?
The settlement-triggered transfer from escrow toward a provider's earned balance — the moment committed funds become earned funds.
What happens if escrow runs dry?
Associated leases close for non-payment through the market state machine: service stops, and the record stays auditable for both sides.
Related