Add support for spaces #89
Labels
No labels
breaking-change
bug
documentation
duplicate
enhancement
good first issue
help wanted
performance
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Grandiras/ATProto.NET#89
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
https://atproto.com/blog/atproto-spaces-alpha
(this is a major effort, feel free to split into multiple issues)
🤖 On it — follow along in the action run; the reply will link the full session transcript.
📜 Live transcript — updating every ~5 minutes while the task runs.
"type": "space"Lexicon definitions #92Implemented the client side of AT Protocol's permissioned data protocol on branch
claude/issue-89.What spaces are
AT Protocol is not one protocol but several. Public broadcast publishes signed, redistributable records anyone may crawl. Permissioned data (proposal 0016) is the other half: the same shape — DID-based authority, per-user repos, Lexicon-typed records, applications crawling hosts — with an access perimeter around it, called a space. It's what bookmarks, drafts, subscriber-only posts, private forums, and group chats need.
It provides access control, not confidentiality — not end-to-end encrypted, and every service handling it can read it. That's deliberate: it's what makes server-side search, indexing, and moderation possible. It's also an alpha proposal with no security review, which
docs/spaces.mdsays plainly.What landed
I worked from the actual lexicons and reference implementation on the alpha branch, not just the blog post.
Protocol machinery (
src/ATProtoNet/Spaces/) —SpaceUri/SpaceRecordUri;LtHash(the homomorphic set hash that replaces the MST root);SpaceRepoCommit/SpaceCommitVerifier;SpaceRepoCarfor the two-root CAR;SpaceCredentialProvider/SpaceReaderfor the DPoP-bound credential exchange;SpaceSyncerfor incremental sync with automatic full-state recovery.Endpoints — all 20
com.atproto.space.*methods onclient.Space, all 8com.atproto.simplespace.*onclient.SimpleSpace, plusAtProtoScopes.Space(...)withSpaceAction/SpaceManage.Three things I'd point at specifically:
Two pre-existing bugs I had to fix
Both were prerequisites, and both are worth knowing about independently:
app.bsky.feed.postwith bothtextandcreatedAtamong them.DagCborDecoder's matching check had the same rule and would have rejected valid blocks. Verified by fetching a real post from a live PDS: length-first reproduces the network's CID, bytewise does not.htu, where RFC 9449 §4.2 requires it stripped — so every proof for an XRPC query named anhtuno conforming server would match.Verification
dotnet buildclean (zero warnings, CS1591-as-error), 1510 tests pass in Release, 212 of them new. The crypto isn't self-consistent-and-hoping — LtHash digests, commit context encoding, and the MAC are pinned against values generated by the reference implementation's own libraries; BLAKE3 against 27 official vectors (0–102400 bytes, 131 bytes of extended output each); the ordering fix against a real network CID.Also:
docs/spaces.md, updates toapi-reference/index/architecture/README/CLAUDE.md,CHANGELOG.md, and asamples/SpacesSample.What I left out
Server-side handling (acting as a space authority or repo host), lexgen support for
"type": "space", and integration tests — no PDS release serves these endpoints yet. Filed as three follow-up issues.⏱ 44m 58s · 160 turns · tokens: 405.0k in / 208.8k out (+38555.0k cache-read)
📜 Full session transcript
→ Opened PR: #90
→ Filed follow-up issue #91: Spaces: server-side support in ATProtoNet.Server (space authority and repo host)
→ Filed follow-up issue #92: atproto-lexgen does not understand
"type": "space"Lexicon definitions→ Filed follow-up issue #93: Spaces: integration tests against a permissioned-data PDS