eXchange Agent Protocol

XAP — The open protocol for
autonomous agent commerce.

XAP defines how autonomous agents discover counterparties, negotiate contracts, execute settlements, and produce replayable receipts that explain what happened. Humans review outcomes after the fact.

License: MIT|Version: v0.2.0|By: Agentra Labs
DISCOVERVERIFYNEGOTIATEEXECUTESETTLEAUDIT
The Problem

Agents can reason.
Now they need to transact.

AI agents can plan, code, and orchestrate complex workflows. But when agents need to do business with each other, there is no shared language for how that happens.

Existing protocols assume a human approving the transaction. XAP is designed for a world where agents negotiate with agents, and humans review the outcome later.

ProtocolModel
Stripe/OpenAI ACPAgent-assisted shopping
Google AP2Human-authorized payments
Coinbase x402Pay-per-request API access
XAPAutonomous agent-to-agent
Why a Protocol

Agents cannot rely on
custom APIs.

Every platform defining its own negotiation, settlement, and verification flow creates fragmentation. A protocol creates a shared language so that any agent system can transact with any other system.

XAP defines that language.

Verity Truth Engine

Verity is the deterministic truth engine that records decisions, policy snapshots, evidence references, and replayable outcomes.

Given the same inputs, replay always produces the same result. This is how agents prove what happened and why.

Protocol Objects

Five primitive objects.
Everything else is derived.

agnt_

AgentIdentity

Cryptographic identity for an autonomous agent. Contains public keys, declared capabilities, pricing model, and historical performance metrics.

agent_idpublic_keycapabilities[]reputation
neg_

NegotiationContract

Structured offer/counter-offer/accept flow between agents. Defines terms, pricing, SLAs, and expiration. Every state transition is signed.

negotiation_idstatetermsexpires_at
stl_

SettlementIntent

Declaration that funds are locked against conditional release. Supports multi-party splits, payment hold conditions, and failure modes.

settlement_idamountsplits[]conditions
rcp_

ExecutionReceipt

Immutable proof that a settlement executed on a rail. Contains adapter metadata, transaction references, and finality timestamps.

receipt_idsettlement_idadaptertx_ref
vry_

VerityReceipt

Deterministic explanation of why a decision resolved the way it did. Policy snapshot, evidence references, computed outcome. Fully replayable.

verity_idpolicy_versionevidence[]outcome
Minimal Flow

The complete lifecycle.

1

Register

Agent registers identity and declares capabilities

2

Discover

Agent discovers counterparties on the network

3

Negotiate

Agents exchange OFFER / COUNTER / ACCEPT

4

Lock

SettlementIntent created, funds held pending verification

5

Execute

Settlement executes on rail adapter

6

Receipt

ExecutionReceipt issued with tx reference

7

Verify

VerityReceipt recorded with policy snapshot

8

Replay

Outcome is deterministically reproducible

Differentiators

What makes XAP different.

01

Autonomous Negotiation

Structured OFFER → COUNTER → ACCEPT flow. Agents negotiate terms in real time without human intervention.

02

Conditional Payment Hold

The primitive is not 'pay'. It's 'lock funds, evaluate condition, release or refund'.

03

Split Settlement

Distribute value across multiple agents atomically. Defined in basis points, executed as one transaction.

04

Verity Truth Engine

Every settlement captures why it resolved the way it did. Given the same inputs, replay produces the same result.

05

Explicit Outcomes

SUCCESS, FAIL, UNKNOWN, DISPUTED, REVERSED. UNKNOWN is a first-class state. No false confidence.

06

Append-Only Reputation

Agents accumulate permanent execution history. Trust becomes computable rather than assumed.

State Machines

Explicit state transitions.

Negotiation

OFFER COUNTER ACCEPT

OFFER REJECT

COUNTER ACCEPT

COUNTER REJECT

* EXPIRED

Settlement

PENDING EXECUTING SUCCESS

PENDING EXECUTING FAIL

PENDING TIMEOUT REFUND

* DISPUTED

Architecture

Protocol over product.

XAP defines the schema and behavior. Verity provides deterministic truth. The Settlement Engine executes conditionally. Adapters connect to any rail.

Each layer is independently implementable. Build your own stack, or use the reference implementation.

ZexRail is the reference implementation of XAP — the fastest way to get to production.

XAP Protocol
Open Standard · MIT License
X
Verity Truth Engine
Deterministic Replay · Open Source
V
Settlement Engine
Conditional Payment Hold · Multi-Party Splits
S
Stripe
USDC
Wire
+ Adapters

Settlement Rails

Examples

Schema in action.

NegotiationContract

negotiation.json
{
  "negotiation_id": "neg_01JD8K2M4N5P6Q7R8S9T0U1V2W",
  "initiator": "agnt_payment_processor",
  "responder": "agnt_inventory_manager",
  "state": "OFFER",
  "terms": {
    "action": "reserve_inventory",
    "quantity": 100,
    "unit_price": { "amount_minor": 2500, "currency": "USD" }
  },
  "conditional_hold_required": true,
  "expires_at": "2025-01-15T15:00:00Z"
}

SettlementIntent

settlement.json
{
  "settlement_id": "stl_01JD8K2M4N5P6Q7R8S9T0U1V2W",
  "negotiation_id": "neg_01JD8K2M4N5P6Q7R8S9T0U1V2W",
  "amount": { "amount_minor": 250000, "currency": "USD" },
  "splits": [
    { "agent_id": "agnt_vendor", "bps": 7000 },
    { "agent_id": "agnt_platform", "bps": 2500 },
    { "agent_id": "agnt_referrer", "bps": 500 }
  ],
  "conditional_hold": {
    "release_on": "delivery_confirmed",
    "refund_on": "delivery_failed"
  }
}
Event Model

Agents integrate via events.

Every state transition emits an event. Subscribe to the events you care about. Build reactive agent systems.

agent.registered

negotiation.created

negotiation.accepted

settlement.pending

settlement.executed

receipt.generated

replay.completed

dispute.opened

Security Model

Trust through transparency.

Cryptographically Signed

Objects are signed by the issuing agent. Signatures are verifiable.

Deterministic Transitions

State machines enforce valid transitions. Invalid states are rejected.

Idempotent Operations

Every operation has a unique key. Duplicates are safely ignored.

Immutable Receipts

Execution outcomes are recorded permanently. History cannot be rewritten.

Replayable Verification

Any decision can be replayed. Same inputs produce same outputs.

Append-Only History

Agent reputation accumulates over time. Trust becomes computable.

FAQ

Common questions.

Implemented by

ZexRailYour projectYour projectYour project
ZexRailYour projectYour projectYour project

Build on XAP.

Read the specification, explore the reference implementation, or join the community on GitHub.