# design: associations on ident.link, level N - status: decided 2026-11-10 (owner + lead, see [Decisions](#decisions)); implementing - spec: https://ident.link (draft, 2026-10-22); lexicon `link.ident.endorsement` (github.com/bluesky-social/ident.link `74d22dc`; not ours: read only) - replaces: kcp operator claim, association mirror, `parent` chains ([../protocol/identity.md](../protocol/identity.md#associations-plan-0036)); atirc `agentOperator`/`agents` owner graph and peer `lease`; atlibs `associate`, mesh-agent lease - rule: no backcompat. one cut-over, old records deleted, old code removed ## The Pair (ident.link, as specified) | side | where | what | |---|---|---| | agent declares | agent DID doc `alsoKnownAs` | `https://ident.link/agent-of/`, one per principal | | principal confirms | principal repo `link.ident.endorsement`, rkey = agent DID | `{"$type":"link.ident.endorsement","agent":""}` | | revoke | either side alone | principal deletes the endorsement, or agent drops the entry | ```json {"id":"did:plc:4vcig7s43z3nyqrnepmcfzqt","alsoKnownAs":["https://ident.link/agent-of/did:plc:ocnuqjlzgohypj3zoznermms"]} ``` ```sh goat get at://did:plc:ocnuqjlzgohypj3zoznermms/link.ident.endorsement/did:plc:4vcig7s43z3nyqrnepmcfzqt # {"$type":"link.ident.endorsement","agent":"did:plc:4vcig7s43z3nyqrnepmcfzqt"} ``` - the pair says who is responsible (spec: informational, SHOULD NOT authorize) - our authorization is a second record, the grant, beside the endorsement ## Grant (ours) - NSID `com.publicdomainrelay.temp.market.association` (same name, new shape), principal repo, rkey = agent DID - pair without grant: attribution only, never trusted. grant without pair: nothing - no role: an agent of P is P's agent as requester, bidder, atirc peer, sub-agent - no `parent`: chains come from DID docs | field | req | meaning | |---|---|---| | `agent` | yes | agent DID, == rkey | | `expiresAt` | with `contract` | dead after it | | `contract` | no | strongRef of the principal's `market.accept`; dead once the contract is not Held | | `createdAt` | yes | | ```json {"$type":"com.publicdomainrelay.temp.market.association","agent":"did:plc:4vcig7s43z3nyqrnepmcfzqt","createdAt":"2026-11-11T00:00:00Z"} ``` ```json {"$type":"com.publicdomainrelay.temp.market.association","agent":"did:plc:r2guestaaaaaaaaaaaaaaaaa","contract":{"uri":"at://did:plc:lpfuqerea3deuoyrn7ojser4/com.publicdomainrelay.temp.market.accept/3m5abc","cid":"bafyrei..."},"expiresAt":"2026-11-11T01:00:00Z","createdAt":"2026-11-11T00:00:00Z"} ``` | kind | `contract` | `expiresAt` | ends at | |---|---|---|---| | standing (bidder hosts, owner agents) | - | - | delete | | timed | - | yes | expiresAt or delete | | contract-scoped (R2, VM accounts) | yes | yes, contract deadline | expiresAt, contract not Held, delete, agent DID tombstone | - write: grant, then endorsement. delete: endorsement, then grant. a crash in between leaves something untrusted, never something wider - absent grant = untrusted (not standing): deleting the grant never widens trust ## Level N - edge `A -> P` holds iff: P in A's agent-of entries, `P/link.ident.endorsement/A` has `agent == A`, `P/market.association/A` live - ancestors(A): DIDs reachable by held edges. roots(A): ancestors with no held edge up (A itself if none) - lifetime(A): min `expiresAt` along the path. contract Held per edge, every principal above it an authority (`scopeHeld` today) ```mermaid flowchart BT SA["sub-requester (VM localPDS did:plc)"] --> R2["guest requester R2 (VM localPDS did:plc)"] R2 --> AL["alice, root"] VA["VM atirc agent (VM localPDS did:plc)"] --> R2 BH["bidder host hat-9 (did:plc, own PDS)"] --> BOB["bob, root"] CA["own-DID atirc agent"] --> JO["john, root"] ``` ### Walk (same in Go and Rust) ``` walk(A): queue=[(A, d=0, path=[A], exp=inf)]; seen={A}; lookups=0 pop (X, d, path, exp) doc = resolveDid(X) # 404, tombstoned: no principals for P in dedupe(agentOf(doc)): P in path -> skip # cycle d+1 > maxDepth -> truncated (lookups += 2) > budget -> truncated E, G = getRecord(P, link.ident.endorsement, X), getRecord(P, market.association, X) # parallel, sync.getRecord, CAR verified E.agent == X && G.agent == X && live(G) -> edge X->P, exp' = min(exp, G.expiresAt) P not in seen -> push (P, d+1, path+[P], exp') ``` | limit | value | note | |---|---|---| | maxDepth | 100 (`trust.MaxChainDepth`, kept) | round-5 decision; atirc server's 8 raised to it | | lookup budget | 256 getRecords per walk | caps multi-principal fan-out | | truncated branch | not a root, not trusted | fail closed | | cycle | edge skipped; an all-cycle group has no root: untrusted | atirc refuses today; same result | | DID unresolvable, PDS down | edge unconfirmed (spec) | fail closed, logged | ### Cache, re-verify | item | ok TTL | error TTL | |---|---|---| | DID doc | 5 min | 5 s | | edge verdict (kcp `defaultTrustCacheTTL`) | 5 min, capped at grant `expiresAt` | 5 s | | atirc owner graph, mesh | 10 s (bounded), mesh re-check every 3 s | 2 s | | firehose delete of endorsement/grant, `#identity` event | drops that DID's cached edges (`ApplyEvent`, atirc invalidate) | | | kcp MarketIdentity: association watch records change, or not Associated | `ApplyEvent()` before the walk; AwaitingApproval re-walks every 1 min (an agent-of PLC op sends no event) | | ### Trusted for X | check | rule | today | |---|---|---| | `OperatorOf(X)` (policy snapshot) | roots(X) | `parent` chain root | | tangled-vouch | some V in {self}+ancestors(self) vouches some S in {cp}+ancestors(cp), or the sets meet | depth 1 | | same owner (networked deno to own bidder; app "mine") | roots(requester) meets roots(bidder) | operator equal | | atirc owner graph, mesh admission of owner O | O == X or O in ancestors(X) | `agentOperator` + `agents` | | bidder guest lifetime cap | lifetime(requester) | `proofExpiry` (second walker, removed) | | atirc mint exp | min(24 h, lifetime(subject)) | clamp to association `expiresAt` | | requireContract verifiers | every edge to the root contract-scoped | same | - vouch pairs come out of the same budget, nearest first (BFS order) - no delegation flag: any agent may have agents; theirs is bounded by its lifetime and contracts ## Q1: Agents Without A DID - decided: every agent gets a did:plc on the VM's localPDS (atirc VM agents, sub-requesters, co-located accounts). no DID-less agents, no did:web - the VM runs the guest requester R2 (own did:plc + localPDS, plan 0036). an agent is a co-located account on that PDS; a VM with `--agent` starts R2 identity-only (no RFP) when nothing else asked for one - genesis op (one per account): `rotationKeys` = [renter rotation key, VM localPDS key], `alsoKnownAs` = [`at://`, `https://ident.link/agent-of/`] - principal: R2 for its co-located accounts and VM agents (R2 writes the endorsement + grant in its own repo); the renter for R2 (after the nonce check) - the renter's rotation key reaches the VM as a public did:key in the secrets bundle (`identity.rotationKey`); its private half never leaves the renter (Go: the requester component's `/components/Requester-requester/plc-rotation.key`, k256, 0600, made on first use, a copy of the local PDS's `plc-rotation.key` when there is one; pkg/embedded: the same path under `Config.StateDir`; atlibs: the host's sealed did:key) - release: principal deletes endorsement + grant, tombstone (localPDS key; the renter's key when the VM is gone: after deleting its grant the renter waits up to 2 m, none after vm.terminated, then tombstones R2 and the DIDs R2 listed in `associationRequest.accounts` whose head op says the right agent-of and holds its key; best effort). nothing ran: grant expiry + contract Held + bidder cap end trust - cost per agent: 2 PLC ops (genesis, tombstone; permanent public log), 4 record ops, localPDS share; VM RAM/boot: [measured](#vm-cost) (2026-11-11: every agent and R2 DID of 0004 / 0005 had exactly 2 ops in its PLC log, the last `plc_tombstone`) Genesis (agent co-located with R2): ```json {"type":"plc_operation","rotationKeys":["did:key:zQ3sh...renter","did:key:zQ3sh...vmLocalPds"],"verificationMethods":{"atproto":"did:key:zQ3sh...agentSigning"},"alsoKnownAs":["at://agent-3m5abc.r2-3m5abc.","https://ident.link/agent-of/did:plc:r2guestaaaaaaaaaaaaaaaaa"],"services":{"atproto_pds":{"type":"AtprotoPersonalDataServer","endpoint":"https://did-key-.xrpc.fedproxy.com"}},"prev":null,"sig":"..."} ``` Peer record, in the agent's own repo (rkey = subhandle), no `lease`: the repo DID is walked. ```json {"$type":"computer.socialweb.peer","iroh":"","channels":["#johnandersen777_bsky_social"],"createdAt":"2026-11-11T00:00:00Z"} ``` - mesh accept: owner O == repo DID or O in ancestors(repo DID); peer lifetime = lifetime(repo DID) - handles: R2 is `