Skip to content

feat(cold-wallet): choose ML-DSA-65 or ML-DSA-87 on create and import - #629

Merged
n13 merged 2 commits into
mainfrom
feat/cold-wallet-scheme-choice
Sep 3, 2026
Merged

feat(cold-wallet): choose ML-DSA-65 or ML-DSA-87 on create and import#629
n13 merged 2 commits into
mainfrom
feat/cold-wallet-scheme-choice

Conversation

@n13

@n13 n13 commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

What

The cold wallet defaulted to ML-DSA-65 with no way to choose ML-DSA-87 when creating or importing. This adds an explicit signature-type choice to both flows, under ADVANCED, default ML-DSA-65.

How

  • Create (create_wallet_screen.dart): an "ADVANCED" disclosure on the recovery-phrase screen, collapsed by default, reveals a SegmentedControls toggle (ML-DSA-65 / ML-DSA-87). The chosen scheme flows into the new account.
  • Import (derivation_field.dart): the same toggle in the field's existing ADVANCED section. Picking the level sets the derivation path's trailing index (65 → .../1', 87 → .../0'); the preview path updates to match. A full custom path is still accepted and takes its scheme from the path. Import now brings in the one account the field names, replacing the earlier behaviour of always adding both schemes.

Default stays ML-DSA-65, so untouched create/import is unchanged. SetPasswordScreen, the vault, and the ColdAccount model already carry the scheme end to end, so no other files change.

Tests

  • create_wallet_scheme_test.dart: default create yields a 65 account with the toggle hidden; choosing 87 under ADVANCED yields an 87 account (path ends /0').
  • derivation_field_test.dart: the toggle sets the scheme and its path (65 → /1', 87 → /0'); a custom full path is still accepted and its scheme is read from the path.
  • Full cold-wallet suite passes (281); melos analyze clean.

@n13 n13 changed the title feat(cold-wallet): option to create an ML-DSA-87 wallet feat(cold-wallet): choose ML-DSA-65 or ML-DSA-87 on create and import Sep 3, 2026
n13 added 2 commits September 3, 2026 15:16
Cold-wallet create defaulted to ML-DSA-65 with no way to pick ML-DSA-87. Add an
"ADVANCED" disclosure on the recovery-phrase screen with a signature-type toggle,
collapsed by default so normal users see nothing new and the default stays
ML-DSA-65. The chosen scheme flows into the account built on continue; the rest
of the create flow already carries the scheme end to end.
Add the ML-DSA-65 / ML-DSA-87 toggle to the import screen's ADVANCED section
(the derivation field), matching create. Selecting the level sets the derivation
path's trailing index, while a full custom path is still accepted and takes its
scheme from the path. Import now brings in the one account the field names,
replacing the previous behaviour of always adding both schemes.
@n13
n13 force-pushed the feat/cold-wallet-scheme-choice branch from d2e7267 to 95b3e15 Compare September 3, 2026 07:17
@n13 n13 added the bot-review Request automated review from review-bot label Sep 3, 2026

@n13 n13 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer model: GPT Sol

Verdict (advisory): Approve

No blocking findings. The create and import flows consistently carry the selected ML-DSA scheme through ColdAccount, key derivation, password setup, and vault persistence. Template paths follow the selected scheme, while an explicitly entered full path continues to determine its own scheme as intended.

Validation on exact head 95b3e152f7bea20d0a995e08e6b6b98c976998ef:

  • Added create/derivation widget tests: 4 passed.
  • Full cold-wallet test suite: 281 passed.
  • Workspace formatting and git diff --check: clean.
  • Local strict analysis: cold-wallet, miner, and SDK completed with no issues; the unrelated mobile package hit the required 10-second local cutoff. GitHub's full Analyze check passed on this head.

@n13 n13 removed the bot-review Request automated review from review-bot label Sep 3, 2026
@n13
n13 merged commit 83d9d9e into main Sep 3, 2026
4 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