Wire Protocol Docs

Overview

Wire Protocol is a permissionless settlement rail for machine-to-machine commerce. Autonomous AI agents discover, negotiate, and pay for API services in real time — without accounts, API keys, or subscriptions.

Built on HTTP 402 Payment Required semantics, extended with Swarm Memory: buy once, and the whole swarm knows.

Core Concepts

402 Settlement Model

Vendors respond to requests with HTTP 402 containing price, token, and relay parameters. The consumer signs a voucher and retries. No prior arrangement needed.

1. consumer ───────── request ─────────▶ vendor
2. consumer ◀── 402 Payment Required ─── vendor
            { price, swarm_price, token, recipient, relay, nonce, expiry }
3. consumer → signs an off-chain voucher  (monotonic nonce + accrued total)
4. consumer ── retry + payment proof ───▶ vendor
5. consumer ◀──── result + receipt ────── vendor
6. (background) ── settle relay on Solana: thousands of calls, one tx

Payment Relays

Off-chain voucher channels. An agent deposits once and issues signed nonce-incremented vouchers per call. Thousands of micro-payments settle in a single Solana transaction.

Swarm Memory

When one agent in a swarm purchases a result, it's cryptographically cached and available to every agent in the same swarm at zero additional cost. The owner pays once.

  • 99.6% cost reduction for homogeneous swarms
  • Cryptographically scoped — outsiders can't free-ride
  • Configurable TTL — 0s for real-time, 24h for daily data

Vendor Bonding

Vendors bond $WIRE tokens for reputation. If they accept payment but fail to deliver, the bond is slashable via on-chain dispute resolution.

Quickstart

git clone https://github.com/Wire-Protocol/wire-node.git
cd wire-node
npm install

npm run start:dev      # watch mode → http://localhost:4000

API Reference

REST is prefixed with /api; the live stream is socket.io.

MethodEndpointDescription
GET/api/network/statsLive network metrics (tps, volume, cache-hit rate)
GET/api/network/events?limit=Recent settlement feed
GET/api/network/vendorsVendor registry
GET/api/network/agents?limit=Most active agents
GET/api/network/swarmsSwarms + accrued savings
GET/api/network/relays?limit=Open payment relays
GET/api/network/token$WIRE supply / market snapshot
GET/api/network/overviewEverything in one call
WSsocket.ioSnapshot on connect, then live event + stats pushes

Token ($WIRE)

  • Protocol fees: 10bps of settled volume, collected in $WIRE
  • Burn: 40% of fees burned permanently
  • Bonding: Vendors and swarms bond $WIRE for reputation / anti-sybil
  • Governance: $WIRE holders vote on protocol parameters

Links