Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
ATProto Wiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Record key (rkey)
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
A '''record key''' (often abbreviated as "'''rkey'''") in the [[AT Protocol]] is a unique identifier used to reference individual [[records]] within a [[collection]] in an [[actor]]'s [[data repository]]. Record keys are an essential part of the addressing system within the protocol, appearing as segments in [[AT URI|AT URIs]] and in the repository's [[Merkle Search Tree (MST)|Merkle Search Tree]] paths. Record keys combine with other identifiers to create unique addresses for content, such as in the following AT URI:<syntaxhighlight lang="text"> at://alice.bsky.social/app.bsky.feed.post/3jzfcijpj2z2a βββββ handle ββββ βββ collection βββ ββββ rkey βββ </syntaxhighlight>This addressing system allows for direct and consistent references to specific content across the network. Keys are also used for efficient repository organization and collection-specific naming schemes. == Types of Record Keys == The AT Protocol supports several record key naming schemes, each designed for different use cases. === TID-based Keys === The most common type of record keys use [[Timestamp Identifier (TID)|Timestamp Identifiers (TIDs)]]. These keys are generated from the creation timestamp, with added randomness to prevent collisions with other records. TIDs provide natural chronological ordering while helping optimize repository storage efficiency. === Literal Keys === Literal keys are used when a collection should contain only a single record with a predefined name. These keys are specified as <code>literal:<value></code> in schemas. Literal keys create predictable, well-known locations for important and/or frequently accessed data. The most common use case of literal keys is in profile records, which are specified as <code>literal:self</code>. === NSID Keys === [[Namespaced Identifier (NSID)]] keys are used to reference [[lexicon]] schemas. === Any Keys === Any keys are the most flexible type of key, allowing any string that meets the basic syntax requirements. These keys are often used to encode meaningful information, such as domain names. Custom naming schemes allow for deterministic addressing of certain types of records. == Syntax Requirements == Regardless of type, all record keys must: * Contain only alphanumeric characters and certain symbols (<code>,-_:~</code>) * Be between 1 and 512 characters in length * Not be special values <code>.</code> or <code>..</code> * Be valid for inclusion in URI paths * Be case sensitive == Implementation Considerations == While record keys may contain encoded information (like timestamps in TIDs), applications should treat them as opaque strings rather than relying on their internal structure. This ensures compatibility as the protocol evolves and supports different key types. The uniqueness of a record is guaranteed by a combination of the repository's [[Decentralized Identifier (DID)]], the collection [[Namespaced Identifier (NSID)]], and the record key. [[Category:Identifiers]]
Summary:
Please note that all contributions to ATProto Wiki are considered to be released under the Creative Commons Attribution-ShareAlike (see
ATProto Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width