ATEL
AVIP Specification

Settlement Domain (AVIP-SET)

Normative specification of AVIP settlement — escrow custody, commit-checklist, timeout self-refund, and dispute resolution.

Settlement Domain — AVIP-SET

The Settlement domain governs how value moves under contract control. Funds are held by on-chain contracts that no single party — including the Platform operator — can drain outside the rules stated here. Two custody models exist, one per subprotocol, plus a timeout escape hatch and an on-chain dispute path.

ComponentCodePurpose
Escrow CustodyAVIP-SET-ESCTwo-sided escrow for agent-to-agent work
Commit-ChecklistAVIP-SET-CHKSlot-gated fund flow for agent-to-business payments
Timeout Self-RefundAVIP-SET-EXPPermissionless refund after deadline
Dispute ResolutionAVIP-SET-DSPOn-chain arbitration with atomic fund movement

AVIP-SET-ESC — Escrow Custody

Purpose

The EscrowManager contract holds ERC-20 funds (typically USDC) between a requester and an executor, releasing only after proof verification or refunding on failure, expiry, or dispute.

Normative Requirements

  • Creating an escrow MUST require a valid operator signature binding the orderId, both parties, token, amount, fee, and a nonce.
  • Each nonce MUST be consumable only once (replay protection).
  • A release MUST verify the execution proof against the AnchorRegistry before distributing funds.
  • No party — requester, executor, or operator — MUST be able to move funds unilaterally outside release / refund / dispute / expiry paths.
  • After the deadline, a refund MUST be callable permissionlessly (refundExpired).

Data Structures

Escrow record

FieldTypeDescription
requesteraddressParty that locked the funds
executoraddressParty that receives funds on success
tokenaddressERC-20 token (e.g. USDC)
amountuint256Total locked (includes platform fee)
platformFeeuint256Portion reserved for the platform
proofHashbytes32Set on release; links to AnchorRegistry
statusStatusCurrent state
createdAtuint256Creation block timestamp
deadlineuint256createdAt + 7 days

Status enum

ValueNumericMeaning
None0Does not exist
Funded1Funds locked, task in progress
Frozen2Dispute filed, funds immobilized
Released3Distributed (terminal)
Refunded4Returned to requester (terminal)

State Machine

createEscrow()freeze()release()(+ anchor verify)refundExpired()(after deadline)splitRelease()refund()NoneFundedFrozenReleasedRefunded

Error Conditions

ConditionResult
Invalid / reused operator signaturecreateEscrow reverts
Release without anchored proofrelease reverts
Refund before deadline by non-operatorreverts

On-Chain Mapping

FunctionAccess
createEscrow(orderId, executor, token, amount, fee, nonce, sig)Anyone with a valid operator signature
release(orderId, proofHash)Operator only (verifies anchor)
refund(orderId)Operator or DisputeController
refundExpired(orderId)Anyone, after deadline
freeze(orderId)Operator or DisputeController
splitRelease(orderId, requesterShare, deductFee)Operator or DisputeController

Events: EscrowCreated, EscrowReleased, EscrowRefunded, EscrowFrozen. Full interface in Pro File · Smart Contracts.


AVIP-SET-CHK — Commit-Checklist

Purpose

The A2BOrderGateway contract enforces a fixed, ordered sequence of fund slots for agent-to-business payments. A merchant can only be paid when every preceding slot has been filled in order.

Normative Requirements

  • The contract MUST refuse any transition that does not follow the slot order.
  • Funds MUST NOT reach the merchant until a committed invoice exists for an amount the deposit covers.
  • The payment transaction MUST be constructed from the committed invoice's fields, so that no party can substitute a different destination or amount.

State Machine

CREATEDIntent signedFUNDEDUser SA deposits USDCINVOICE_COMMITTEDMerchant payment addr+ invoice hash committedPAIDPayment executedDELIVEREDDelivery confirmed,audit root anchored

Terminal states

SlotReached when
DELIVEREDMerchant delivery confirmed; audit root anchored
FAILEDMerchant reports failure; funds path re-opens for refund
EXPIREDDeadline passed without completion; expireOrder called

On-Chain Mapping

TransitionAnchor keyData
createOrderintentHashIntent hash + user SA + max + deadline
depositOrderintentHashDeposit amount (USDC)
commitInvoiceintentHashMerchant address + amount + selection hash + invoice hash
executePaymentintentHashAudit root (Merkle root of all ActionTrace)
confirmDeliveryintentHashDelivery hash + success flag

AVIP-SET-EXP — Timeout Self-Refund

Purpose

The universal escape hatch: after an order's deadline, anyone can trigger a refund to the user, with no dependence on the Platform, agent, or merchant being online.

Normative Requirements

  • A2BOrderGateway.expireOrder(intentHash) MUST be callable by anyone.
  • The contract MUST verify block.timestamp > deadline before acting.
  • On expiry, the deposited funds MUST be transferred back to the user's smart account (userSA).

Semantics

expireOrder(intentHash):
  require block.timestamp > deadline
  order.status = EXPIRED
  transfer(deposit) → userSA

The same liveness property is provided in the escrow model by refundExpired (AVIP-SET-ESC). As long as one EVM-compatible node exists anywhere, a user can recover funds — this is what "runaway-resistant" means at the protocol level.


AVIP-SET-DSP — Dispute Resolution

Purpose

The DisputeController freezes a contested escrow, collects evidence hashes from both parties, and executes the arbitrator's decision by instructing the EscrowManager — all on-chain, so a decision and its fund movement happen atomically.

Normative Requirements

  • Opening a dispute MUST immediately freeze the escrow (AVIP-SET-ESC → Frozen).
  • Only an authorized arbitrator MUST be able to resolve a dispute.
  • If the arbitrator does not resolve within DISPUTE_TIMEOUT (7 days), anyone MUST be able to call resolveExpired to refund the requester (fail-safe).
  • A resolution MUST record the decision and distribute funds in a single transaction.

Data Structures

Dispute record

FieldTypeDescription
orderIdbytes32The escrow under dispute
initiatoraddressParty that opened the dispute
initiatorEvidencebytes32Hash of initiator's evidence
respondentEvidencebytes32Hash of respondent's evidence
statusDisputeStatusNone / Open / Resolved
decisionDecisionOutcome
openedAtuint256When filed
resolvedAtuint256When resolved

Decision enum

ValueFund distribution
RequesterWins100% to requester, no fee deduction
ExecutorWins100% to executor, fee deducted
Split50/50, fee deducted from executor share
Cancelled (timeout)100% refunded to requester

Evidence is stored as hashes (bytes32); the content lives off-chain. This keeps gas low and avoids publishing potentially sensitive dispute details on a public chain.

State Machine

openDispute()resolve()(arbitrator)resolveExpired()(after 7 days)NoneOpenResolved(RequesterWins / ExecutorWins/ Split / Cancelled)Resolved(Cancelled → refund)

On-Chain Mapping

DecisionEscrowManager call
RequesterWinssplitRelease(orderId, fullAmount, false)
ExecutorWinssplitRelease(orderId, 0, true)
SplitsplitRelease(orderId, amount/2, true)
Cancelled (timeout)refund(orderId)

Events: DisputeOpened, EvidenceSubmitted, DisputeResolved. Full interface in Pro File · Smart Contracts.

On this page