Protocols
Overview
Native ZAP RPC, and higher-level protocols carried on the ZAP wire.
Protocols
ZAP is a wire format and capability-based RPC system. You can use it two ways:
- Natively — define your own
.zapinterfaces and let ZAP be the application protocol. This is the fastest path and the only one that gives you ZAP's full capability model (transferable, revocable references instead of bearer tokens). - As a carrier — run a higher-level protocol (HTTP, MCP, FIX, …) on top of ZAP framing. Existing semantics, zero-copy buffers underneath, mutual KEM auth at the transport.
Choices
| Protocol | Page | When to use |
|---|---|---|
| Native ZAP RPC | native | Greenfield service ↔ service, you want capabilities + min latency |
| HTTP | http | Drop-in net/http replacement, existing HTTP clients keep working |
| MCP | mcp | Agent tool-call channel, replaces stdio MCP |
| A2A | a2a | Cross-vendor agent collaboration (Google A2A spec) |
| ACP | acp | FIPA-style structured speech acts between agents |
| RNS | rns | Service discovery bound to identity, not DNS |
| FIX | fix | FIX 4.4 / 5.0 trading, sub-µs p99 |
| WS | ws | Multi-stream pubsub, per-stream FEC, no head-of-line blocking |
Why carry HTTP / MCP / FIX over ZAP at all?
If you already speak HTTP, why pipe it through ZAP? Because the carrier buys you things the higher-level protocol can't:
- Zero-copy at every hop — the payload sits in shared-memory buffers from network read to handler dispatch. No serializer step between layers.
- One auth model — mutual KEM-bound identity at the transport. The higher-level protocol inherits authentication; no per-layer JWT, no API keys, no cookies.
- One observability model — every frame is signed and content-addressed. Wireshark sees the same flow your application sees.
- One framing layer — multi-stream, FEC, no head-of-line blocking. The higher-level protocol doesn't re-invent it.
Picking the right one
| You need | Use |
|---|---|
| New internal service, full control of both ends | Native ZAP RPC |
Drop-in replacement for net/http.Handler | HTTP |
| Agent tool-call channel | MCP |
| Cross-vendor agent messaging | A2A or ACP |
| Service discovery bound to identity | RNS |
| Sub-µs trading | FIX |
| Pubsub with FEC | WS |
All Go reference implementations live under github.com/zap-proto; polyglot clients speak them via the per-language SDKs.