ML-DSA Dilithium Explained: How Lattice-Based Signatures Work
ML-DSA Dilithium explained in full: CRYSTALS-Dilithium is the digital signature scheme standardised by NIST as ML-DSA (FIPS 204, August 2024), and it represents the most deployment-ready post-quantum signature algorithm available today. This article walks through the mathematics behind module lattices, how Dilithium generates and verifies signatures, how its key and signature sizes compare to classical schemes, and why its properties matter specifically for cryptocurrency wallets and blockchain infrastructure facing the long-term threat of quantum computers powerful enough to break ECDSA.
What Is ML-DSA and Where Did It Come From?
CRYSTALS-Dilithium was developed by a team of cryptographers from academia and industry, submitted to NIST's Post-Quantum Cryptography (PQC) standardisation project in 2017, and selected as a primary standard in 2022. In August 2024, NIST published it formally as FIPS 204, renaming it ML-DSA (Module Lattice-based Digital Signature Algorithm).
The "CRYSTALS" umbrella stands for Cryptographic Suite for Algebraic Lattices and covers two primitives: Kyber (now ML-KEM, a key encapsulation mechanism) and Dilithium (ML-DSA, a signature scheme). This article focuses exclusively on the signature side.
Why a New Signature Standard Was Necessary
Classical digital signature schemes, including ECDSA (used by Bitcoin and Ethereum) and RSA, derive their security from mathematical problems that a sufficiently powerful quantum computer can solve efficiently. Specifically:
- ECDSA / EdDSA rely on the Elliptic Curve Discrete Logarithm Problem (ECDLP). Shor's algorithm breaks this in polynomial time on a fault-tolerant quantum machine.
- RSA relies on integer factorisation. Shor's algorithm breaks this too.
The timeline for such machines is uncertain, but cryptographers use the term Q-day to describe the point at which these attacks become feasible. Because "harvest now, decrypt later" attacks are already occurring, migrating signature infrastructure before Q-day is a live engineering concern, not a theoretical one.
---
The Mathematics Behind Module Lattices
Understanding ML-DSA requires a working grasp of the lattice problems it relies on.
What Is a Lattice?
A lattice in the cryptographic sense is a discrete additive subgroup of n-dimensional Euclidean space, generated by a set of basis vectors. Concretely, given a matrix B, the lattice is all integer linear combinations of its rows. Security comes from the hardness of problems defined over these structures.
The Hard Problems ML-DSA Relies On
ML-DSA's security reduces to two well-studied lattice problems:
- Module Learning With Errors (MLWE). Given samples of the form (A, As + e) where A is a public matrix, s is a small secret vector, and e is a small error vector drawn from a noise distribution, recover s. The "module" qualifier means the ring structure is parameterised, offering a middle ground between plain LWE (large keys) and ring-LWE (smaller keys but narrower security arguments).
- Module Short Integer Solution (MSIS). Given A, find a short non-zero vector x such that Ax = 0 mod q. This underpins the unforgeability of signatures.
Both problems are believed to be hard even for quantum computers. No sub-exponential quantum algorithm is known for either, unlike ECDLP or factoring.
The Fiat-Shamir with Aborts Framework
Dilithium uses a Fiat-Shamir with Aborts construction, introduced by Lyubashevsky. The high-level flow:
- The signer samples a random masking vector y from a bounded distribution.
- Computes a commitment w = Ay mod q, then hashes (w, message) to produce a challenge c.
- Computes a response z = y + cs, where s is the secret key.
- Abort condition: if z is too large (leaks information about s), discard and restart. This rejection sampling step is critical. It ensures z reveals nothing about s regardless of how many signatures an attacker observes.
- The signature is (z, h) where h is a hint vector helping the verifier reconstruct the high bits of w.
Verification checks that z is short, recomputes the high bits of Az - ct (where t is part of the public key), and confirms the hash matches. No secret material is exposed during verification.
---
ML-DSA Parameter Sets and Sizes
NIST standardised three parameter sets, each targeting a different NIST security level (analogous to AES-128, AES-192, and AES-256).
| Parameter Set | NIST Level | Public Key | Secret Key | Signature | Classical Security |
|---|---|---|---|---|---|
| ML-DSA-44 | 2 (≥AES-128) | 1,312 bytes | 2,528 bytes | 2,420 bytes | ~128-bit |
| ML-DSA-65 | 3 (≥AES-192) | 1,952 bytes | 4,000 bytes | 3,293 bytes | ~192-bit |
| ML-DSA-87 | 5 (≥AES-256) | 2,592 bytes | 4,864 bytes | 4,595 bytes | ~256-bit |
For comparison, common classical schemes:
| Scheme | Public Key | Signature |
|---|---|---|
| ECDSA P-256 | 64 bytes | ~71 bytes |
| Ed25519 | 32 bytes | 64 bytes |
| RSA-2048 | 256 bytes | 256 bytes |
The size increase is substantial. An ML-DSA-44 signature is roughly 34 times larger than an Ed25519 signature. This is the primary engineering cost of post-quantum security and has direct implications for blockchain transaction throughput, storage, and fee markets.
---
How Dilithium Compares to Other Post-Quantum Signature Schemes
NIST also standardised or is evaluating several other post-quantum signature schemes. Each makes different trade-offs.
| Scheme | Basis | Sig Size | Key Size | Speed | NIST Standard |
|---|---|---|---|---|---|
| ML-DSA (Dilithium) | Module lattice | ~2.4–4.6 KB | ~1.3–2.6 KB | Fast | FIPS 204 ✓ |
| SLH-DSA (SPHINCS+) | Hash-based | ~8–50 KB | 32–64 bytes | Slower | FIPS 205 ✓ |
| FN-DSA (Falcon) | NTRU lattice | ~666 B–1.3 KB | ~897 B–1.8 KB | Fast | FIPS 206 ✓ |
| XMSS / LMS | Hash-based | Varies | Small | Moderate | RFC 8391 / 8554 |
Why Dilithium / ML-DSA Is Often the Default Choice
- Implementation simplicity. The rejection-sampling construction avoids the Gaussian sampling required by Falcon, which is notoriously difficult to implement securely in constant time without side-channel leakage.
- Conservative security assumptions. MLWE and MSIS are among the most studied lattice problems.
- No statefulness. Unlike XMSS and LMS, ML-DSA is stateless. Stateful hash-based schemes require careful key management to avoid reusing one-time signing keys, a significant operational burden.
- Broad library support. Reference and optimised implementations exist in C, Rust, Python, and Go; hardware optimisations using AVX2/AVX-512 are well-documented.
---
Implications for Cryptocurrency Wallets and Blockchain Infrastructure
This is where ML-DSA moves from academic interest to practical urgency.
The ECDSA Exposure Problem
Every Bitcoin and Ethereum address derived from an exposed public key, meaning any address that has ever signed a transaction, has its public key on-chain. A quantum adversary with Shor's algorithm can derive the private key from that public key. Addresses that have never signed a transaction (pay-to-public-key-hash where only the hash is visible) have some additional protection, but are still vulnerable once they transact.
What Post-Quantum Wallets Need From a Signature Scheme
A wallet replacing ECDSA with a post-quantum alternative needs:
- Deterministic or stateless signing to avoid catastrophic reuse errors.
- Reasonable signature sizes to keep transaction fees manageable.
- Fast verification to avoid slowing down node validation.
- Mature, audited implementations to minimise side-channel and implementation bugs.
ML-DSA satisfies all four requirements better than most alternatives. Falcon's smaller signatures are attractive, but the sampling complexity increases implementation risk, particularly on constrained hardware like hardware security modules (HSMs) and hardware wallets. SPHINCS+ is a credible fallback due to its minimal mathematical assumptions (only hash function security), but its large signatures are punishing at scale.
Hybrid Schemes During Migration
Most serious cryptographic engineering guidance, including NIST's own migration framework and ETSI guidance, recommends hybrid signatures during the transition period: a classical signature (e.g., Ed25519) and an ML-DSA signature are both computed and both verified. This ensures security against both classical and quantum adversaries simultaneously, protecting against the possibility that a new cryptanalytic result weakens ML-DSA before migration is complete.
BMIC.ai's quantum-resistant wallet implements post-quantum cryptography aligned with NIST's PQC standards, including the lattice-based primitives discussed in this article, to protect holdings against the Q-day threat.
---
Implementing ML-DSA: Practical Considerations
Key Generation
Key generation samples two small secret polynomials s1 and s2, computes t = As1 + s2, and publishes (A, t) as the public key. The matrix A is derived deterministically from a public seed, so it need not be transmitted explicitly. Key generation is fast, on the order of microseconds on modern hardware.
Signing Performance
Signing involves a rejection-sampling loop. The expected number of restarts is low (typically 1 to 4 iterations depending on the parameter set), making average-case performance acceptable. In benchmarks on a modern x86-64 processor with AVX2:
- ML-DSA-44: ~125,000 signatures/second, ~450,000 verifications/second.
- ML-DSA-65: ~80,000 signatures/second, ~300,000 verifications/second.
- ML-DSA-87: ~55,000 signatures/second, ~220,000 verifications/second.
These figures are comfortably within the performance envelope of most blockchain node and wallet applications.
Constant-Time Implementation
Lattice arithmetic involves polynomial multiplication over rings, typically accelerated by the Number Theoretic Transform (NTT), a modular analogue of the Fast Fourier Transform. NTT-based multiplication is data-independent and inherently amenable to constant-time implementation, reducing timing side-channel risk. This is a meaningful advantage over Falcon's Gaussian sampling, where constant-time guarantees are harder to achieve.
Library Ecosystem
Production-ready libraries as of 2024-2025 include:
- liboqs (Open Quantum Safe project): C, with language bindings for Python, Go, Java, .NET.
- pqcrypto crate (Rust): wraps liboqs and native Rust implementations.
- dilithium pure-Rust crate: standalone, no C dependency.
- CIRCL (Cloudflare): Go implementation, production-grade.
- BouncyCastle (Java/C#): includes FIPS 204-aligned ML-DSA.
All major implementations have received or are undergoing independent security audits. Before integrating any library into a production wallet or signing infrastructure, verify audit status and check for published CVEs.
---
The Road Ahead for ML-DSA Adoption
FIPS 204 is a final standard, not a draft. Government agencies in the US are already required to plan migration timelines. The financial sector, including digital asset custodians and exchange infrastructure, is expected to follow regulatory guidance that will increasingly mandate PQC-readiness.
For blockchain protocols, the migration path is more complex. Changing signature schemes requires consensus-layer upgrades, potential hard forks, and backward-compatibility decisions about legacy addresses. Several Layer 2 protocols and newer L1 chains are exploring ML-DSA integration at the protocol level from inception, avoiding the retrofit problem entirely.
Key open questions for the next 3 to 5 years:
- Address format changes: How to encode larger ML-DSA public keys in address standards without bloating the address space.
- Fee market adjustments: Whether fee-per-byte models need rethinking when post-quantum transactions are 10 to 30 times larger.
- Hardware wallet support: Embedding ML-DSA in constrained devices (e.g., 256 KB RAM secure elements) requires careful memory management.
- Hybrid transition standards: Standardising hybrid signature formats so that multi-vendor ecosystems interoperate cleanly.
None of these are unsolved problems in principle. They are engineering and governance challenges that the industry is actively working through.
Frequently Asked Questions
What is the difference between ML-DSA and CRYSTALS-Dilithium?
They are the same algorithm. CRYSTALS-Dilithium was the submission name used throughout NIST's PQC standardisation competition. When NIST published the final standard in August 2024 as FIPS 204, it was renamed ML-DSA (Module Lattice-based Digital Signature Algorithm). The underlying mathematics and parameter sets are aligned, though FIPS 204 includes minor clarifications and a domain-separation mechanism not present in all earlier Dilithium versions.
Is ML-DSA secure against quantum computers?
ML-DSA's security reduces to the Module Learning With Errors (MLWE) and Module Short Integer Solution (MSIS) problems. No known quantum algorithm, including Shor's algorithm or Grover's algorithm, solves these problems significantly faster than the best classical algorithms. NIST selected ML-DSA specifically because of this resistance. That said, cryptographic security is always conditional on the current state of cryptanalysis, and no mathematical proof of hardness exists for any lattice problem.
Why are ML-DSA signatures so much larger than ECDSA signatures?
The size difference reflects the underlying mathematical structure. ECDSA signatures can be compact (64–71 bytes) because they operate over elliptic curve groups with very efficient encodings. ML-DSA signatures encode polynomial vectors in a module lattice, which requires more coefficients to achieve comparable security margins against both classical and quantum adversaries. The smallest ML-DSA parameter set (ML-DSA-44) produces ~2,420-byte signatures. Research into more compact lattice signatures (such as Falcon) can reduce this, but at the cost of implementation complexity.
Which ML-DSA parameter set should a wallet use?
For most cryptocurrency wallet applications, ML-DSA-44 (NIST Security Level 2, ~128-bit classical security) provides a reasonable starting point. It offers the smallest keys and signatures in the ML-DSA family while still providing substantial post-quantum security margins. Applications with longer-term security requirements, such as cold storage or institutional custody, may prefer ML-DSA-65 or ML-DSA-87. Follow the guidance of the specific protocol or regulatory framework you are targeting.
Can ML-DSA be used alongside ECDSA in a hybrid scheme?
Yes, and this is the recommended migration approach according to NIST, ETSI, and most cryptographic engineering guidance. A hybrid signature includes both a classical signature (e.g., Ed25519) and an ML-DSA signature. Verification requires both to pass. This protects against both classical adversaries (in case ML-DSA has an undiscovered weakness) and quantum adversaries (which can break ECDSA). The trade-off is larger combined signature sizes during the transition period.
When will major blockchains adopt ML-DSA?
There is no confirmed adoption date for Bitcoin, Ethereum, or other major Layer 1 protocols as of mid-2025. Migration requires consensus-layer changes, community agreement, and extensive testing. Some newer Layer 1 and Layer 2 protocols are building in post-quantum signature support from the start. Ethereum researchers have discussed PQC account abstraction paths. Realistically, broad protocol-level migration is a multi-year effort; wallet-level and custodian-level adoption can happen faster and is already underway in some projects.