Package-level declarations
Types
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).
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.
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.
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.
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.
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.
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.
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.