Add ml_dsa_65 (FIPS 204) to CurveType and SignatureType#129
Open
Wiezzel wants to merge 1 commit into
Open
Conversation
Introduces `ml_dsa_65` as a new value for both `CurveType` and `SignatureType`. ML-DSA-65 is the medium-strength FIPS 204 module-lattice digital-signature variant (NIST Security Category 3): 1952-byte public key, 3309-byte signature. The `CurveType` field is also annotated to note that the value may now identify a post-quantum scheme that is not strictly an elliptic curve. The enum and field name are kept unchanged for backwards compatibility; clients that do not recognise `ml_dsa_65` should reject it as they would any unknown enum value. `api.json` is regenerated via `make gen` from `models/CurveType.yaml` and `models/SignatureType.yaml`. Motivation: the NEAR Protocol is adding ML-DSA-65 as a third transaction-signature scheme alongside ed25519 and secp256k1, and its Mesh / Rosetta RPC implementation needs a way to represent post-quantum public keys and signatures at the API boundary. Other networks adopting post-quantum signatures are expected to need the same discriminator value.
🟡 Heimdall Review Status
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes # .
Motivation
The NEAR Protocol is adding FIPS 204 ML-DSA-65 as a third transaction-signature scheme alongside
ed25519andsecp256k1. Its Mesh / Rosetta RPC implementation has no way to represent post-quantum public keys or signatures at the API boundary today, because the existingCurveTypeandSignatureTypeenums are closed and only cover classical elliptic-curve and Schnorr-style schemes.Per a thread with the Mesh-Specifications maintainers ("We would gladly accept a PR ... with the new curve type and signature type."), this PR adds the minimum needed: a single new value
ml_dsa_65in both enums. Other networks adopting post-quantum signatures (any of the FIPS 204 / FIPS 205 / FIPS 206 family) will need similar entries; landing the precedent for ML-DSA-65 first keeps that incremental.Solution
models/CurveType.yaml: addml_dsa_65to the enum and document it as a 1952-byte ML-DSA-65 public key with a pointer to FIPS 204. The field-level description also gains a note that, despite the historical nameCurveType, the value may now identify a post-quantum scheme that is not based on an elliptic curve. The enum stays open-ended in spirit but remains a closed set in the spec; clients should reject unknown values exactly as they do today.models/SignatureType.yaml: addml_dsa_65to the enum and document it as a 3309-byte ML-DSA-65 signature with a pointer to FIPS 204. The signature is a fixed-size opaque byte string per FIPS 204 §3; no internal field decomposition is exposed at this layer (matching howecdsa/ed25519are exposed without internal structure).api.json: regenerated viamake genfrom the two YAML changes above; no hand-edits.Backwards compatibility: pure enum addition. Clients that don't know
ml_dsa_65should reject it the same way they reject any unknown enum value; clients that do know it gain a place to put PQ keys and sigs.Local checks run:
make check-valid(swagger-cli validate api.yaml) — pass.make genthengit diff --exit-code(i.e.make check-gen) — pass after committing the regeneratedapi.json.make check-license/make spellcheck/make shellcheck— not run locally (Go-based deps not installed on dev machine); CI is expected to catch any issues. No new files were created and no existing license headers or shell scripts were touched.make salus— not run locally (Docker-based).Open questions
ml_dsa_65(snake_case, all-lowercase, matching thesecp256k1_bip340/schnorr_poseidonprecedent). FIPS 204 calls the scheme "ML-DSA-65" in the spec; an alternative would bemldsa65. Happy to rename if you have a preference.CurveTyperename. Adding a lattice scheme to a field calledCurveTypeis a stretch. Renaming the field (or introducing a parallelPublicKeyScheme) would be cleaner but breaks every existing consumer. This PR leaves the field name alone and just notes the historical mismatch in the description — let me know if you'd rather take the breaking-change route instead.