66 lines
2.3 KiB
Markdown
66 lines
2.3 KiB
Markdown
---
|
|
status: archived
|
|
created: '2026-03-16'
|
|
tags:
|
|
- p2p
|
|
- discovery
|
|
priority: medium
|
|
created_at: '2026-03-16T07:51:50.076Z'
|
|
depends_on:
|
|
- 002-p2p-networking
|
|
- 003-user-identity-profiles
|
|
- 012-lightweight-server
|
|
updated_at: '2026-03-16T09:31:19.812Z'
|
|
transitions:
|
|
- status: archived
|
|
at: '2026-03-16T09:31:19.812Z'
|
|
---
|
|
|
|
# Peer Discovery by Tags
|
|
|
|
> **Status**: 📦 Archived · **Priority**: Medium · **Created**: 2026-03-16 · **Tags**: p2p, discovery
|
|
|
|
## Overview
|
|
|
|
Enable poll owners to discover other users to invite, based on user tags (location, interests, expertise). This is P2P—there's no central user directory. Discovery works by asking connected peers for introductions.
|
|
|
|
## Design
|
|
|
|
### Discovery Mechanism
|
|
|
|
1. **Direct invite**: Share a poll link or paste a peer ID manually
|
|
2. **Directory server**: Lightweight server where users can register their profile for discoverability
|
|
- Users opt-in to being listed (toggle in profile)
|
|
- Server stores: peer ID, name, tags, `discoverable` flag
|
|
- Query endpoint: `GET /api/users?tag=location:Berlin&tag=expertise:UX`
|
|
- Minimal server—just a thin REST API over a key-value store (e.g., Cloudflare Workers + KV, or a simple SQLite API)
|
|
3. **Peer-chain discovery** (secondary): Ask connected peers "who do you know matching these tags?"
|
|
- Supplements the directory for users who are connected but not listed
|
|
|
|
### Privacy Controls
|
|
|
|
- Users opt-in to being discoverable (setting in profile)
|
|
- Directory only stores public profile data (name, tags)—no private keys, no bio
|
|
- Users can remove themselves from directory at any time
|
|
|
|
## Plan
|
|
|
|
- [ ] Build lightweight directory server (REST API + KV store)
|
|
- [ ] Add `discoverable` toggle to user profile
|
|
- [ ] Implement directory registration (opt-in publish profile)
|
|
- [ ] Implement directory search (query by tags)
|
|
- [ ] Build discovery UI (search by tags, browse results)
|
|
- [ ] Implement "invite from discovery" flow
|
|
- [ ] Implement peer-chain discovery as fallback
|
|
|
|
## Test
|
|
|
|
- [ ] Discovery request returns matching peers from connected contacts
|
|
- [ ] Non-discoverable users are not shared
|
|
- [ ] Discovered peer can be invited to a poll
|
|
|
|
## Notes
|
|
|
|
- **DECIDED**: Adding a lightweight directory server for discoverability
|
|
- Directory server can be reused for poll snapshot storage (see spec 009)
|