void;
onAccountChange: (account: AccountInfo | null) => void;
type: KeypairType;
+ onTypeChange: (type: KeypairType) => void;
}
-function SeedAndPath ({ className, onAccountChange, onNextStep, type }: Props): React.ReactElement {
+function SeedAndPath ({ className, onAccountChange, onNextStep, onTypeChange, type }: Props): React.ReactElement {
const { t } = useTranslation();
const genesisOptions = useGenesisHashOptions();
const [address, setAddress] = useState('');
@@ -93,6 +95,20 @@ function SeedAndPath ({ className, onAccountChange, onNextStep, type }: Props):
options={genesisOptions}
value={genesis}
/>
+ {/* Not under "advanced": choosing the wrong type imports a different
+ account from the same phrase, with nothing else on screen to say
+ so. The address preview above updates as this changes, and that
+ preview is what the warning points the reader at. */}
+
+
+ {t('The same recovery phrase gives a different account under each key type. Check the address above is the one you expect before continuing.')}
+
{
- setType(
- chain && chain.definition.chainType === 'ethereum'
- ? 'ethereum'
- : DEFAULT_TYPE
- );
+ if (chain?.definition.chainType === 'ethereum') {
+ setType('ethereum');
+ } else {
+ setType((current) => current === 'ethereum' ? DEFAULT_TYPE : current);
+ }
}, [chain]);
const _onCreate = useCallback((name: string, password: string): void => {
@@ -84,6 +87,7 @@ function ImportSeed (): React.ReactElement {
)
diff --git a/packages/extension-ui/src/util/keyTypes.ts b/packages/extension-ui/src/util/keyTypes.ts
new file mode 100644
index 00000000..74da5333
--- /dev/null
+++ b/packages/extension-ui/src/util/keyTypes.ts
@@ -0,0 +1,23 @@
+// Copyright 2019-2026 @polkadot/extension-ui authors & contributors
+// SPDX-License-Identifier: Apache-2.0
+
+import type { KeypairType } from '@polkadot/util-crypto/types';
+
+/**
+ * The key types a Quantus account can have.
+ *
+ * Exactly the variants of the runtime's `DilithiumSignatureScheme` — both are in
+ * use on the chain, so both have to be creatable and importable. Upstream never
+ * offered a choice here: it derived the type from the network, because each
+ * chain it supported had one valid type. Quantus has two on the same chain, so
+ * the network cannot decide and the user has to.
+ *
+ * The distinction is not cosmetic. The same recovery phrase or seed produces a
+ * **different account** under each type — crystal_alice's seed is a funded
+ * account as ML-DSA-87 and an empty one as ML-DSA-65 — so importing under the
+ * wrong type silently yields the wrong address.
+ */
+export const KEY_TYPE_OPTIONS: { text: string, value: KeypairType }[] = [
+ { text: 'ML-DSA-65 (recommended)', value: 'dilithium65' },
+ { text: 'ML-DSA-87', value: 'dilithium87' }
+];
diff --git a/packages/extension/public/locales/en/translation.json b/packages/extension/public/locales/en/translation.json
index 0f40334d..a9fdf980 100644
--- a/packages/extension/public/locales/en/translation.json
+++ b/packages/extension/public/locales/en/translation.json
@@ -149,5 +149,7 @@
"... we are not in the information collection business (even anonymized).": "",
"Understood, let me continue": "",
"Password must be at least {{length}} characters long": "",
- "Open in a tab": ""
+ "Open in a tab": "",
+ "Key type": "",
+ "The same recovery phrase gives a different account under each key type. Check the address above is the one you expect before continuing.": ""
}