Skip to content

feat!: replace Zen SEA with Ed25519 and sync the library over HTTP - #136

Merged
scobru merged 1 commit into
mainfrom
claude/dazzling-franklin-yj0co6
Oct 6, 2026
Merged

scobru merged 1 commit into
mainfrom
claude/dazzling-franklin-yj0co6

Conversation

@scobru

@scobru scobru commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Identity: profile.html and sso.html derive and sign with vendor/identity.js (vendored from fid, WebCrypto Ed25519, same derivation as fid 5.0.0 — the same alias + passphrase gives the same key as the portal). vendor/zen.min.js, crypto.wasm, pen.wasm and window.ZEN_RELAY are gone.
  • Library sync over HTTP (components/library-sync.js): the player mirrors favorites, artists and playlists to the TuneCamp instance the identity is linked to, through the new /api/auth/zen/library/:pub routes (scobru/tunecamp#1227, merged). Requests are signed with the identity key; private records are encrypted in the browser (AES-GCM, key derived from the identity key); shared playlists stay public. It reads on open, when the tab becomes visible, and once a minute; writes are debounced; last write wins by the record's own timestamp.
  • New device: with no linked passport, the player asks the directory instances (config.js) which one holds an account for the key (GET .../:pub/account) and remembers it.
  • Share links now name the instance: player.html?pl=<pub>.<id>@<host>. Old ?pl=<pub>.<id> links used the relay and stop resolving.
  • README and site copy (about, ecosystem) no longer mention Zen SEA or a relay.

Behaviour changes to be aware of

  • Every existing FID identity is re-keyed (see fid 5.0.0); users relink on their instance.
  • The profile card (name, bio, avatar) and the linked-instance list now live in the browser only; the relay used to carry both. Nothing else read them.
  • Sync needs an instance where the identity has an account; otherwise the player says so and the library stays local.

Test plan

  • tests/library-sync.test.js (new, 24 assertions): encryption, share tokens, instance discovery, two devices through an in-process instance, tombstones, shared playlists, refusals. Plus library (50), instance-import (36), url-safety (15), check_syntax.js.
  • tests/player.e2e.cjs in headless Chromium: 54 checks, including an unreachable instance reported honestly and a published playlist opened from its link. (It was already failing on a stale text assertion before this change; fixed.)
  • Browser smoke: logging in on the profile page yields the pinned fid vector bE9DAycqb9gbxMJHTxh5RRxVQRPpG-wrCojHVl0s9sM; sso.html authorize posts a 64-byte Ed25519 signature with masterKeySource: { type: 'zen', pubKey }.
  • Merge together with the tunecamp release that carries the library routes.

Based on main: the website's dev branch is a stale, heavily diverged branch (it lacks sso.html, the tests and utils.js), and every previous PR here targets main.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FeCp9YZh9dCEHXtRdpVeFe


Generated by Claude Code

Identity pages derive and sign with vendor/identity.js (WebCrypto Ed25519,
same derivation as fid 5.0.0). The player syncs the library to the instance
the identity is linked to (signed requests, records encrypted in the browser)
instead of a Zen relay; a new device finds that instance via the directory.
Removes vendor/zen.min.js, the wasm files, ZEN_RELAY and the relay tests,
and updates README and site copy.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FeCp9YZh9dCEHXtRdpVeFe
@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
tunecamp Ready Ready Preview Oct 6, 2026 4:14pm UTC

@scobru
scobru marked this pull request as ready for review October 6, 2026 16:47
@scobru
scobru merged commit e77d1cb into main Oct 6, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — fd364833 Deployed Oct 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants