Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

ATproto Spaces

Colibri is built on ATproto spaces. Every other page in this section assumes you know what they are, so start here. The developer docs also assume you are familiar with the AT Protocol as a concept and related terminology. For more information, see atproto.com.

An ATproto space is a shared, access-controlled view over records that live in their authors’ own repositories. A group of repositories agrees on who may read them, and that agreement is the space. A space is logical, not physical.

The data of a Colibri Space is gated at the protocol level, by the PDS that hosts the Space’s account. A reader without a credential for an ATproto space receives no records from it.

There is no relay for permissioned data, so an AppView has no firehose of Space content to subscribe to. It pulls each member’s repository from that member’s own host, presenting a credential for the space. See Sync.

A member whose PDS does not serve the com.atproto.space methods keeps their space repositories on the AppView until the PDS reports the methods exist. See Hosting.

Party Role
Authority Owns the space and decides who may read it. For a Colibri Space, this is the Space’s own DID.
Repo host Holds a member’s repository and serves their records to whoever presents a valid credential.
Reader Anything that wants to read the space. The AppView is one, and a client can be another.

A space is identified by its authority, a space type, and a key:

at://{authority}/space/{spaceType}/{skey}

The space type is an NSID naming a lexicon whose main definition is a space declaration. It lists the record collections the space may hold and carries an optional human-readable title, which is what an OAuth consent screen shows a user. Without a title, the consent screen shows the NSID.

A record inside a space needs the author as well, because record keys are unique per repository and a space aggregates many repositories:

at://{authority}/space/{spaceType}/{skey}/{author}/{collection}/{rkey}

Colibri message and reaction references carry an author DID alongside the record key. A bare key is ambiguous inside a space.

Reading a space requires a space credential issued by the authority. Obtaining one is a three-party exchange.

  1. A delegation token is minted by the reader’s own PDS with com.atproto.space.getDelegationToken. It is single use and short-lived.

  2. The token is presented to the authority with com.atproto.space.authorizeSpaceSync, along with a DPoP proof and the key the credential binds to. The authority decides here whether to issue a credential, and answers { credential, spaceRev? }.

  3. The credential is presented to each repo host in the space, with a fresh DPoP proof naming that host.

Calling authorizeSpaceSync again before the credential expires reauthorizes. A reader that keeps a copy of the space, such as the AppView, also registers for notifications in the same call. See Sync.

A repo host proves that a commit or record came from the author’s repository with a MAC. The reader asks for one with an Accept-Signature header on getLatestCommit, getRepo, listRepoOps and getRecord. The host answers with an HTTP Message Signature in the Signature-Input and Signature headers, covering a header that carries the commit or the record.

The MAC key is a secret derived from the author’s #atproto_kem key and a fresh key share the reader sends with the request. The reader derives a new secret for every request.

com.atproto.space.getDelegationToken requires full account access, which app passwords do not carry. Minting a delegation token needs either an OAuth session or a session opened with the account’s real password.

The AppView generates and stores an encrypted password for each Space account it creates, and it stores an encrypted OAuth session for a Space account that its owner connected by signing in. A client mints a delegation token through its OAuth session before it grants the AppView access to the user’s personal space with social.colibri.beta.actor.grantSpaceAccess.

An authority answers credential requests according to the space’s policy. Colibri uses two policy types.

com.atproto.memberspace.policy admits a list of members, with optional flags such as publicRead. A user’s personal space uses it with no members. The space host authorizes the owner before it consults any policy, so the owner is the only reader.

com.atproto.managedspace.policy delegates the decision to an application. Every ATproto space in a Colibri Space uses this, the profile space included, naming the AppView as managingApp. When someone asks the Space’s PDS for a credential, the PDS calls com.atproto.managedspace.checkAccess on the AppView and follows the answer. The AppView answers { read, write }.

Only members can read the profile space. The AppView reads it with the Space’s own credentials and keeps the Space’s name, description and images in its index. It serves them from there to people who haven’t joined, for example in an invitation preview, along with signed links to the images.

A ban is the AppView answering read: false when the Space’s PDS asks whether that person may read. The refusal happens at the protocol layer, before any data moves.

A Colibri Space is bound to the AppView that manages it. The Space’s record names that AppView in its managingApp field. Only the managing AppView holds the Space’s credentials and answers checkAccess for it, so every read, write, event and voice call for that Space goes through that AppView.

See Where a Space Is Hosted for what that means when you belong to Spaces on more than one.

  • Colibri Spaces: the ATproto spaces a Colibri Space is made of.
  • Sync: how the AppView keeps a copy of a space current.
  • Hosting: where space repositories live when a PDS cannot hold them.
  • Moderation: what a Space can do about a message.