Nostr transport:
- Switch from kind 1 to NIP-78 kind 30078 (application-specific data)
- Relays store events persistently — no inventory protocol needed
- AES-256-GCM encryption via Web Crypto API (room key = shared secret)
- PBKDF2 key derivation (100k iterations) from room key
- Chunking for large events (images >48KB) with per-chunk encryption
- Auto re-publish missing local events on room join
- Manual "Re-sync" button for recovery of failed publishes
Performance (all variants):
- Emit 'change' immediately after local store write (IDB/NeDB/SQLite)
- Folder and Nostr writes run fire-and-forget in background
- Fast event hashing: fingerprint metadata only, skip full payload SHA-256
- Saving spinner in paste UI while write completes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace timestamp-based catch-up with proper set reconciliation.
When a peer joins a room it publishes its full filename inventory.
Other peers diff against their own set and re-publish only the
events the newcomer is missing, then send their own inventory so
the newcomer can do the same. Two rounds max, no infinite loops.
Also switched from custom #channel tag (rejected by relays as
unindexed) to standard #t topic tag, and kind 4078 to kind 1.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fifth library variant that keeps folder sync for offline/local use
AND adds Nostr relay sync for cross-device reach via WebSocket.
Both transports run simultaneously - writes go to folder AND Nostr,
sync imports from both and bridges events between them.
Works from file:// since Nostr uses WebSocket (not fetch/WebRTC).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Four variants of the same sync library (IndexedDB, NeDB, SQLite WASM, sql.js)
plus a paste-bin demo app for testing multi-browser sync via shared folders.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>