fix(auth): restore working seedPrivate for 12-word login#982
Merged
Conversation
eosjs-ecc-migration (adopted in #978) ships `seedPrivate` as a no-op stub that logs "Method deprecated" and returns undefined. As a result `getAccountFrom12Words` and `generateKeys` derived an undefined private key, so every from-scratch 12-word login and new registration failed with `error.invalidKey`. Existing PIN sessions decrypt a stored key and never call seedPrivate, which masked the outage as a single-user report. Add a local `seedPrivate` in mnemonic.js that reproduces legacy eosjs-ecc exactly — PrivateKey(sha256(seed)) returned as a legacy WIF — and call it from both sites. Verified the derived key matches the on-chain public key for an affected account; keys are byte-identical to pre-#978, so no user key migration is required. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
❌ Deploy Preview for cambiatus-elm-book failed.
|
This was referenced Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Production outage for all from-scratch 12-word logins and new registrations, all languages. Reported as a single Portuguese user (
maysalex1234) unable to log in with valid 12 words; root cause is repo-wide.The Vite migration (#978) switched
ecctoeosjs/dist/eosjs-ecc-migration, whereseedPrivateis a no-op stub:So in
src/index.js:getAccountFrom12Words→ecc.seedPrivate(...)→undefined→ecc.isValidPrivate(undefined)→error.invalidKeygenerateKeys(registration) → undefined private keyExisting users were unaffected because PIN login decrypts a stored key (
sjcl.decrypt) and never callsseedPrivate— which masked the outage. Only new-device / cleared-storage logins and new signups break. Confirmed the stub is live in the deployed prod bundle (vendor-blockchain).Fix
Add a local
seedPrivateinsrc/scripts/mnemonic.jsthat reproduces legacyeosjs-eccexactly —PrivateKey(sha256(seed))returned as a legacy WIF — and call it from both sites.Verification
maysalex1234's 12 words via the newseedPrivate→EOS5hmk9bPey12gAbuGjGRiQferjxgAoyGAtXpwR7GaQKxhzDdTt2.get_key_accountsonapp.cambiatus.ioreturns{"account_names":["maysalex1234"]}→ exact match.5…, len 51): no user key migration needed, accounts not compromised, keys not rotated.yarn buildpasses; new eosjs imports (eosjs-key-conversions,eosjs-numeric) resolve in the Vite bundle.🤖 Generated with Claude Code