Repository navigation
Backlog
Description
Follow-up to #6354, which adds the ML_DSA_65 identity key type (key type 5, ML-DSA-65 of FIPS 204) to the protocol from protocol version 16.
After #6354 a node accepts such a key and verifies its signatures, and simple-signer signs with one. The wallet and the mobile SDKs can store and show the key, but cannot derive it or sign with it. This issue tracks closing that gap.
What is missing
A derivation path for the seed
- The private key of an
ML_DSA_65key is a 32 byte seed. There is no agreed derivation path for it (the DIP-9 identity path has a key type index for ECDSA and BLS only). rs-platform-wallet:IdentityWallet::derive_identity_key_bytesreturnsInvalidIdentityData("ML_DSA_65 keys are not derived from the wallet").- This needs a decision first: the path, and whether the seed is taken from a hardened child key or from a separate derivation.
Signing in the wallet
rs-platform-wallet-ffi: the mnemonic resolver signs ECDSA only (dash_sdk_resolver_supports_key_typeacceptsECDSA_SECP256K1andECDSA_HASH160). BLS12_381 and EDDSA_25519_HASH160 identity keys are in the same position today.- An
ML_DSA_65signature is 3,309 bytes, against 65 for ECDSA. Every signature buffer on the signing path has to be checked for that size. - Until this exists, an identity whose only usable keys are
ML_DSA_65cannot be operated from the wallet. Key selection already skips a key the signer cannot use, so an identity that also holds ECDSA keys keeps working.
Swift SDK and SwiftExampleApp
- feat(platform)!: add ML-DSA-65 identity keys (PV16) #6354 adds
KeyType.mlDsa65and stores a synced key under its real type. KeychainSignerrefuses the type incanSignand in signing, because every path there signs ECDSA secp256k1.- No screen creates or adds an
ML_DSA_65key.
Kotlin SDK and KotlinExampleApp
- The Kotlin
KeyTypemirror has the values 0 to 4. Reading a key of type 5 throws, so an identity holding one cannot be loaded. KeystoreSignerhas the same shape as the Swift signer (a stored private key is signed through the ECDSA helper) and needs the same refusal, then real support.
Fee estimates
- The estimates made before a key is added assume a small key. The fee charged is for the real size (1,952 bytes of key data, and 100,000 credits per signature check).
Not part of this
- ML-KEM keys for the
ENCRYPTIONandDECRYPTIONpurposes. AnML_DSA_65key is refused for those purposes.
Metadata
Metadata
Assignees
Labels
No labels
Activity
QuantumExplorer commentedon Nov 30, 2026
One more item for the signer work, from the review of #6354:
KeychainSigner(Swift) signs ECDSA secp256k1 with any stored private key, whatever the key's type. #6354 makes it refuse anML_DSA_65key by name. It still signs:BLS12_381orEDDSA_25519_HASH160key that has a stored private key (testCanSignAcceptsStoredScalarRegardlessOfKeyTypeasserts this on purpose today), andThe second case needs a row for a future key type that also has a stored private key, so it is not reachable today. When the signer learns to dispatch by key type, it should sign only the types it has a scheme for and refuse the rest, in
canSignand in both signing lookups, keeping the platform address path (0xFF) as it is. The KotlinKeystoreSignerhas the same shape.feat(platform)!: add hashed ML-DSA-65 identity keys (PV16)
QuantumExplorer commentedon Dec 4, 2026
#6510 adds a second post-quantum signing key type,
SLH_DSA_SHA2_128S(key type 8, SLH-DSA-SHA2-128s of FIPS 205, 32 byte seed as private key, 7,856 byte signature). Everything listed here forML_DSA_65holds for it as well, so the work can be done for both types together. Three points came up in the review of #6510 and were left to this issue:Kotlin
KeystoreSigner(already listed above as "needs the same refusal")canSignWithfrom whether the stored key decrypts, anddispatchSigndrops the key type and signs throughSignerNative.signWithPrivateKey, which is always ECDSA. This holds for every stored key that is not ECDSA, BLS included, and predates the post-quantum key types.SingleKeySigner::can_sign_with(ECDSA types with a matching public key, false otherwise), exported asdash_sdk_signer_can_sign. The fix is to pass the public key and key type into the JNI sign helper and ask it before signing, plus a predicate on the key type alone for the preflight, so no secret is requested for a key that cannot be signed with.MasternodeVotingKeySigningTestexercises that path and changes with it.KeychainSigner.refusesKeyTypeis a list kept in Swift, and it lets BLS, BIP13 and EdDSA keys through. It should move to the same Rust predicate.Swift
KeySizeValidatorexpectedPrivateKeySize(for:)is a Swift table of private key sizes with an entry per key type and no caller in the SDK or the example app. The real check is Rust's (dash_sdk_validate_private_key_for_public_key). The table should be removed, or read from Rust, for all key types at once.wasm-dpp2 signing with a seed
StateTransition.signandsignByPrivateKeytake aPrivateKey, which must be a valid secp256k1 scalar. A seed of anML_DSA_65orSLH_DSA_SHA2_128Skey that is zero or not below the curve order is refused before dpp sees it. Random seeds practically never are, but signing with these key types from JavaScript needs an input that is bytes and a key type, not an ECDSA private key.