Chapter 46: Escrow
Escrow allows a purchaser to commit money to a purchase without transferring ownership of that money to the seller before the agreed release conditions have been satisfied. The escrowed money remains the purchaser's property, but CATS reserves it so that the purchaser cannot spend it for any other purpose. Neither CATS nor an escrow service becomes the owner of the money.
An escrow begins before the goods or services have necessarily been transferred. It therefore
refers to a PurchaseAgreement, rather than to a completed Purchase. The agreement
records what the producer has promised to supply, its price, the accounts used for payment, and the
contract containing the delivery and release terms.
entity PurchaseAgreement
{
NodeId node;
Uint64 id;
ProducerAccount producerAccount;
ConsumerAccount consumerAccount;
Account fundingAccount;
Account receivingAccount;
TimeStamp agreedAt;
LineItem item+;
Contract terms;
→ Int64 totalPrice = item.price.Σsum;
key {node,id};
constraints
{
fundingAccount.owner = consumerAccount.consumer;
receivingAccount.owner = producerAccount.producer;
fundingAccount.denomination = producerAccount.denomination;
receivingAccount.denomination = producerAccount.denomination;
totalPrice > 0;
}
}
Release conditions
The parties choose the evidence that will release the payment. CATS can determine facts recorded in its trusted data, including signatures and the passing of a deadline. A disputed external fact is decided by the adjudicator and procedure identified by the contract.
value PurchaserReceipt
{
Person purchaser;
}
value DispatchProof
{
Person carrier;
}
value CustodyHandoverProof
{
Person carrier;
}
value TimedRelease
{
TimeStamp releaseAt;
}
value AdjudicatedRelease
{
Person adjudicator;
String adjudicationRule;
}
variant EscrowReleaseCondition
{
PurchaserReceipt purchaserReceipt;
DispatchProof dispatchProof;
CustodyHandoverProof custodyHandoverProof;
TimedRelease timedRelease;
AdjudicatedRelease adjudicatedRelease;
}
enum ConditionCombination
{
all,
any
}
An escrow may require all listed conditions or any one of them. This can express arrangements such as release on the purchaser's signed receipt, or on both carrier confirmation and expiry of an inspection period, or when an adjudicator orders release.
Reservation of the purchaser's money
The node authoritative for the funding account is also authoritative for its escrows. It creates an escrow only when the account has enough available money, and creates the reservation atomically with the escrow. Ordinary transfers may spend only the available balance:
\[ \operatorname{availableBalance}(a) =\operatorname{balance}(a) -\sum_{e:\,e.\operatorname{fundingAccount}=a\,\wedge\,e.\operatorname{active}} e.\operatorname{amount} \geq 0. \]
entity Escrow
{
NodeId node;
Uint64 id;
PurchaseAgreement agreement;
Account fundingAccount;
Int64 amount where amount > 0;
TimeStamp createdAt;
TimeStamp maximumCompletionTime;
ConditionCombination conditionCombination;
EscrowReleaseCondition releaseCondition+;
EscrowResolution resolution?;
key {node,id};
constraints
{
node = fundingAccount.node;
fundingAccount = agreement.fundingAccount;
fundingAccount.owner = agreement.consumerAccount.consumer;
fundingAccount.denomination = agreement.producerAccount.denomination;
amount = agreement.totalPrice;
resolution.releasedAmount <= amount;
resolution.allocation.(recipient.denomination = fundingAccount.denomination);
}
}
entity AccountEscrowState
{
Account account;
Escrow escrow* where escrow.fundingAccount = account;
→ Int64 reservedBalance = escrow.[resolution.Σempty].amount.Σsum;
→ Int64 availableBalance = account.balance - reservedBalance;
key {account};
constraints
{
availableBalance >= 0;
}
}
The reservation is not a transfer. The purchaser continues to own the money while the escrow is active. The reservation merely prevents outgoing transfers from consuming the committed amount.
Resolution
Creation of the escrow authorises CATS to make the transfers specified by the agreement when the release conditions are satisfied. No further permission from the purchaser is required at release; otherwise a purchaser could accept delivery and then refuse to pay.
An outcome may allocate all of the escrow to the seller, cancel the escrow and return all of it to the purchaser's available balance, or divide it between the seller, purchaser and other agreed recipients. This supports partial refunds and the payment of carriers, inspectors or adjudicators.
value EscrowAllocation
{
Account recipient;
Int64 amount where amount > 0;
}
value EscrowResolution
{
TimeStamp time;
String reason;
EscrowAllocation allocation*;
→ Int64 releasedAmount = allocation.amount.Σsum;
}
The released amount cannot exceed the reserved amount. CATS atomically records the one permitted resolution, consumes the reservation, and appends the outgoing transfers for its allocations. Any unallocated remainder immediately becomes available to the purchaser again. An empty allocation is a complete cancellation. Once resolved, an escrow cannot be released or cancelled again.
Completion of the purchase
An escrow resolution and a completed purchase are separate but correlated records. A
Purchase records the goods and services actually transferred. The transfers created by
the escrow resolution record payment. For an R-account purchase, those transfers provide the
monetary exchange matching Purchase.totalPrice and trigger the corresponding consumption
tax treatment.
For a registered asset, payment, ownership transfer and custody handover may occur at different times and on different authoritative nodes. Each is recorded as its own durable event. The escrow contract specifies which ownership or custody evidence permits release, while adjudication provides the authoritative outcome when an external fact is disputed.
The central invariant is that escrowed money remains the purchaser's property until release, cannot be spent while reserved, and can leave the purchaser's account only through the single outcome authorised by the escrow agreement.