pds-message-poc#
interactive PoC of PDS-to-PDS message passing using docket.
demonstrates jacob.gold's proposal: PDSes have incoming message queues for DMs, like email servers.
run#
uvx --from git+ssh://git@tangled.org/zzstoatzz.io/pds-message-poc pds-message-poc
or locally:
just demo
- type a message
- select sender/recipient
- click Send → watch service auth token created, message queued, recipient decides
- click Block → alice blocks selected sender
- click Spam Label → labeler marks selected sender as spam (rejected by all)
press q to quit.
what's happening#
┌─────────────────┐ ┌─────────────────┐
│ Bob's PDS │ │ Alice's PDS │
├─────────────────┤ ├─────────────────┤
│ │ 1. getServiceAuth(aud=alice)│ │
│ send_message() │ ────────────────────────────>│ │
│ │ 2. JWT: iss=bob aud=alice │ inbox queue │
│ │ <────────────────────────────│ (docket) │
│ │ │ │
│ │ 3. POST /inbox + JWT │ │
│ │ ────────────────────────────>│ worker checks: │
│ │ │ - token valid? │
│ │ │ - spam label? │
│ │ │ - blocked? │
│ │ │ - rate limit? │
│ │ 4. {status: accepted} │ │
│ │ <────────────────────────────│ → accept/reject│
└─────────────────┘ └─────────────────┘
│
▼
┌───────────────┐
│ Labeler │
│ (reputation) │
│ spam labels │
└───────────────┘
what's demonstrated#
| feature | implementation | ATProto pattern |
|---|---|---|
| inbox queue | docket (redis streams) | proposed dev.pds.inbox.sendMessage endpoint |
| service auth | JWT with iss/aud/exp/lxm | com.atproto.server.getServiceAuth |
| reputation | labeler with spam labels | com.atproto.label |
| block list | per-user set | existing pattern |
| rate limiting | per-sender, time-windowed | existing pattern |
what's mocked#
| component | current | path to real |
|---|---|---|
| DIDs | fake strings | PLC resolution |
| queue backend | docket memory:// |
docket redis:// |
| JWT signing | sha256 hash | DID signing keys |
| labeler | in-memory dict | ozone |