Skip to content

x/escrow — Escrow module

The x/escrow module is the marketplace’s payment-custody layer. A tenant’s budget is committed on-chain against active leases before work starts, yet it does not transfer until settlement rules say so — never at a counterparty’s discretion.

Every deposit, drawdown, and refund is an auditable state transition, so both sides can always explain where a balance came from and where it went.

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.

Beyond the lease lifecycle, the module carries an IBC bridge with transfer and timeout handling, a dispute subsystem, invoice and billing records, and payout and reconciliation subsystems that keep reported and settled amounts honest.

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.

ConceptDefinition
Escrow accountThe on-chain balance a tenant funds against a deployment’s payment obligations.
DrawdownThe settlement-triggered transfer from escrow toward a provider’s earned balance.
  1. Fund — Tenant funds escrow. The deployment’s escrow account opens with real budget behind it — demand arrives collateralized.
  2. Verify — Providers check collateral. Capacity commits only after collateral is provably in place and visible on-chain.
  3. Draw — Settlement draws down. Each cleared usage record converts into a drawdown toward the provider’s earned balance.
  4. Refund — Remainders return. Unspent balances flow back to the tenant when the deployment closes.

x/escrow submits exactly one message of its own: MsgAccountDeposit, which authorizes a deposit and credits the escrow account.

The lease-escrow lifecycle — MsgCreateEscrow, MsgActivateEscrow, MsgReleaseEscrow, MsgRefundEscrow, and MsgDisputeEscrow — is not submitted here. Those messages are registered by the x/settlement module and drive escrow state from outside; its page carries the full lifecycle table.

QueryPurpose
AccountsEscrow accounts tracked by the module.
Invoice / InvoiceLedgerAn invoice and its entry ledger.
InvoicesByCustomer / InvoicesByProviderInvoices filtered by customer or provider.
PaymentsPayments recorded against escrow.
ModuleHow they interact
x/marketEvery lease is backed by a funded escrow account from creation.
x/settlementSettled usage line items draw down escrow into provider payouts.
x/takeApplies the governed settlement-fee policy as escrow releases to providers.
x/deploymentDeployments fund and reclaim the escrow behind their leases.

The on-chain balance a tenant funds against a deployment’s payment obligations — deposits, settlements, and withdrawals tracked as auditable state transitions.

The settlement-triggered transfer from escrow toward a provider’s earned balance — the moment committed funds become earned funds. See the x/settlement module.

Associated leases close for non-payment through the market state machine: service stops, and the record stays auditable for both sides.