# Dilithium5

### **1. Overview**

**Dilithium5** is a **NIST-standardized** (FIPS 204) post-quantum digital signature scheme based on **hard lattice problems**. As the highest security variant of the CRYSTALS-Dilithium family, it provides 256-bit security against quantum attacks while maintaining practical performance for blockchain use cases.

#### **Key Features**

* **NIST PQC Winner**: Selected as the primary standard for post-quantum signatures (2024).
* **Optimal Balance**: 256-bit quantum security with faster verification than RSA/ECDSA.
* **On-Chain Optimized**: Modified for QAN’s hybrid EVM (reduced key sizes via BLAKE3 hashing).

***

### **2. Technical Specifications**

#### **2.1 Algorithm Parameters**

| Parameter            | Dilithium5 Specification                  |
| -------------------- | ----------------------------------------- |
| **Security Level**   | 256-bit (NIST L5)                         |
| **Base Problem**     | Module-LWE + Module-SIS                   |
| **Signature Size**   | 4,592 bytes (compressed to 2.8 KB in QAN) |
| **Public Key Size**  | 1,312 bytes                               |
| **Private Key Size** | 2,560 bytes                               |

#### **2.2 Performance Benchmarks**

| Operation    | QAN Testnet (w/ Hardware Acceleration) |
| ------------ | -------------------------------------- |
| Verification | \~12 ms (*3x faster than RSA-4096*)    |

*Note: Benchmarked on QAN’s quantum-resistant VM with Intel SGX enclaves.*

***

### **3. QAN-Specific Optimizations**

#### **Key Size Compression**

QAN reduces Dilithium5’s native key sizes by:

* **BLAKE3 Hashing**: Compresses public keys from 1.3 KB → 0.9 KB.
* **Key Reuse**: Session-based ephemeral keys for smart contracts.

***

### **4. Comparative Analysis**

#### **4.1 vs. Classical Algorithms**

| Metric            | Dilithium5 | ECDSA (secp256k1) |
| ----------------- | ---------- | ----------------- |
| **Quantum-Safe?** | ✅ Yes      | ❌ No              |
| **Sig Verify**    | 12 ms      | 5 ms              |
| **Key Size**      | 1.3 KB     | 64 B              |

#### **4.2 vs. Other PQC Algorithms**

| Algorithm      | Security | Sig Size | Verification Speed |
| -------------- | -------- | -------- | ------------------ |
| **Dilithium5** | 256-bit  | 2.8 KB   | ⚡ 12 ms            |
| MLDSA-87       | 87-bit   | 2.5 KB   | ⚡ 10 ms            |
| Falcon-1024    | 256-bit  | 1.3 KB   | 🐢 38 ms           |

***

### **5. Use Cases in QAN**

* **High-Value Transactions**: Government, central bank digital currencies (CBDCs).
* **Smart Contract Oracles**: Tamper-proof data feeds with quantum-safe auth.
* **NFT Royalties**: Immutable signature chains for IP ownership.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://qanchain.gitbook.io/qan/quantum-proof-onchain/dilithium5.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
