Skip to content

End-to-end encrypted chat and the chat UI wired to the API - #4

Merged
A-RYAN-1 merged 1 commit into
mainfrom
feat/e2e-encrypted-chat
Oct 23, 2026
Merged

A-RYAN-1 merged 1 commit into
mainfrom
feat/e2e-encrypted-chat

Conversation

@A-RYAN-1

Copy link
Copy Markdown
Owner

What

  • Keys: an X25519 key pair is derived from one wallet signature of a fixed text (nothing is stored); the public key is written on chain with Registry.register.
  • Messages: sealed in the browser with NaCl box, sent as base64 ciphertext to /api/messages, opened in the browser. The server and Neon never see plaintext.
  • The UI moves from the legacy ChatApp contract to Registry and NodeToken: profiles and friend requests (request, accept, decline) from contract events, messages through the API, an "Unlock messages" step (two signatures, no gas), sending / not sent (Retry, Discard) states and a 4 second poll while the conversation is open.
  • API: a send now requires an accepted friendship on the Registry (areFriends, positive answers cached 60 s). 403 for a non-friend, 503 if the chain cannot be read; OpenAPI updated.
  • Leaderboard and balance read NodeToken; mining is a later feature, so balances are zero.
  • CI/config: new NEXT_PUBLIC_REGISTRY_ADDRESS, NEXT_PUBLIC_TOKEN_ADDRESS, NEXT_PUBLIC_REGISTRY_START_BLOCK (already set on Vercel); the ABI check covers Registry and NodeToken.

Tests

  • 26 node:test tests pass on the in-memory store: 6 crypto (same wallet same keys, both sides open, third party cannot, tampering, unicode) and the API tests including the 403 and 503 paths.
  • Lint and production build pass; the Registry reader was checked against Hoodi.
  • The two-account flow on the live site is run after the merge.

Rollout and rollback

Merge deploys to Vercel; the new variables are set. Rollback is a revert of this PR plus restoring the previous deployment.

Keys come from one wallet signature, the public key is registered on the Registry,
messages are sealed in the browser (NaCl box) and sent as ciphertext. The API only
accepts messages between accepted friends (checked on chain). The UI moves from the
legacy ChatApp contract to Registry and NodeToken, with friend requests, unlock,
sending/failed/retry states and polling.
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
node-connect Ready Ready Preview Oct 23, 2026 2:33pm UTC

@A-RYAN-1
A-RYAN-1 merged commit b439015 into main Oct 23, 2026
4 checks passed
@A-RYAN-1
A-RYAN-1 deleted the feat/e2e-encrypted-chat branch October 23, 2026 14:55

This branch was successfully deployed

1 active deployment
Preview — 49412a03 Deployed Oct 23, 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.

1 participant