Post-Quantum Cryptography Suite for Lux Network
Comprehensive specification for NIST-standardized post-quantum cryptographic algorithms
Abstract
This proposal establishes the complete post-quantum cryptography suite for the Lux Network, integrating NIST FIPS 203-205 standardized algorithms (ML-KEM, ML-DSA, SLH-DSA) alongside Lux-native schemes (Ringtail threshold signatures, Lamport OTS) to provide quantum-resistant security for all blockchain operations. The suite enables confidential AI compute and private finance applications through lattice-based and hash-based cryptographic primitives that resist attacks from both classical and quantum computers. Ringtail provides post-quantum threshold signatures for T-Chain MPC custody, while Lamport OTS enables quantum resistance on any remote EVM chain.
Motivation
With quantum computers approaching the threshold to break current elliptic curve and RSA cryptography (estimated 10,000 logical qubits by 2030), blockchain networks must transition to post-quantum algorithms. This is particularly critical for:
- AI Confidential Compute: Protecting model parameters and inference data
- Private Finance: Securing long-term financial contracts and custody
- Validator Security: Preventing quantum attacks on consensus
- State Proofs: Ensuring merkle proofs remain unforgeable
Specification
1. ML-KEM (Module-Lattice Key Encapsulation Mechanism) - FIPS 203
Algorithm Parameters
| Parameter Set | Security Level | Public Key | Private Key | Ciphertext | Shared Secret |
|---|---|---|---|---|---|
| ML-KEM-512 | NIST Level 1 (128-bit) | 800 B | 1,632 B | 768 B | 32 B |
| ML-KEM-768 | NIST Level 3 (192-bit) | 1,184 B | 2,400 B | 1,088 B | 32 B |
| ML-KEM-1024 | NIST Level 5 (256-bit) | 1,568 B | 3,168 B | 1,568 B | 32 B |
Implementation
package mlkem
import (
"crypto/rand"
"github.com/cloudflare/circl/kem/mlkem768" // Reference implementation
)
type KEMScheme interface {
GenerateKeyPair(rand io.Reader) (PublicKey, PrivateKey, error)
Encapsulate(rand io.Reader, pk PublicKey) (ct []byte, ss []byte, error)
Decapsulate(sk PrivateKey, ct []byte) (ss []byte, error)
}
// Security proof: Based on Module-LWE problem
// Reduction: If Module-LWE is hard, ML-KEM is IND-CCA2 secure
// Reference: Bos et al., "CRYSTALS-Kyber: A CCA-Secure Module-Lattice-Based KEM"
EVM Precompiled Contracts
// ML-KEM precompiles for EVM integration
address constant ML_KEM_512_ENCAP = 0x0000000000000000000000000000000000000120;
address constant ML_KEM_768_ENCAP = 0x0000000000000000000000000000000000000121;
address constant ML_KEM_1024_ENCAP = 0x0000000000000000000000000000000000000122;
address constant ML_KEM_DECAP = 0x0000000000000000000000000000000000000123;
// Gas costs based on computational complexity
uint256 constant GAS_ML_KEM_ENCAP = 500_000;
uint256 constant GAS_ML_KEM_DECAP = 600_000;
2. ML-DSA (Module-Lattice Digital Signature Algorithm) - FIPS 204
Algorithm Parameters
| Parameter Set | Security Level | Public Key | Private Key | Signature | Signing Ops/sec | Verification Ops/sec |
|---|---|---|---|---|---|---|
| ML-DSA-44 | NIST Level 2 (128-bit) | 1,312 B | 2,560 B | 2,420 B | 40,000 | 45,000 |
| ML-DSA-65 | NIST Level 3 (192-bit) | 1,952 B | 4,032 B | 3,309 B | 35,000 | 40,000 |
| ML-DSA-87 | NIST Level 5 (256-bit) | 2,592 B | 4,896 B | 4,627 B | 30,000 | 35,000 |
EVM Optimization (ETH-ML-DSA)
Based on ZKNOX ETHDILITHIUM research:
// Optimizations for EVM execution
contract ETHMDLSA {
// Replace SHAKE with Keccak256 (native opcode)
function expandSeedOptimized(bytes32 seed) internal pure returns (bytes memory) {
bytes memory output = new bytes(EXPANSION_SIZE);
for (uint i = 0; i < BLOCKS; i++) {
bytes32 block = keccak256(abi.encode(seed, i));
// 8x gas reduction: 4M → 500K gas
}
return output;
}
// Store NTT precomputed public keys
mapping(address => bytes) public nttPublicKeys;
// Verification with precomputed NTT: 13M → 4M gas
function verifyOptimized(
bytes32 message,
bytes memory signature,
bytes memory pubkeyNTT
) public view returns (bool) {
(bool success,) = ML_DSA_OPTIMIZED.staticcall(
abi.encode(message, signature, pubkeyNTT)
);
return success;
}
}
Security Analysis
Security Reduction: ML-DSA → Module-SIS + Module-LWE
Quantum Security: 128/192/256-bit against Grover's algorithm
Classical Security: 256/384/512-bit against lattice reduction
Reference: Ducas et al., "CRYSTALS-Dilithium: Digital Signatures from Module Lattices"
NIST PQC Round 3 Winner - Selected July 2022
3. SLH-DSA (Stateless Hash-Based Digital Signature Algorithm) - FIPS 205
Algorithm Parameters
| Parameter Set | Security | Public Key | Private Key | Signature | Use Case |
|---|---|---|---|---|---|
| SLH-DSA-SHA2-128s | Level 1 | 32 B | 64 B | 7,856 B | Small signatures |
| SLH-DSA-SHA2-128f | Level 1 | 32 B | 64 B | 17,088 B | Fast signing |
| SLH-DSA-SHA2-192s | Level 3 | 48 B | 96 B | 16,224 B | Balanced |
| SLH-DSA-SHA2-256s | Level 5 | 64 B | 128 B | 29,792 B | Maximum security |
Implementation Strategy
package slhdsa
// Stateless design - no state management required
type SLHDSAKey struct {
mode Mode
publicKey []byte // 32-64 bytes only!
secretKey []byte
}
// Perfect for long-term security (50+ years)
func (k *SLHDSAKey) Sign(message []byte) []byte {
// Deterministic, no RNG failures possible
// Based solely on hash function security
return sphincsSign(k.secretKey, message)
}
// Security: Only assumes collision resistance of SHA-256/SHA3
// No algebraic structure that quantum computers can exploit
4. Hybrid Cryptography Mode
Transition Strategy
type HybridSigner struct {
classical ECDSAKey // For compatibility
quantum MLDSAKey // For security
mode HybridMode // AND or OR validation
}
func (h *HybridSigner) Sign(msg []byte) *HybridSignature {
return &HybridSignature{
Classical: h.classical.Sign(msg),
Quantum: h.quantum.Sign(msg),
Mode: h.mode,
}
}
func VerifyHybrid(msg []byte, sig *HybridSignature, pubkeys *HybridPublicKey) bool {
classicalValid := ecdsa.Verify(msg, sig.Classical, pubkeys.Classical)
quantumValid := mldsa.Verify(msg, sig.Quantum, pubkeys.Quantum)
switch sig.Mode {
case HybridAND:
return classicalValid && quantumValid // Both must pass
case HybridOR:
return classicalValid || quantumValid // Either passes
}
}
5. AI Confidential Compute Applications
Secure Multi-Party Computation
type ConfidentialAICompute struct {
// Lattice-based homomorphic properties
encryptionScheme *MLKEMScheme
// Threshold signatures for distributed inference
signatureScheme *MLDSAThreshold
// Secure model parameter sharing
secretSharing *LatticeShamir
}
func (c *ConfidentialAICompute) SecureInference(
encryptedInput []byte,
modelShards []ModelShard,
) ([]byte, error) {
// Each compute node processes encrypted data
results := make([][]byte, len(modelShards))
for i, shard := range modelShards {
// Homomorphic computation on encrypted data
results[i] = shard.ComputeOnEncrypted(encryptedInput)
}
// Aggregate results while preserving privacy
return c.secretSharing.Reconstruct(results)
}
Private Finance Integration
contract QuantumSafeDeFi {
// Long-term value locks with quantum resistance
struct TimeLock {
uint256 amount;
uint256 unlockTime; // Can be 50+ years
bytes32 slhdsaPublicKey; // Only 32 bytes!
bytes quantumProof;
}
// Zero-knowledge proofs with lattice cryptography
function proveBalanceGTE(
uint256 threshold,
bytes memory latticeProof
) public view returns (bool) {
// Verify using lattice-based ZK-SNARK
return verifyLatticeProof(latticeProof, threshold);
}
}
Rationale
Why NIST Algorithms?
- Standardization: FIPS 203-205 provide formal security definitions
- Analysis: 7+ years of cryptanalysis by global researchers
- Implementation: Reference implementations available
- Hardware: Expected support in secure elements
Why Lattice-Based?
- Efficiency: Better performance than code/multivariate alternatives
- Versatility: Supports encryption, signatures, and advanced protocols
- Security: Based on worst-case to average-case reductions
- Future-Proof: Resistant to known quantum algorithms
Performance Considerations
Benchmarks (AMD EPYC 7763, single-threaded):
ML-KEM-768:
KeyGen: 20 μs
Encaps: 25 μs
Decaps: 30 μs
ML-DSA-65:
KeyGen: 30 μs
Sign: 100 μs
Verify: 35 μs
SLH-DSA-192s:
KeyGen: 10 μs
Sign: 25 ms
Verify: 2 ms
Hardware Acceleration (with AVX2/SHA extensions):
2-3x speedup for lattice operations
5x speedup for hash operations
Backwards Compatibility
The hybrid mode ensures complete backwards compatibility:
- Phase 1 (Months 1-3): Deploy alongside classical crypto
- Phase 2 (Months 4-6): Require both signatures
- Phase 3 (Months 7-9): Quantum primary, classical fallback
- Phase 4 (Month 10+): Quantum-only for new accounts
Test Cases
func TestQuantumSuite(t *testing.T) {
// Test ML-KEM key exchange
kemPub, kemPriv, _ := mlkem.GenerateKeyPair(rand.Reader)
ct, ss1, _ := mlkem.Encapsulate(rand.Reader, kemPub)
ss2, _ := mlkem.Decapsulate(kemPriv, ct)
assert.Equal(t, ss1, ss2)
// Test ML-DSA signatures
dsaPub, dsaPriv, _ := mldsa.GenerateKeyPair(rand.Reader)
msg := []byte("quantum resistant message")
sig, _ := mldsa.Sign(dsaPriv, msg)
assert.True(t, mldsa.Verify(dsaPub, msg, sig))
// Test hybrid validation
hybridSig := signHybrid(msg, classicalKey, quantumKey)
assert.True(t, verifyHybrid(msg, hybridSig, hybridPubKey))
}
Reference Implementation
Complete implementation available at: https://github.com/luxfi/crypto
Security Considerations
- Side-Channel Resistance: All implementations use constant-time operations
- RNG Quality: Require NIST SP 800-90A compliant random number generators
- Key Storage: Larger keys require secure hardware/software key management
- Migration Risks: Hybrid mode prevents single point of failure during transition
- Quantum Timeline: Monitor NIST and NSA guidance on quantum threat evolution
6. Lux-Native Post-Quantum Schemes
Ringtail: Post-Quantum Threshold Signatures (LP-7324)
Ringtail is Lux's own post-quantum threshold signature scheme, providing distributed signing with quantum resistance:
// Ringtail: Ring-LWE based threshold signatures
type RingtailScheme struct {
threshold uint16 // Minimum signers required (t of n)
totalNodes uint16 // Total participants
modulusQ *big.Int // Lattice modulus
dimension uint16 // Ring dimension (n=1024)
}
// Two-round threshold protocol
func (r *RingtailScheme) ThresholdSign(
message []byte,
partialSigs []PartialSignature,
) (*RingtailSignature, error) {
// Round 1: Commitment phase (each signer commits)
// Round 2: Response phase (aggregate into final signature)
return aggregateRingtailSignatures(partialSigs, message)
}
Precompile Address: 0x020000000000000000000000000000000000000B
Integration with Quasar Consensus:
- Dual-certificate finality: BLS (classical) + Ringtail (quantum-safe)
- T-Chain threshold MPC custody uses Ringtail for quantum resistance
- Sub-second finality with post-quantum security guarantees
Lamport OTS: Hash-Based One-Time Signatures (LP-4105)
Lamport One-Time Signatures provide quantum resistance for remote chains secured by T-Chain MPC:
// Lamport OTS for any EVM chain - no lattice math required
contract LamportBase {
// 256-bit security using only hash functions
function verify_u256(
uint256 bits,
bytes[256] calldata sig,
bytes32[2][256] calldata pub
) public pure returns (bool) {
for (uint256 i; i < 256; i++) {
if (pub[i][((bits & (1 << (255 - i))) > 0) ? 1 : 0] !=
keccak256(sig[i])) return false;
}
return true;
}
}
Use Cases:
- Remote chain custody (any EVM chain without PQC precompiles)
- T-Chain MPC wallet integration (threshold custody + PQC)
- Lux Safe multisig with quantum-resistant recovery
- Bridge security with post-quantum attestations
Migration Path:
ECDSA_ONLY: Classical signatures (current state)DUAL_SIGNATURES: ECDSA + Lamport OTS (hybrid security)LAMPORT_PREFERRED: Lamport primary, ECDSA fallbackLAMPORT_ONLY: Full quantum resistance
7. Complete PQC Ecosystem
The Lux PQC ecosystem provides defense-in-depth with multiple complementary schemes:
| Scheme | Type | Use Case | Chain |
|---|---|---|---|
| ML-KEM | Key Exchange | Confidential compute, encrypted channels | Q-Chain |
| ML-DSA | Signatures | Validator attestations, consensus | Q-Chain |
| SLH-DSA | Signatures | Long-term archives (50+ years) | Q-Chain |
| Ringtail | Threshold Sigs | Distributed signing, T-Chain custody | T-Chain |
| Lamport OTS | One-Time Sigs | Remote chains, Safe wallets | Any EVM |
T-Chain Integration:
- T-Chain (Threshold Chain) provides MPC custody secured by Ringtail
- Remote chains use Lamport OTS with T-Chain as the trusted signer set
- Quasar consensus achieves finality with BLS + Ringtail dual certificates
References
Related Lux Proposals
NIST-Standardized Algorithms
- LP-4316: ML-DSA Post-Quantum Digital Signatures
- LP-4317: SLH-DSA Stateless Hash-Based Digital Signatures
- LP-4318: ML-KEM Post-Quantum Key Encapsulation
Lux-Native Schemes
- LP-7324: Ringtail Threshold Signature Precompile - Post-quantum threshold signatures
- LP-4105: Lamport One-Time Signatures for Lux Safe - Hash-based OTS for remote chains
Hybrid & Transition
Integration
- LP-7000: T-Chain Threshold Specification - MPC custody chain
- LP-4099: Q-Chain Quantum-Secure Consensus
NIST Standards
- FIPS 203: Module-Lattice-Based Key-Encapsulation Mechanism
- FIPS 204: Module-Lattice-Based Digital Signature Algorithm
- FIPS 205: Stateless Hash-Based Digital Signature Algorithm
- Regev, O. "On lattices, learning with errors, random linear codes, and cryptography"
- Peikert, C. "A Decade of Lattice Cryptography"
- NIST Post-Quantum Cryptography Standardization
Implementation References
Copyright
Copyright and related rights waived via CC0.