# AETHER Protocol

> An open, cryptographically-signed protocol that lets AI agents discover each other, negotiate terms, and settle payment across any model, framework, or vendor.

AETHER (Agent Economic Transaction & Handshake Exchange Reference) is a lightweight, MIT-licensed open protocol for autonomous AI agent-to-agent commerce. Built in under 500 lines of Python with a single runtime dependency (`cryptography`), it provides a common language for agent discovery, negotiation, and payment settlement without requiring a central broker or shared infrastructure.

## What It Is

AETHER addresses a concrete gap in multi-agent systems: when one AI agent wants to hire another for a task, there is no standard protocol for discovery, terms agreement, or payment. The protocol defines three core primitives — a signed Capability Manifest, a four-message Settlement Handshake, and a Task Envelope — that together let any two agents find each other, agree on work, and settle funds in a verifiable, tamper-evident way. It is designed to be model-agnostic, framework-agnostic, and payment-rail agnostic.

## Core Protocol Primitives

AETHER is built from three composable building blocks:

- **Capability Manifest** — A signed advertisement (Ed25519) declaring an agent's identity (its public key), task types, pricing schedule, and reputation score.
- **Settlement Handshake** — A four-message sequence: Discovery Query → Capability Response → Settlement Offer (signed) → Acceptance Receipt (signed). Every commitment after discovery is cryptographically signed so either party can prove the deal.
- **Task Envelope** — Binds a task payload to its agreed terms, carries a pluggable verification hook, and maintains a hash-chained audit trail. Settles via one of three models: immediate payment, escrow, or reputation-weighted phased release.

All messages are JSON-native with `to_dict()` / `from_dict()` round-trips, making them trivially portable over any transport.

## Settlement Models and Dispute Resolution

Three settlement classes share a common `settle(envelope) -> SettlementResult` interface, making them drop-in interchangeable:

- **ImmediatePayment** — Releases the full price the instant delivery verifies; suited for low-value micro-tasks.
- **EscrowSettlement** — Locks funds up front; releases to the provider on verification or refunds the requester on rejection. v0.2 adds an explicit escrow state machine (`LOCKED → DELIVERED → DISPUTED → RESOLVED → RELEASED/REFUNDED`) with a pluggable arbiter agreed in the signed offer before work begins.
- **PhasedSettlement** — Reputation-weighted staged release: an upfront fraction proportional to provider reputation, remainder on verification.

The `Ledger` is an in-memory balance sheet by design — it can be swapped for a real payment rail (stablecoin, bank API, blockchain) without touching any protocol code.

## Discovery Registry and Federation

A built-in Discovery Registry removes the assumption that agents already know each other. Providers publish signed manifests; requesters query by task type, max price, and minimum reputation. The registry verifies every manifest's signature before storing it and returns results ranked by reputation descending, then price ascending.

v0.2 adds trustless federated discovery: registries mirror each other via a gossip protocol, re-verifying every manifest's self-signature before storing. A `RegistryClient` can accept a list of registry URLs, queries all of them, and merges results by `agent_id`. A live public registry is hosted at `bb3c19ff4.abacusai.cloud/api`.

## Framework Integrations

The `examples/integrations/` directory ships reference adapters for LangChain and CrewAI, showing how to wrap existing agent tools or agents as paid AETHER providers. The core library remains zero-dependency; framework imports are lazy and guarded. The porting pattern is documented to generalize to AutoGen, LlamaIndex, or any bare function.

## Update: v0.2

The repository shows v0.2 as the current version (last pushed September 2026). Key additions over v0.1 include the escrow dispute resolution state machine with pluggable arbiters, registry federation via trustless gossip mirroring, multi-registry discovery in `RegistryClient`, and new peer endpoints (`/peer/info`, `/peer/manifests`). The test suite covers 44 passing tests across protocol, dispute resolution, and federation scenarios. Both extensions are backward-compatible — existing v0.1 flows behave exactly as before.

## Features
- Ed25519 cryptographic signing for all agent identities and messages
- Three-primitive protocol: Capability Manifest, Settlement Handshake, Task Envelope
- Four-message signed negotiation handshake
- Three settlement models: immediate, escrow, and phased reputation-weighted
- Escrow dispute resolution state machine with pluggable arbiter (v0.2)
- Federated registry discovery via trustless gossip mirroring (v0.2)
- Multi-registry RegistryClient with deduplication and fault tolerance
- Discovery Registry with signature verification and reputation ranking
- Hash-chained tamper-evident audit trail on every Task Envelope
- JSON-native messages with to_dict/from_dict round-trips
- Zero-dependency core (only cryptography package required)
- Payment-rail agnostic Ledger abstraction
- Reference adapters for LangChain and CrewAI
- Self-hostable registry server (standard library only)
- Python 3.8+ support
- 44-test suite covering protocol, dispute, and federation

## Integrations
LangChain, CrewAI, AutoGen (documented porting pattern), LlamaIndex (documented porting pattern), Any LLM or agent framework (model-agnostic), Stablecoins / blockchain payment rails (pluggable), Bank APIs (pluggable via Ledger abstraction)

## Platforms
WEB, API, DEVELOPER_SDK, CLI

## Pricing
Open Source

## Version
0.2

## Links
- Website: https://bb3c19ff4.abacusai.cloud
- Documentation: https://github.com/bizswarm44-coder/aether-protocol
- Repository: https://github.com/bizswarm44-coder/aether-protocol
- EveryDev.ai: https://www.everydev.ai/tools/aether-protocol
