Goal: a third-party Core implementation that interoperates with the reference stack — identity, envelopes, relay client behavior, pairing/bonding, and encrypted messaging — proven by byte-matching the published golden vectors.
Negotiation (nego/1) and acceptance testing (atest/1) are separate profiles.
You can ship useful apps on Core alone.
- Your code consumes the JSON fixtures under
packages/protocol/fixtures/and produces the expected outputs bit-for-bit (where the fixture defines them). - Your receiver rejects the negative envelope cases with the expected error codes and step order.
- Optionally: you can pair and exchange
core.msgwithagentpairover a shared relay (public test or local Compose).
Normative detail: SPEC.md (Core chapters). Checklist mapping MUST → tests: conformance-checklist.md.
| Resource | Use |
|---|---|
packages/protocol/fixtures/README.md |
Fixture contract, harness fields, regenerate/verify commands |
| Fixture JSON files | Inputs + expected outputs |
@agentpair/protocol on npm |
Reference implementation (read behavior; do not copy blindly into your license surface) |
| Public relay | https://relay.yagura.space for live experiments |
Spec status is 1.0-draft — expect wire changes until freeze.
- Strict base64url (reject padding, non-alphabet, non-canonical) →
base64url.json - Ed25519 identity:
agent_id = "ed25519:" + base64url(pk)→keys.json - Sign / verify over exact transmitted bytes
- X25519 from Ed25519 keys, HKDF-SHA-256 with info
agentpair-envelope-v1, XChaCha20-Poly1305 →payload-encryption.json - Production must use a fresh random nonce per envelope; fixtures may ship
testOnlyNonceHexonly for reproducibility
- Wire version
v: 1, max 65536 UTF-8 bytes - Sign-the-blob outer format →
envelope-core-msg.json - Ordered receive pipeline + errors →
envelope-negative.json(version checks before signature verify; see fixture README forenvelope_too_largegenerative case)
- Pairing fingerprint and
bond_oktag vectors:pair-confirm-fingerprint.json,pair-confirm-fingerprint-v2.json,pair-bond-ok-tag.json - Implement SPAKE2 + relay pairing routes against SPEC; vectors lock the fingerprint/tag bytes your stack must match
- Spillover encrypt + ref →
artifact-spillover.json
- Run or use a relay (
docker composeorhttps://relay.yagura.space) - Pair your Core client with reference
agentpair(or two of your hosts) core.msground-trip; confirm allowlist default-deny
pnpm --filter @agentpair/protocol run verify-fixtures
pnpm --filter @agentpair/protocol run generate-fixtures # maintainers onlyCI fails when committed JSON drifts from the generator without review.
When driving a receiver from fixtures, honor the harness block:
nowUnix— injected clockisBonded— defaulttruelastAcceptedSeq— default0self— receiving agent (alice/bob)dispatchError— optional forced dispatch error
- Full
nego/1session machine (open → turn → sign → ratify) atest/1runners- MCP binding (stdio tools) — that is one binding, not the protocol
When Core is green, add Negotiation using SPEC and the reference session state
machine in packages/protocol/src/session/.