Files
427e7578-d7bf-49c8-aee9-2dd…/specs/003-user-identity-profiles/README.md
2026-03-16 23:03:27 +13:00

71 lines
2.4 KiB
Markdown

---
status: complete
created: '2026-03-16'
tags:
- identity
- profiles
priority: high
created_at: '2026-03-16T07:51:48.340Z'
depends_on:
- 001-project-setup
updated_at: '2026-03-16T10:01:26.785Z'
completed_at: '2026-03-16T10:01:26.785Z'
completed: '2026-03-16'
transitions:
- status: complete
at: '2026-03-16T10:01:26.785Z'
---
# User Identity & Profiles
> **Status**: ✅ Complete · **Priority**: High · **Created**: 2026-03-16 · **Tags**: identity, profiles
## Overview
Users need a persistent identity without a centralized account system. Each user generates a cryptographic keypair locally. Their public key serves as their unique ID. Users can edit their profile (name, bio, tags).
## Design
- **Identity**: Ed25519 keypair generated via Web Crypto API, stored in IndexedDB
- **User ID**: Base58-encoded public key (short, URL-safe)
- **Profile fields**: `name` (display name), `bio` (short text), `tags` (array of categorized tags)
- **Tags structure**: `{ category: string, value: string }` — e.g. `{ category: "location", value: "Berlin" }`, `{ category: "expertise", value: "UX Design" }`
- **Tag categories**: location, interest, expertise (extensible)
- **Signing**: Profile updates are signed with private key (used for server writes; P2P messages use connection identity)
- **Storage**: Profile stored locally in IndexedDB; shared with peers on connect
- **Discovery**: Deferred. Tags are stored locally and exchanged with peers, but there is no directory server for searching users by tag yet. When added, profiles will already have the right structure (see archived spec 007)
### Profile Schema
```typescript
interface UserProfile {
id: string; // base58(publicKey)
name: string;
bio: string;
tags: Tag[];
updatedAt: number; // timestamp
signature: string; // signed(hash(profile), privateKey)
}
interface Tag {
category: 'location' | 'interest' | 'expertise' | string;
value: string;
}
```
## Plan
- [ ] Implement keypair generation + storage in IndexedDB
- [ ] Create profile store (Svelte store backed by IndexedDB)
- [ ] Build profile edit page (name, bio, tag management)
- [ ] Implement tag CRUD with category selector
- [ ] Add profile signing/verification utilities
- [ ] Profile exchange on peer connect
## Test
- [ ] Keypair persists across page reloads
- [ ] Profile updates are saved and signed
- [ ] Tags can be added/removed by category
- [ ] Profile signature verification works