Merge pull request #10992 from f321x/dedup_is_seed_wizard
What changed, and why it matters
This commit simplifies the seed-validation logic in Electrum's Qt wallet wizard by replacing a local copy of the rules with a call to an existing shared validation method. The change appears to be a code-cleanup refactor that removes duplicated logic rather than fixing a security bug. There is no direct evidence in the commit or supplied references that this change addresses a vulnerability.
Treat as a routine refactor. If auditing, verify that `Wizard.validate_seed()` enforces equivalent or stricter rules for standard, 2FA, and multisig wallet types compared to the removed inline logic, and that the assertion does not introduce unexpected failures for valid edge cases.
Security signals we found
Refactor of seed-validation logic in wallet creation wizard
Removal of duplicated seed-type checks in favor of centralized validation
Added assertion constraining seed type to 'electrum'
No explicit security claim in commit title or message
Evidence from the diff
The patch removes the inline is_seed() implementation in electrum/gui/qt/wizard/wallet.py and delegates to self.wizard.validate_seed(x, 'electrum', self.wizard_data['wallet_type']). It also adds an assertion that the seed type is ‘electrum’. The old code had wallet-type-specific branches for standard, 2fa, and multisig wallets; the new code relies on the wizard’s centralized validation. The change is small (+2/-8) and appears intended to deduplicate validation rules between the GUI and the wizard backend.
Changed components
electrum/gui/qt/wizard/wallet.pyQt wallet wizard seed validationInspect captured patch +2 / −8
### electrum/gui/qt/wizard/wallet.py
@@ -620,14 +620,8 @@ def seed_valid_changed(valid):
def is_seed(self, x):
# really only used for electrum seeds. bip39 and slip39 are validated in SeedWidget
- t = mnemonic.calc_seed_type(x)
- if self.wizard_data['wallet_type'] == 'standard':
- return mnemonic.is_seed(x) and (self.wizard.supports_2fa() or not mnemonic.is_any_2fa_seed_type(t))
- elif self.wizard_data['wallet_type'] == '2fa':
- return mnemonic.is_any_2fa_seed_type(t)
- else:
- # multisig? by default, only accept modern non-2fa electrum seeds
- return t in ['standard', 'segwit']
+ assert self.seed_widget.seed_type == 'electrum', self.seed_widget.seed_type
+ return self.wizard.validate_seed(x, 'electrum', self.wizard_data['wallet_type'])[0]
def validate(self):
# precond: only call when SeedWidget deems seed a valid seedWhy this scored 29/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.