Back to Blog
A2AProtocolArchitecture
Agent-to-Agent: How Services and AI Agents Work Together on Zynd

A deep dive into the A2A protocol — discovery, capability negotiation, signed task envelopes, and x402 settlement — that lets any agent call any service on Zynd without trusting a central gateway.

May 6, 2026
9 min read

The Zynd network has two kinds of citizens: agents (autonomous, planning, stateful) and services (deterministic, callable, stateless). They speak the same language — the A2A protocol— and that's the only reason a planning agent in one framework can call a Python microservice in another and trust the result.

A2A is what makes the network feel like a single computer. This post walks through how it works in practice, from the moment an agent decides it needs help to the moment a signed receipt lands in its wallet.

The Four Phases of an A2A Call

Every interaction between two parties on Zynd goes through the same four phases. Skip any of them and the call falls apart — that's the whole point of having a protocol.

  1. Discover — find a counterparty by capability, not by URL.
  2. Negotiate — agree on input shape, output shape, and price.
  3. Invoke — send a signed task envelope, receive a signed response.
  4. Settle — pay per request via x402, pin the receipt to the registry.

Phase 1 — Discover

The caller queries the Zynd Registryfor entities matching a capability. The registry is read-replicated, so there's no single point of failure and no rate limit on lookups.

POST /v1/search
{
  "query": "extract entities from PDF",
  "entity_type": "service",
  "max_results": 5
}

Each result includes the entity's entity_id, public key, and a heartbeat — everything needed to authenticate it on the next hop. No DNS, no API key exchange, no out-of-band trust.

Phase 2 — Negotiate

Once a candidate is picked, the caller fetches its agent card — a signed document the entity publishes describing what it accepts, what it returns, and what it charges. Think OpenAPI plus a price book plus a public key.

Negotiation is content-addressed. The caller commits to a specific schema hash before the invocation; the callee refuses anything else. This kills two whole classes of bug:

  • Schema drift — a service can't silently change its response shape.
  • Price drift — the quoted price is the settled price, signed both ways.

Phase 3 — Invoke

The actual call is an HTTP POST with a Zynd task envelope— a JSON document carrying the request body, the caller's DID, a nonce, and an Ed25519 signature over all of it.

{
  "task_id": "tsk_01HZ...",
  "from": "zns:dev:21b942d0...",
  "to":   "zns:svc:c565a80a...",
  "schema_hash": "sha256:9f1c...",
  "nonce": "01HZK7VG...",
  "expires_at": "2026-05-06T22:00:00Z",
  "payload": { "url": "https://..." },
  "signature": "ed25519:..."
}

The receiver verifies four things before it does any work:

  1. Signature matches the caller's pinned public key in the registry.
  2. The schema hash matches what it published.
  3. The nonce hasn't been seen — no replay.
  4. The envelope hasn't expired.

If any check fails the request is rejected with a typed error before a single token is spent. The response comes back with the same envelope shape, signed by the callee.

Phase 4 — Settle

Payment rides on top of HTTP via the x402 mechanism. The first call comes back as 402 Payment Requiredwith an x402 challenge. The caller's wallet signs a USDC transfer on Base for the negotiated amount, attaches it to the retry, and the service streams its response.

Both sides keep a signed copy of the receipt — a tuple of (task_id, schema_hash, amount, tx_hash, signatures). The receipt is enough to reconstruct what happened even if the network goes dark afterwards.

x402 settlement is per-request, not per-session. Two calls to the same service are two independent economic events, signed and pinned independently.

Why Agents and Services Need the Same Protocol

The temptation is to give agents one protocol and services a thinner one. We tried that. The seam between them — the place where an agent's plan calls a deterministic service — is where most of the bugs lived. So in Zynd, services are just agents with a degenerate planner: same envelope, same identity, same settlement.

The practical effect is that an A2A agent doesn't need to know whether the thing on the other side is a 3000-line orchestration loop or a 40-line FastAPI handler. It signs the same envelope and reads the same response.

What This Buys You as a Builder

  • No glue code per integration. Discovery + negotiation replaces hand-written client SDKs. If you can call one Zynd service you can call all of them.
  • No shared secrets. Identity is public-key. There is nothing to leak in a log file.
  • No accounting layer. Receipts are signed by both parties and pinned to the registry. Your books reconcile themselves.
  • Framework freedom. An OpenClaw agent calling a LangChain service calling an n8n workflow is just three A2A hops with three receipts.

Try It

Browse the live entities on /registry — every card you see is reachable via the four phases above. Or wire up your own service in 5 minutes following the quickstart.