Technical documentation

Protocol: mandates, receipts, MCP and A2A

How an agent or a person gives Where in Russia a task, how the authority is checked, and how anyone can verify and replay the result. Built on published standards: Ed25519 (RFC 8032), JWK thumbprints (RFC 7638, RFC 8037), A2A 1.0 and MCP 2026-07-28.

Guarantees and limits

Endpoints

GET /.well-known/agent-card.json

A2A 1.0 agent card, signed (JWS, EdDSA).

GET /.well-known/jwks.json

Every signing key: current, retired (still valid for old receipts) and revoked.

GET /api/passports

Signed passports of the 13 agents.

POST /api/tasks/quote

Which agents will run, which are not authorised, declared rule cost and the acceptance test — before any work.

POST /api/tasks

Runs a task and returns the result with a signed receipt. Signed tasks: { task, sig }; anonymous tasks: { task }.

POST /api/tasks/replay

Re-runs a task on the current build and compares the digests with the receipt.

POST /api/receipts/verify

Checks a receipt against the published keys and the register.

GET /api/receipts/{id}

Register entry for a receipt (digests only).

POST /api/mandates/revoke

Revokes a mandate or a whole issuer key; must be signed by that key.

GET /api/snapshots

Engine builds and knowledge-snapshot digests seen in production, for later replay.

POST /mcp

MCP server, Streamable HTTP. Tools: opportunity_match, residence_routes, region_profile, ask_russia, future_twin, life_trajectories, verify_receipt, list_agents.

POST /a2a/message:send · /a2a/jsonrpc

A2A 1.0 bindings HTTP+JSON and JSON-RPC; GET /a2a/tasks/{id}.

GET /api/observatory

Aggregated real activity, with our own checks counted apart.

GET /api/transparency

Signed daily checkpoints of the receipt log (Merkle roots, RFC 6962 hashing), each naming the previous one.

GET /api/transparency/proof/{id}

Inclusion proof of one receipt: leaf, index, tree size and audit path.

GET /api/snapshots/current/{part}

The knowledge snapshot itself (facts, sources, datasets, records, routes) in canonical form: its SHA-256 equals the published part digest.

What a receipt proves, and what it does not

Key governance

Standalone verifier, no dependencies: verify.mjs — node verify.mjs receipt.json · node verify.mjs --snapshot

A signed task

{
  "task": {
    "type": "opportunity-match", "asOf": "2026-11-27",
    "mandate": {
      "profile": { "who": "k", "children": 2, "citizenship": "eu", "ties": ["roots"] },
      "regions": ["kgd"], "powers": ["property", "family"],
      "issued": "2026-11-27T10:00:00Z", "expires": "2026-12-27T10:00:00Z",
      "issuer": { "jwk": { "kty": "OKP", "crv": "Ed25519", "x": "…" } }
    },
    "accept": { "minVerified": 5 },
    "created": "2026-11-27T10:00:05Z", "nonce": "a-new-random-value"
  },
  "sig": "Ed25519 signature over canonical(task), base64url"
}

Rules: created within 5 minutes of the server clock; a mandate lives at most 90 days; each nonce is accepted once; canonical() is JSON with object keys sorted at every level and no whitespace.

Verify a receipt in eight lines

const canonical = v => Array.isArray(v) ? '[' + v.map(canonical).join(',') + ']'
  : v && typeof v === 'object' ? '{' + Object.keys(v).sort().map(k => JSON.stringify(k) + ':' + canonical(v[k])).join(',') + '}'
  : JSON.stringify(v);
const { signature, ...body } = receipt;
const jwk = (await (await fetch('https://whereinrussia.com/.well-known/jwks.json')).json()).keys.find(k => k.kid === body.signed.kid);
const key = await crypto.subtle.importKey('jwk', { kty: 'OKP', crv: 'Ed25519', x: jwk.x }, 'Ed25519', false, ['verify']);
const sig = Uint8Array.from(atob(signature.replace(/-/g, '+').replace(/_/g, '/')), c => c.charCodeAt(0));
const valid = !jwk.revoked && await crypto.subtle.verify('Ed25519', key, sig, new TextEncoder().encode(canonical(body)));

Keys

The private key is a Worker secret, created on a build server and never printed or stored in the repository. Rotation adds a new current key; every earlier public key stays in the archive as retired, so old receipts remain verifiable. A compromised key is marked revoked and every receipt signed with it fails verification.

Connect an MCP client

Listed in the official MCP Registry as com.whereinrussia/where-in-russia, so registry-aware clients find it by name.

{ "mcpServers": { "whereinrussia": { "url": "https://whereinrussia.com/mcp" } } }

Compatibility is checked automatically after every deployment with the official MCP SDKs for Python (2026-07-28 and 2025-11-25) and TypeScript, and the official A2A SDK for Python (HTTP+JSON and JSON-RPC).

Information, not legal advice. Where in Russia is an independent, non-governmental platform.