Skip to content

fix(auth): restore working seedPrivate for 12-word login#982

Merged
lucca65 merged 1 commit into
masterfrom
fix/restore-seedprivate-12word-login
Jun 17, 2026
Merged

fix(auth): restore working seedPrivate for 12-word login#982
lucca65 merged 1 commit into
masterfrom
fix/restore-seedprivate-12word-login

Conversation

@lucca65

@lucca65 lucca65 commented Jun 17, 2026

Copy link
Copy Markdown
Member

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 ecc to eosjs/dist/eosjs-ecc-migration, where seedPrivate is a no-op stub:

seedPrivate: function () { return console.error('Method deprecated') }  // returns undefined

So in src/index.js:

  • getAccountFrom12Wordsecc.seedPrivate(...)undefinedecc.isValidPrivate(undefined)error.invalidKey
  • generateKeys (registration) → undefined private key

Existing users were unaffected because PIN login decrypts a stored key (sjcl.decrypt) and never calls seedPrivate — 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 seedPrivate in src/scripts/mnemonic.js that reproduces legacy eosjs-ecc exactly — PrivateKey(sha256(seed)) returned as a legacy WIF — and call it from both sites.

Verification

  • Derived the public key from maysalex1234's 12 words via the new seedPrivateEOS5hmk9bPey12gAbuGjGRiQferjxgAoyGAtXpwR7GaQKxhzDdTt2. get_key_accounts on app.cambiatus.io returns {"account_names":["maysalex1234"]} → exact match.
  • Keys are byte-identical to pre-Vite migration: fix Elm not loading in browser #978 (legacy WIF, 5…, len 51): no user key migration needed, accounts not compromised, keys not rotated.
  • yarn build passes; new eosjs imports (eosjs-key-conversions, eosjs-numeric) resolve in the Vite bundle.

🤖 Generated with Claude Code

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>
@netlify

netlify Bot commented Jun 17, 2026

Copy link
Copy Markdown

Deploy Preview for cambiatus-elm-book failed.

Name Link
🔨 Latest commit cd6147b
🔍 Latest deploy log https://app.netlify.com/projects/cambiatus-elm-book/deploys/6a32b41d85382c00080ef407

@lucca65 lucca65 merged commit aa15772 into master Jun 17, 2026
5 of 13 checks passed
@lucca65 lucca65 deleted the fix/restore-seedprivate-12word-login branch June 17, 2026 15:06
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