OverviewFilesCommitsIssuesDocsReleasesPeers

wirecore commits / 84a315d

Add wiredove topic-based architecture research.
Documents dual-transport architecture (WebSocket + Trystero), proposes hashtag-based topic rooms, includes draft question for evbogue, and summarizes recent wiredove/apds updates. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
84a315d18de0dfd4aea749d5cf4851c352a28d17
by plankatron <fleeky@gmail.com> · 2026-01-31T03:49:40.000Z

Changed files (1) +214 -0

docs/WIREDOVE_TOPICS_RESEARCH.md +214 -0
……@@ -0,0 +1,214 @@
1# Wiredove Topic-Based Architecture Research
2
3**Date:** 2026-01-30
4**Status:** Proposal / Research
5
6## Overview
7
8Analysis of wiredove's dual-transport architecture and proposal for hashtag-based topic rooms.
9
10## Current Architecture
11
12Wiredove uses a **dual-transport** message system:
13
14```
15 ┌─────────────────────┐
16 │ network_queue.js │
17 │ (central router) │
18 └─────────┬───────────┘
19 │
20 ┌───────────────┴───────────────┐
21 │ │
22 ▼ ▼
23 ┌─────────────────┐ ┌─────────────────┐
24 │ WebSocket │ │ Trystero │
25 │ (websocket.js) │ │ (gossip.js) │
26 └────────┬────────┘ └────────┬────────┘
27 │ │
28 ▼ ▼
29 ┌─────────────────┐ ┌─────────────────┐
30 │ pub.wiredove.net│ │ WebRTC Rooms │
31 │ (relay/archive)│ │ (P2P discovery) │
32 └─────────────────┘ └─────────────────┘
33```
34
35### Transport 1: WebSocket (Relay)
36
37- **File:** `websocket.js`
38- **Endpoint:** `wss://pub.wiredove.net/`
39- **Purpose:** Centralized relay and archive
40- **Behavior:** Stores everything, always online, no topic filtering
41
42### Transport 2: Trystero (P2P Gossip)
43
44- **File:** `gossip.js`
45- **Room:** `makeRoom('wiredovev1')` - single global room
46- **Purpose:** Direct browser-to-browser gossip via WebRTC
47- **Behavior:** Only reaches online peers in the same room
48
49### Message Queue
50
51- **File:** `network_queue.js`
52- **Behavior:** Routes messages to BOTH transports simultaneously
53- Handles retries, deduplication, cooldowns
54
55## Key Code References
56
57### connect.js (startup)
58```javascript
59export const connect = async () => {
60 makeWs('wss://pub.wiredove.net/') // WebSocket relay
61 await startHttpGossip('https://pub.wiredove.net') // HTTP fallback
62 makeRoom('wiredovev1') // P2P room (single global)
63 send('evSFOKnXaF9ZWSsff8bVfXP6+XnGZUj8XNp6bca590k=') // Hardcoded follow
64}
65```
66
67### gossip.js (P2P rooms)
68```javascript
69const room = joinRoom({appId: 'wiredovetestnet', password: 'iajwoiejfoiwajfe'}, pubkey)
70```
71
72### network_queue.js (dual send)
73```javascript
74// Lines 101-108: Send to both transports
75if (wsReady) {
76 sendToTarget('ws', item.msg)
77 item.sent.ws = true
78}
79if (gossipReady) {
80 sendToTarget('gossip', item.msg)
81 item.sent.gossip = true
82}
83```
84
85## Proposal: Hashtag-Based Topic Rooms
86
87### Current Model: Follow-based
88
89- Follow pubkeys (people)
90- Join P2P room keyed by pubkey
91- Receive ALL posts from followed users
92
93### Proposed Addition: Topic-based
94
95- Subscribe to hashtags (topics)
96- Join P2P rooms keyed by hashtag
97- Receive posts with that hashtag from ANYONE
98
99### Implementation Approach
100
101```javascript
102// Current - single global room
103makeRoom('wiredovev1')
104
105// Proposed - topic-specific rooms
106makeRoom('#hypercore')
107makeRoom('#pear-git')
108makeRoom('#wirecore')
109```
110
111### Benefits
112
1131. **Scoped P2P gossip** - Only receive relevant messages over WebRTC
1142. **Relay unchanged** - Still stores everything, clients filter by hashtag
1153. **Additive** - Doesn't break follow model, runs alongside it
1164. **Use cases:**
117 - Project changelogs/release notes
118 - Community discussions by topic
119 - Reducing noise in main feed
120
121### Concerns to Address
122
1231. **Room fragmentation** - Too many rooms = fewer peers per room
1242. **Discovery** - How to find/list available topics?
1253. **Spam** - Topics could be flooded without moderation
1264. **Client complexity** - Managing multiple room subscriptions
127
128## Question for evbogue
129
130**Subject: Topic-based rooms in Wiredove/ANProto?**
131
132Looking at the dual-transport architecture (WebSocket to pub.wiredove.net + Trystero rooms for P2P), I'm curious about extending the room model.
133
134Currently:
135- `makeRoom('wiredovev1')` - single global P2P room
136- WebSocket relay stores/forwards everything
137
138Would it make sense to have **hashtag-based Trystero rooms**?
139
140```javascript
141// Current
142makeRoom('wiredovev1')
143
144// Proposed - join topic-specific P2P rooms
145makeRoom('#hypercore')
146makeRoom('#pear-git')
147```
148
149This way:
1501. Clients only receive P2P gossip for topics they care about
1512. Relay still stores everything (no changes needed)
1523. Clients can filter what they pull from relay by hashtag
153
154The P2P layer becomes topic-scoped while the relay remains a global archive.
155
156Any interest in this direction? Or concerns about fragmenting the P2P gossip?
157
158---
159
160## Recent Wiredove Updates (2026-01-30)
161
162Pulled latest changes from evbogue repos:
163
164### Wiredove Changes (13 files)
165
1661. **Moderation System** (`moderation.js` - NEW)
167 - Mute authors (hide posts, local only)
168 - Block authors (purge content + prevent sync)
169 - Hide specific posts by hash
170 - Keyword filtering (muted words)
171
1722. **Performance Improvements**
173 - No longer re-verifies message integrity on every render
174 - Concurrent rendering (6 at a time) with queue
175 - IntersectionObserver for lazy loading
176
1773. **HTTP Fallback**
178 - Polls `pub.wiredove.net/gossip/poll` when WebSocket fails
179 - 5 second interval
180
1814. **IndexedDB Migration**
182 - One-time migration from CacheKV to IndexedDB
183
184### APDS Changes (9 files)
185
1861. **Share Button** (`share/share-button.js` - NEW)
187 - Embeddable "Share on ANProto" button
188 - Posts directly to pub.wiredove.net
189 - Stores keypair in IndexedDB
190
1912. **Events UI** (`events/index.html` - mockup)
192
1933. **HTTP API** - First endpoints in serve.js
194
1954. **Blocking Functions** - `purgeAuthor()` for moderation
196
197### ANProto
198
199No changes (already up to date)
200
201---
202
203## Related Files
204
205- `docs/WIREDOVE_ANALYSIS.md` - Original wiredove analysis
206- `lib/wirecore-apds.js` - Our APDS implementation with Hypercore backend
207- `relay/wirecore-relay.js` - Our relay with bridge to pub.wiredove.net
208
209## Next Steps
210
2111. [ ] Send question to evbogue about topic-based rooms
2122. [ ] Prototype hashtag parsing in composer
2133. [ ] Test multi-room Trystero performance
2144. [ ] Design topic subscription UI