Decentralized social media network — no central server, user-owned data
Find a file
Scott Reimers 2cb211eb11 Phase 2f: groups as a distinct primitive alongside circles
Introduces **groups** — a new many-way primitive anchored at a public root
post — reusing the existing circle encryption machinery. Circles stay
one-way (admin posts only, as before). Groups are distinguished from
circles by a single field: a non-null `canonical_root_post_id` on the
group-key record.

Type / schema changes:
- `GroupKeyRecord.canonical_root_post_id: Option<PostId>` (serde default).
  When `Some`, the record represents a group rooted at that public post;
  when `None`, it's a traditional circle.
- `group_keys` table gets a `canonical_root_post_id BLOB` column + an
  index `idx_group_keys_root` on it. Migration added for upgraded DBs;
  the CREATE TABLE statement carries the column so fresh DBs match.

Wire:
- `GroupKeyDistributePayload` gains an optional `canonical_root_post_id`
  field. v0.6.1 peers will deserialize it as absent and continue treating
  the record as a circle. All three sender sites (new-circle distribute,
  add-member distribute, epoch-rotation distribute) pass the field through.

Storage:
- `create_group_key` / `get_group_key` / `get_group_key_by_circle` write
  and read the new column. Added a shared `row_to_group_key` helper so the
  two lookup functions don't drift.
- New `get_group_by_canonical_root(root_post_id)` — the inverse lookup
  used by posting / retrieval flows.

Node API (new):
- `create_group_from_post(root_post_id, initial_members)` — creates a
  backing circle named `group:<6-byte-hex-of-root>`, initializes the
  group key with `canonical_root_post_id` set, and invites each initial
  member (reusing `add_to_circle`'s wrap+distribute path so members get
  the seed on the wire). Returns `(GroupId, circle_name)`.
- `post_to_group(root_post_id, content, attachments)` — any member with
  the group seed can call this. Looks up the group by root, routes
  through `create_post_with_visibility(Circle(name))` (which already
  chooses `GroupEncrypted` when the seed is present), then stores a
  `ThreadMeta` row linking the new post back to the canonical root so
  retrieval can reconstruct the group.
- `list_group_posts_by_root(root_post_id)` — returns all contributions
  via the ThreadMeta parent index. Callers decrypt normally; members see
  full content, non-members see encrypted blobs.

Shared plumbing:
- `create_group_key_for_circle` now delegates to a shared
  `create_group_key_inner(circle_name, canonical_root)` helper, keeping
  one place where the record is constructed and the seed is persisted.

Notes:
- No crypto change: groups use the same `GroupEncrypted` primitive
  circles already used. The "admin-only post" restriction on circles was
  a UX choice, not a cryptographic limit — groups expose the many-way
  path directly by letting any member with the seed call `post_to_group`.
- ThreadMeta is the clustering primitive. It already existed for split
  comment threads; groups reuse it so the query pattern
  ("posts whose parent is root X") stays in one place.
- Frontend UI for groups is deferred — the backend surface is complete
  and exercise-able via Tauri/CLI.

Tests: new storage test asserts canonical_root lookup round-trips and
that circles (no root) are invisible to the root lookup. 117 / 117 core
tests pass.
2026-04-22 22:58:39 -04:00
crates Phase 2f: groups as a distinct primitive alongside circles 2026-04-22 22:58:39 -04:00
deploy ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
docs v0.4.1: Security hardening, lock contention fixes, data cleanup 2026-03-21 19:30:38 -04:00
frontend Phase 2c: remove audience + PostPush + PostNotification + AudienceRequest/Response 2026-04-22 22:20:02 -04:00
website v0.6.1 release: version bump + changelog 2026-04-22 17:57:28 -04:00
.gitignore Add build-appimage.sh and deploy.sh automation scripts 2026-04-19 16:01:34 -04:00
.sync-exclude.lst ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
ARCHITECTURE.md ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
build-appimage.sh Add build-appimage.sh and deploy.sh automation scripts 2026-04-19 16:01:34 -04:00
Cargo.lock v0.6.1 release: version bump + changelog 2026-04-22 17:57:28 -04:00
Cargo.toml ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
deploy.sh Platform: Reset wipe, empty name, Android browse + backup-off, import as personas 2026-04-22 17:40:21 -04:00
download-page.html ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
IMPLEMENTATION_PLAN_0.6.md Implementation plan: drop cross-version compat, beta/stable as separate networks 2026-04-21 18:26:55 -04:00
pic2.png v0.4.4: UI overhaul — sticky header, mobile nav, profiles/redundancy lightboxes 2026-03-23 00:56:27 -04:00
project discussion.txt ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
project-notes-from-elitebook.md ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00
TODO.md ItsGoin v0.3.2 — Decentralized social media network 2026-03-15 20:23:09 -04:00