Package-level declarations

Types

Link copied to clipboard

A string type which is either a Did or a Handle. Mostly used in XRPC query parameters. It is unambiguous whether an AtIdentifier is a handle or a DID because a DID always starts with did:, and the colon character (:) is not an allowed in handles.

Link copied to clipboard
value class AtUri(val atUri: String)

The AT URI scheme (at://) makes it easy to reference individual records in a specific repository, identified by either Did or Handle. AT URIs can also be used to reference a collection within a repository, or an entire repository (aka, an identity).

Link copied to clipboard
value class Cid(val cid: String)

Links are encoded as IPFS Content Identifiers (CIDs), which have both binary and string representations. CIDs include a metadata code which indicates whether it links to a node (DAG-CBOR) or arbitrary binary data.

Link copied to clipboard
value class Did(val did: String) : AtIdentifier

The AT Protocol uses Decentralized Identifiers (DIDs) as persistent, long-term account identifiers. DID is a W3C standard, with many standardized and proposed DID method implementations.

Link copied to clipboard
value class Handle(val handle: String) : AtIdentifier

Handles are a less-permanent identifier for accounts. The mechanism for verifying the link between an account handle and an account Did relies on DNS, and possibly connections to a network host, so every handle must be a valid network hostname. Almost every valid "hostname" is also a valid handle, though there are a small number of exceptions.

Link copied to clipboard
value class Language(val tag: String)

An IETF Language Tag string, compliant with BCP 47, defined in RFC 5646 ("Tags for Identifying Languages"). This is the same standard used to identify languages in HTTP, HTML, and other web standards. The Lexicon string must validate as a "well-formed" language tag, as defined in the RFC. Clients should ignore language strings which are "well-formed" but not "valid" according to the RFC.

Link copied to clipboard
value class Nsid(val nsid: String)

Namespaced Identifiers (NSIDs) are used to reference Lexicon schemas for records, XRPC endpoints, and more. The basic structure and semantics of an NSID are a fully-qualified hostname in Reverse Domain-Name Order, followed by a simple name. The hostname part is the domain authority, and the final segment is the name.

Link copied to clipboard
value class RKey(val rkey: String)

A Record Key (sometimes shortened to rkey) is used to name and reference an individual record within the same collection of an atproto repository. It ends up as a segment in AtUris, and in the repo MST path. Record Keys are "user-controlled data" and may be arbitrarily selected by hostile accounts.

Link copied to clipboard
value class Tid(val tid: String)

Timestamp identifiers (sometimes shortened to tid) are the most common record naming scheme. The name is derived from the creation time of the record. Implementations should not rely on global uniqueness of TIDs, and should not trust TID timestamps as record creation timestamps.

Link copied to clipboard
value class Uri(val uri: String)

Flexible to any URI schema, following the generic RFC-3986 on URIs. This includes, but isn’t limited to: did, https, wss, ipfs (for Cids), dns, and of course at. Maximum length in Lexicons is 8KB.