Skip to content

Take the 24-word backup from @gryt/crypto (GRYT-898) - #380

Merged
sivert-io merged 2 commits into
mainfrom
claude/GRYT-898-client-seed
Sep 4, 2026
Merged

Take the 24-word backup from @gryt/crypto (GRYT-898)#380
sivert-io merged 2 commits into
mainfrom
claude/GRYT-898-client-seed

Conversation

@sivert-io

Copy link
Copy Markdown
Member

Review-required path (src/packages/common/src/auth/), so this is yours to merge.

seedToWords, wordsToSeed, SEED_BYTES and assertUsableSeed moved to @gryt/crypto in crypto#6, released as 0.4.0. The phone had all four, agreeing with these by hand.

Why this one deserves a closer read than the last few

It is the only duplicate on the GRYT-898 list where drifting would not fail loudly. A changed encoding still round-trips perfectly against itself. What it strands is every phrase already written down on paper — and nobody finds out until somebody restores a backup on a new device.

So crypto pins it to a fixed vector rather than a round trip, taken from what this app produced before the move.

What I checked

  • The phrase for a known seed (0x00..0x1f) is byte-identical to what this app produced before the change.
  • The phone's words.test.ts — 14 tests written against its implementation — passes unchanged against crypto's.
  • In crypto, reversing the seed before encoding fails the vector check, so the guard bites rather than merely passing.

One user-visible change

assertUsableSeed now carries the phone's error wording rather than this app's. Same two checks — length, and all-one-byte — different strings. One of them had to go and the phone's were the more direct.

Verification

yarn lint clean, and identity-vault, message-vault, message-key, message-key-offer, server-notice and reset-warning all pass, against the published 0.4.0.

The phone's half is Gryt-chat/mobile#189.

🤖 Generated with Claude Code

sivert-io and others added 2 commits September 4, 2026 15:34
`seedToWords`, `wordsToSeed`, `SEED_BYTES` and `assertUsableSeed` moved to
@gryt/crypto in crypto#6. The phone had all four, agreeing with these by hand.

This is the one duplicate where drift would not fail loudly. A changed encoding
still round-trips against itself; what it strands is every phrase already
written down, and nobody finds out until somebody restores a backup on a new
device. Crypto pins it to a fixed vector taken from what this app produced
before the move.

`assertUsableSeed` now carries the phone's wording rather than this one's. Same
two checks, different strings, and one of them had to go.

Checked that the phrase for a known seed is byte-identical to what this app
produced before the change. `yarn lint` clean, and identity-vault, message-vault,
message-key, message-key-offer, server-notice and reset-warning all pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Separate commit because the lockfile could not be written until the release
existed: yarn refuses a pin it cannot resolve, and CI installs with
--frozen-lockfile.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sivert-io
sivert-io merged commit 1a797a2 into main Sep 4, 2026
3 checks passed
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