Code & Architecture Analysis
WIPVisualizing the three core services of an ATProto application & their relationship to DRISL (Deterministic Representation for Interoperable Structures & Links)
Consumes firehose, processes records for its app
Validates Lexicons it cares about (e.g. app.bsky.feed.post, com.germnetwork.keypackage, etc.)
🔎 Search
Full-text indexing
📊 Feeds (& Feed Generators)
Algorithmic feeds (can be independent services)
🖼 Web Tiles (MASL)
Composable web apps rendered by AppViews
DRISL decode🔍 Indexer
Decodes records, validates Lexicons, builds indexes
DRISL decodeEvents: #commit, #sync, #identity, #account ↑↓
Aggregates PDS streams into single firehose
🌊 Firehose Aggregation
Combines all PDS streams
DRISL CAR slices✅ Signature Verify
Validates commit signatures
SHA-256 CID🔄 MST Inversion
Validates ops against prev state
DRISL CIDAuthoritative host for account repositories — stores records, MST, commits as DRISL-CBOR
📝 Record Encoding
Encodes records as DRISL-CBOR
DRISL-CBOR🔐 Commit Signing
SHA-256 hash → Sign with key
SHA-256 CID🌳 MST Structure
Merkle Search Tree for records
DRISL CID links📦 CAR Export
getRepo endpoint
CAR v1📥 CAR Import
importRepo for migration
CAR v1🗃 Blob Storage
Images, videos (CID-addressed)
raw CID📏 Protocol Size Limits (Fuzzing Boundaries)
🔄 DRISL Encoding Flow (Where Differential Bugs Hide)
CRITICAL DRISL Encode/Decode
- Foundation of all data integrity
- Map key ordering (CBOR/c: lexicographic by encoded bytes)
- Duplicate keys must be rejected (CBOR/c)
- Integer encoding (minimal, 53-bit JS safe)
- Floats: DRISL allows 64-bit, ATProto rejects all
- UTF-8 string validation
CRITICAL NEW MST Inversion
- Validates #commit ops by applying in reverse
- Result must match prevData tree root
- Key depth: SHA-256, count leading zeros in 2-bit chunks
- Fanout of 4, lexicographic key sorting
CRITICAL Signature Verification
- Hash DRISL-CBOR bytes with SHA-256
- If DRISL encoding differs → hash differs
- Valid signature could verify against wrong content
- Or invalid signature could pass
CRITICAL CID Computation
- CIDv1 + dag-cbor (0x71) + SHA-256
- Must be identical across all implementations
- Blessed format: base32 string encoding
- Different CID = broken links, lost data
HIGH CAR Parsing
- Account migration depends on CAR import
- Multiple roots, block ordering
- Duplicate blocks allowed
- Dangling CID references possible
HIGH Firehose Frame Parsing
- Two DRISL-CBOR objects per frame
- Header (op, t fields) + Payload
- High volume, must handle malformed data
- Invalid framing = drop connection
MEDIUM Size Boundary Handling
- 2MB blocks field limit
- 1MB per record limit
- 200 ops per commit limit
- Edge cases at boundaries
HIGH Web Tiles (MASL)
- User-generated DASL content
- Runs in browser, needs consistent parsing
- Your Goodreads tile is a real test case!
- Cross-implementation rendering
🎯 DASLint Focus Areas
1. Differential Encoding
Compare: dag-cbrrr, libipld, atcute, go-ipld-prime, @ipld/dag-cbor
→ Current DASLint focus
2. Real ATProto Records
Seed from firehose, your tiles, production data
→ Realistic test corpus
3. MST Operations
Key depth calculation, tree structure, inversion
→ New target from audit
4. Malformed Input
Non-minimal encoding, invalid UTF-8, duplicate keys
→ DRISL rule violations
Fuzz Testing
Coming SoonComing soon.
Vulnerability Assessment
Coming SoonComing soon.