Resolving Lexicons
Lexicons are actually stored as Records under the com.atproto.lexicon.schema collection. Each lexicon has the record key of the lexicon's NSID.
The repository of the lexicon (where it's stored) is determined by doing a DNS TXT lookup of the parent of the lexicon's NSID reversed to get a domain, prefixed with _lexicon.
For example, to find the lexicon for app.bsky.feed.post:
- Parent NSID:
app.bsky.feed - Reverse to domain:
feed.bsky.app - Prefix:
_lexicon.feed.bsky.app - DNS
TXTlookup:"did=..." - Resolve DID to find the PDS of the Repo.
- Fetch the lexicon record from the
com.atproto.lexicon.schemacollection in that repo using the NSID as the record key.
![]()