wizard: add script and derivation to keystorewizard flow. fixes #10063
What changed, and why it matters
This commit adjusts the wallet setup wizard so that users who enter a seed phrase are also asked to confirm the script type and derivation path before the keystore is finalized. It is a UI flow fix for issue #10063 and does not change any security-critical code, cryptographic operations, or network behavior.
No security action needed; treat as a normal functional/UI fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies the wizard state machine in electrum/wizard.py. Previously, after entering a seed (and optional seed extension), the wizard called update_keystore immediately. Now it routes through a new ‘script_and_derivation’ step when the keystore needs a derivation path. The accept/last lambdas are updated so the keystore is only finalized after that step. The Qt file only loses a blank line. No cryptographic, networking, or permission code is touched.
Changed components
electrum/wizard.pyelectrum/gui/qt/wizard/wallet.pyInspect captured patch +8 / −4
diff --git a/electrum/gui/qt/wizard/wallet.py b/electrum/gui/qt/wizard/wallet.py
index fd12408..bae3ef9 100644
--- a/electrum/gui/qt/wizard/wallet.py
+++ b/electrum/gui/qt/wizard/wallet.py
@@ -48,7 +48,6 @@ MSG_HW_STORAGE_ENCRYPTION = _("Set wallet file encryption.") + '\n'\
+ _("It also contains your master public key that allows watching your addresses.")
-
class QEKeystoreWizard(KeystoreWizard, QEAbstractWizard, MessageBoxMixin):
_logger = get_logger(__name__)
diff --git a/electrum/wizard.py b/electrum/wizard.py
index 6894549..08b65db 100644
--- a/electrum/wizard.py
+++ b/electrum/wizard.py
@@ -210,11 +210,16 @@ class KeystoreWizard(AbstractWizard):
'next': self.on_keystore_type
},
'enter_seed': {
- 'next': 'enter_ext',
- 'accept': lambda d: None if self.wants_ext(d) else self.update_keystore(d),
- 'last': lambda d: not self.wants_ext(d),
+ 'next': lambda d: 'enter_ext' if self.wants_ext(d) else 'script_and_derivation',
+ 'accept': lambda d: None if (self.wants_ext(d) or self.needs_derivation_path(d)) else self.update_keystore(d),
+ 'last': lambda d: not self.wants_ext(d) and not self.needs_derivation_path(d),
},
'enter_ext': {
+ 'next': 'script_and_derivation',
+ 'accept': lambda d: None if self.needs_derivation_path(d) else self.update_keystore(d),
+ 'last': lambda d: not self.needs_derivation_path(d)
+ },
+ 'script_and_derivation': {
'accept': self.update_keystore,
'last': True
},
Why this scored 15/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.