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.
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.