the addressing problem
to read or write a record, pdsx needs to know:- which repository contains it
- which collection within that repository
- which specific record (if applicable)
AT-URI format
AT-URIs identify records using this structure:- scheme: always
at:// - authority: DID or handle identifying the repository
- collection: NSID of the collection (optional)
- rkey: record key within collection (optional)
authority: DID vs handle
using DIDs
- permanent: never change
- decentralized: not controlled by any provider
- portable: work even if user changes PDS
- cryptographic: tied to signing keys
using handles
- human-readable: easier to type/remember
- changeable: user can update their handle
- reassignable: if abandoned, someone else can claim it
- DNS/HTTP-based: resolved via DNS or .well-known
how pdsx resolves addresses
with -r flag (handle)
- resolve handle → DID
- try DNS:
_atproto.zzstoatzz.ioTXT record - fallback to HTTPS:
https://zzstoatzz.io/.well-known/atproto-did
- try DNS:
- resolve DID → PDS URL
- fetch DID document
- extract PDS endpoint
- query PDS for records
- return results
with -r flag (DID)
- skip handle resolution (already have DID)
- resolve DID → PDS URL
- query PDS
- return results
without -r flag (authenticated)
- already authenticated with PDS
- session knows your DID
- query your own repository
- return results
shorthand URIs in pdsx
IMPORTANT: Shorthand URIs (
collection/rkey) only work when you have an active authenticated session. Without authentication, you must use full AT-URIs (at://authority/collection/rkey). If you see an “invalid URI format” error, this is likely why.full URI
shorthand (when authenticated)
- uses your DID from session
- constructs full URI
- executes operation
did document structure
dids resolve to did documents that contain:- service: which pds hosts this repository
- alsoKnownAs: current handle (for verification)
- verificationMethod: public keys (for cryptographic verification)
pds discovery
pdsx finds the pds hosting a repository:- resolve authority (handle or did) → did
- fetch did document from plc directory
- extract
serviceentry with typeAtprotoPersonalDataServer - use
serviceEndpointas pds url
—pds flag
pdsx lets you override pds discovery:- testing local pds
- using non-standard pds
- debugging
why this addressing model matters
portability
if user migrates pds:- update did document → new service endpoint
- did-based uris still work
- handle-based uris still work (if handle unchanged)
- pdsx follows did document to find new pds
federation
different users on different pds instances:- [email protected] has did:plc:alice
- [email protected] has did:plc:bob
- pdsx can read both repositories
- resolves each did → correct pds
handles as aliases
handles are just friendly names:- did is permanent identity
- handle can change
- handle can be reassigned
- did document links them
authentication and addressing
reading public records
- pdsx resolves handle → did → pds
- queries pds as anonymous client
- pds returns public records
writing to own repository
- pdsx creates session with pds (using credentials)
- pds validates credentials
- pds returns session token + your did
- pdsx uses session for subsequent requests
- pds ensures you’re writing to your own repository
cross-repository references
when creating a record that references another repository’s record:- doesn’t need auth to other-user’s repository
- just includes their uri in your record
- stores in your repository
- reference points across repositories
uri validation
pdsx performs minimal uri validation: valid formats:why understanding addressing matters for pdsx
-r flag specifies repository: can be handle or didfrom concept to command
these addressing concepts translate directly to pdsx usage: reading with handle:client.me.did from session to construct full URI