qTe Docs — AT Protocol Network
AT Protocol Network
Decentralized identity, storage, contacts, messaging, and file sharing over AT Protocol
Network Overview
qTe uses the AT Protocol (atproto) — the same decentralized protocol behind Bluesky — for all
networking. There is no central server or database. Your data lives in your own Personal Data Server (PDS)
using private custom lexicon collections that are invisible to the public Bluesky feed.
AT Protocol Client
ATProtocolClient handles all XRPC communication with the PDS. It manages authentication sessions,
CRUD operations on records, and blob uploads.
Authentication Flow
- User provides handle (e.g.,
user.bsky.social) and app password
- Client calls
com.atproto.server.createSession on the PDS
- PDS returns
ATSession with access JWT, refresh JWT, DID, and handle
- All subsequent requests use the access JWT for authorization
- Token refresh happens automatically when the access JWT expires
Key Properties
| Property | Description |
IsAuthenticated | Whether a valid session exists |
Did | The user's Decentralized Identifier |
Handle | The user's AT Protocol handle |
PdsHost | PDS server URL (default: https://bsky.social) |
Custom Lexicons
qTe defines private custom lexicon collections for organized data storage. These follow AT Protocol
naming conventions but are not indexed by Bluesky's feed generators.
Storage Collections (Private)
| Lexicon | Purpose |
app.qte.storage.offset | Encoded offset data (binary blobs) |
app.qte.storage.metadata | SymphMetadata JSON records |
app.qte.storage.blockchain | Blockchain entries |
app.qte.storage.binaryblob | Large binary data chunks |
app.qte.storage.contacts | Contact/address book data |
app.qte.storage.collections | Collection definitions |
app.qte.storage.messages | Conversation messages |
app.qte.storage.meme.thumbnail | Meme thumbnails (64×64 JPEG blobs) |
app.qte.storage.meme.image | Compressed meme images (640×640 max) |
Network Collections (Shared)
| Lexicon | Purpose |
app.qte.share.file | File share records sent to contacts |
app.qte.share.password | Password shares for protected files |
app.qte.message.direct | Direct messages between contacts |
app.qte.contact | Contact records |
app.qte.contact.request | Contact request invitations |
app.qte.collection | Public collection records (lexicon) |
app.qte.syndication | Syndication feed entries |
AtProtoStorageManager
AtProtoStorageManager is a singleton that manages AT Protocol remote storage for all qTe data.
It handles uploading offsets, metadata, and binary data as blobs, and downloading them during sync.
Blob limit: AT Protocol allows blobs up to 1MB. qTe uses 900KB as a safe limit.
Files larger than 900KB are split into multiple blob records.
Key Operations
- Upload offset: Reads
.qTe file, uploads as blob to app.qte.storage.offset
- Upload metadata: Serializes SymphMetadata to JSON, stores in
app.qte.storage.metadata
- Download offset: Retrieves blob from PDS, writes to local
qte_offsets folder
- Record cache: Maintains in-memory cache of stored record info to avoid redundant uploads
QteNetworkManager
QteNetworkManager is the high-level singleton that orchestrates all network operations:
connection management, contact management, file sharing, messaging, and syndication.
Events
| Event | Raised When |
FeedUpdated | Syndication feed is refreshed |
MessageReceived | New direct message arrives |
FileShareReceived | A contact shares a file |
ConnectionStatusChanged | Connect/disconnect state changes |
Contacts are managed by the AddressBook singleton and stored in the qte_network
folder as JSON. Each contact has a DID, handle, display name, and trust level.
Contact Workflow
- Send request: Write a
app.qte.contact.request record to the contact's repo
- Accept request: Recipient writes a
app.qte.contact record back
- Sync contacts: Pull contacts from AT Proto, merge with local address book
- File sharing: Only allowed between accepted contacts
Messaging & Conversations
ConversationManager handles all messaging. Messages are stored locally in the
qte_conversations folder and synced to AT Proto via app.qte.message.direct.
Message Types
- Text messages: Plain text direct messages between contacts
- File share messages: Includes a Symph reference to shared encoded data
- Password share messages: Securely shares a decoding password for protected files
Sync Workflow
Syncing Rule: Push metadata to AT Proto should ONLY happen during initial encoding or
explicit "sync from local" action. Never push during regular pull sync. Never modify or remove
existing remote records during sync.