Skip to content

Protocol Specification

This document is for third-party protocol implementers, and for developers who need to understand the wire format, the data structures, and network behavior. If you are building an application, start with Getting Started, or begin from the Architecture Overview and the Go Packages reference.

An A2AL Address is a fixed 21 bytes:

[ version byte (1 byte) ][ hash (20 bytes) ]

The version byte encodes the key algorithm and the hash derivation method.

Version byteNameKey algorithm20-byte derivationUse
0xA0Ed25519Ed25519SHA-256(pubkey)[0:20]A2AL native identity
0xA1P256P-256 (NIST)SHA-256(pubkey)[0:20]A2AL native P-256 identity
0xA2Paralismsecp256k1RIPEMD160(SHA-256(pubkey))Paralism, Bitcoin P2PKH, Cosmos SDK
0xA3Ethereumsecp256k1Keccak-256(pubkey)[12:32]Ethereum and EVM-compatible chains
RangeStatusPolicy
0xA0–0xA7FormalRequires expert review
0xA8–0xADReservedFrozen; for a future standards process only
0xAEExperimentalNo registration; uniqueness not guaranteed
0xAFPrivateNo registration; uniqueness not guaranteed

The full assignment table and the request process are in the Address Version Registry.

  • 0xA0 (Ed25519) and 0xA1 (P256): a 42-character hexadecimal string, with case serving as a checksum computed over SHA-256;
  • 0xA2 (Paralism) and 0xA3 (Ethereum): hexadecimal with a 0x prefix.

Parsing detects the format automatically. In code, always use the string the daemon returns; do not re-case it yourself.

The DHT routing key is derived deterministically from the Address:

NodeID = SHA-256(version byte ‖ 20-byte hash) = 32 bytes

NodeID is used only for XOR-distance routing inside the DHT and is not exposed at the application layer. This separation lets the routing scheme evolve independently of the identity scheme.

Every record is CBOR-encoded and wrapped in a SignedRecord container.

FieldTypeNotes
RecTypeuint80x01 endpoint, 0x10 topic, 0x80 mailbox, 0x02–0x0f custom
Address21 bytesPublisher AID
PubkeybytesSigning public key (may be an operational key)
PayloadbytesCBOR-encoded type payload
Sequint64Monotonic sequence number
Timestampuint64Unix seconds
TTLuint32Validity window in seconds
SignaturebytesEd25519 or secp256k1 signature over the canonical fields
DelegationbytesOptional CBOR DelegationProof (carried when an operational key signs on behalf of an address derived from a master key)

Records are validated on write and on read: signature integrity, timestamp + TTL covering the current time, and signing authority — the signing key must either derive this Address directly or carry a valid delegation issued by the master key.

FieldTypeNotes
Endpoints[]stringEndpoint URLs, e.g. quic://1.2.3.4:4122, quic://[2001:db8::1]:4122
NatTypeuint80 unknown, 1 full cone, 2 restricted, 3 port-restricted, 4 symmetric
SignalstringOptional ICE trickle signaling base URL (for older peers)
Signals[]stringMultiple signaling addresses; takes precedence over Signal when non-empty
Turns[]stringDecoded from old records only; new nodes no longer write turn:// hints, and relay credentials stay local

Each record publishes several endpoint candidates. The connecting side dials all of them concurrently (Happy Eyeballs) and keeps the first to succeed.

Stored at SHA-256("topic:" + capability name) rather than at the agent’s own NodeID; the DHT aggregates multiple publishers under the same capability name.

FieldTypeNotes
NamestringHuman-readable agent name
Protocols[]stringSupported protocols, e.g. "mcp", "http", "a2a"
Tags[]stringTags used for filtering
BriefstringShort description (≤ 140 characters)
MetamapOptional extended metadata

The whole CBOR encoding of a TopicPayload is capped at 512 bytes.

An authorization statement binding an operational key to a master AID:

FieldNotes
MasterAIDThe permanent AID being delegated
OperationalPubkeyThe public key authorized to publish on behalf of MasterAID
ScopePermission scope (currently network operations)
IssuedAt / ExpiresAtValidity window (Unix seconds)
SignatureThe master key’s signature over the canonical fields above

The master key is needed only to generate the DelegationProof; afterwards a2ald holds just the operational key and the CBOR-encoded proof. Rotating credentials means re-issuing a proof, and the AID does not change.

Stored at NodeID(recipient). The outer SignedRecord.Address identifies the sender; the payload is encrypted with X25519 + HKDF + AES-256-GCM, so only a party holding the recipient’s private key can decrypt it.

A2AL uses a Kademlia-style DHT that iteratively performs FIND_NODE, FIND_VALUE, and STORE.

Record storage enforces RecordAuth: a written record must be self-signed for its own Address, or carry a valid DelegationProof issued by the master key that derives that Address.

Bootstrap nodes are public nodes used to join the network on first start. Once joined, a2ald builds its own routing table and no longer depends on them.

ConnectFromRecord dials every Endpoints entry in the target endpoint record concurrently, and the first QUIC handshake to succeed wins. Each side authenticates with a certificate derived from its Ed25519 key, so authentication happens inside mutual TLS — no CA, domain name, or certificate distribution is involved. Wildcard listeners are dual-stack by default, and IPv6 candidates are preferred when present.

When every direct attempt fails and the record carries a signaling address, both sides connect to the signaling service under a room ID derived deterministically from the two AIDs, exchange ICE candidates over WebSocket trickle, establish a point-to-point UDP path, and run QUIC on top of it. Optional external TURN can supply relay candidates at this stage; A2AL runs no relays, and credentials stay local and are never published to the DHT.

After the TLS handshake, the client sends a2r2 + the 21-byte target AID (a 4-byte magic followed by the address), then performs one short control exchange; data flows on subsequent streams. This lets several AIDs that share one QUIC listener be addressed individually. Inbound still accepts the older a2r1 (the 25-byte frame only).

The protocol handles addressing and connections only. The following belong to the daemon (a2ald) rather than the protocol: notes, chats, rooms, file objects, and access control — ACLs apply only to a given AID’s inbound HTTP and object downloads, not to the DHT, notes, or chat envelopes.

To request an unassigned version byte among 0xA4–0xA7, open a GitHub issue using the Address Version Request template, covering the name, key algorithm, 20-byte derivation, signature verification, rationale, and a representative implementation. The review criteria and the full process are in the Address Version Registry.

ForPage
Assigning and requesting version bytesAddress Version Registry
Layering and implementation structureArchitecture Overview
Contributing implementations and docsContributing