Q-Chain - Core Quantum-Resistant Specification (Canonical Crypto Umbrella)
Q-Chain (Quantum Chain) core spec and canonical 4xxx-crypto umbrella. Supersedes LP-4200 (merged in).
Implementation status (code-audited 2026-07-03): PARTIAL quantumvm VMID (constants/vm_ids.go:39-40) with ML-DSA + SLH-DSA hybrid signer confirmed (chains/quantumvm/quantum/signer.go:16,32-35); ML-KEM not used by quantumvm; QuantumStamp is the C-Chain dual-signature form (stamper/quantum_stamper.go:53-77).
Normative topology + fee model: LP-0130. Q-Chain has no user-payable blockspace (LP-0130 §6): finality cert inclusion is a validator obligation paid via P-Chain reward distribution, not a user fee. This eliminates the finality-hostage failure mode where a hostile fee market on Q could deny finality. Q-Chain is also the reconciliation point for the Σ-escrow invariant (LP-0130 I-8): at every checkpoint,
Σ non-P/X fee balances == Σ X-side fee escrow; drift is a finality-blocking fault.
Provenance
LP-4000 has a dual role under the unified-4xxx consolidation:
- Q-Chain core specification (original).
- Canonical 4xxx-crypto umbrella (added 2026-05-18). LP-4200 is superseded by this LP.
4xxx sub-range index:
- 4000-4099 — Cross-cuts (umbrella, agility, hybrid policy, integration)
- 4100-4199 — Classical curves (BLS12-381, BN254, secp256k1, secp256r1)
- 4200-4299 — Classical signatures (Ed25519, Schnorr, ECDSA, Ring, multisig)
- 4300-4399 — Classical hashes (BLAKE2b, BLAKE3, SHA-256, Keccak-256, Poseidon, RIPEMD160)
- 4400-4499 — PQ lattice sigs (ML-DSA, Pulsar)
- 4500-4599 — PQ hash sigs (SLH-DSA, Magnetar, Lamport)
- 4600-4699 — PQ KEM (ML-KEM, HQC)
- 4700-4799 — Threshold + MPC (FROST, CGGMP21, LSS)
- 4800-4899 — ZK / STARK / SNARK (P3Q, KZG)
- 4900-4999 — Hybrid envelopes + cert profiles (Aurora, Polaris, X-Wing, X-Wing+)
See NUMBER-PLAN-2026-05-18.md and CRYPTO-MIGRATION-2026-05-18.md.
Abstract
LP-4000 specifies the Q-Chain (Quantum-Resistant Chain), Lux Network's specialized chain for post-quantum cryptographic operations. The Q-Chain implements NIST-approved PQ algorithms (ML-KEM, ML-DSA, SLH-DSA) and provides quantum timestamping for cross-chain operations.
Specification
Chain Parameters
| Parameter | Value |
|---|---|
| Chain ID | Q |
| VM ID | quantumvm (constants.QuantumVMID) |
| VM Name | quantumvm |
| Network ID (Mainnet) | 36963 |
| Network ID (Testnet) | 36962 |
| Block Time | 2 seconds |
| Consensus | Quasar (quantum-aware) |
Implementation
Go Package: github.com/luxfi/chains/quantumvm (VM) + github.com/luxfi/crypto/{mlkem,mldsa,slhdsa} (primitives)
import (
qvm "github.com/luxfi/node/vms/quantumvm"
"github.com/luxfi/node/utils/constants"
)
var QVMID = constants.QVMID // ids.ID{'q', 'v', 'm'}
factory := &qvm.Factory{}
vm, err := factory.New(logger)
node/vms/quantumvm/
├── config/ # Chain configuration
├── quantum/ # Post-quantum primitives
├── stamper/ # Quantum timestamp service
├── factory.go # VM factory
├── vm.go # Main VM implementation
└── *_test.go # Tests
node/crypto/
├── mlkem/ # ML-KEM (FIPS 203)
├── mldsa/ # ML-DSA (FIPS 204)
└── slhdsa/ # SLH-DSA (FIPS 205)
ML-KEM (FIPS 203)
import "github.com/luxfi/node/crypto/mlkem"
pk, sk, err := mlkem.GenerateKey768()
ciphertext, sharedSecret, err := mlkem.Encapsulate768(pk)
sharedSecret, err := mlkem.Decapsulate768(ciphertext, sk)
| Variant | Security | Public Key | Ciphertext |
|---|---|---|---|
| ML-KEM-768 | 128-bit | 1,184 B | 1,088 B |
| ML-KEM-1024 | 192-bit | 1,568 B | 1,568 B |
ML-DSA (FIPS 204)
import "github.com/luxfi/node/crypto/mldsa"
pk, sk, err := mldsa.GenerateKey65()
signature, err := mldsa.Sign65(sk, message)
valid, err := mldsa.Verify65(pk, message, signature)
| Variant | Security | Public Key | Signature |
|---|---|---|---|
| ML-DSA-44 | 128-bit | 1,312 B | 2,420 B |
| ML-DSA-65 | 192-bit | 1,952 B | 3,309 B |
| ML-DSA-87 | 256-bit | 2,592 B | 4,627 B |
SLH-DSA (FIPS 205)
import "github.com/luxfi/node/crypto/slhdsa"
pk, sk, err := slhdsa.GenerateKey()
signature, err := slhdsa.Sign(sk, message)
valid, err := slhdsa.Verify(pk, message, signature)
Quantum Stamping
type QuantumStamp struct {
ChainID ids.ID `json:"chainId"`
BlockHash [32]byte `json:"blockHash"`
BlockHeight uint64 `json:"blockHeight"`
Timestamp time.Time `json:"timestamp"`
Signature []byte `json:"signature"` // ML-DSA signature
PublicKey []byte `json:"publicKey"`
}
stamp, err := qvm.CreateQuantumStamp(chainID, blockHash, blockHeight)
valid, err := qvm.VerifyQuantumStamp(stamp)
Transaction Types
| Type | Description |
|---|---|
QuantumTransfer | Transfer assets with PQ signatures |
KeyRotation | Rotate quantum keys |
StampRequest | Request quantum timestamp |
StampVerify | Verify quantum timestamp |
HybridSign | Classical + PQ signature |
Cross-Chain Integration
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ C-Chain │────▶│ Q-Chain │────▶│ B-Chain │
│ (Source) │ │ (Stamp) │ │ (Bridge) │
└─────────────┘ └─────────────┘ └─────────────┘
│ │ │
│ Request Stamp │ │
│──────────────────▶│ │
│ Return Stamp │ │
│◀──────────────────│ │
│ Cross-chain with PQ stamp │
│──────────────────────────────────────▶│
RPC + REST
| Method | Description |
|---|---|
quantum.getStamp | Get quantum stamp for block |
quantum.verifyStamp | Verify quantum stamp |
quantum.getPublicKey | Get node's quantum public key |
quantum.signMessage | Sign message with quantum key |
quantum.verifySignature | Verify quantum signature |
GET /v1/bc/Q/quantum/stamp/{chainId}/{blockHeight}
POST /v1/bc/Q/quantum/verify
GET /v1/bc/Q/quantum/keys
POST /v1/bc/Q/quantum/rotate
Configuration
{
"quantumvm": {
"signatureScheme": "ML-DSA-65",
"keyEncapsulation": "ML-KEM-768",
"stampingEnabled": true,
"stampExpirySeconds": 3600,
"parallelVerification": true,
"maxVerifyWorkers": 8,
"hybridMode": true
}
}
Performance
| Operation | Time |
|---|---|
| ML-DSA-65 Sign | 0.5 ms |
| ML-DSA-65 Verify | 0.2 ms |
| ML-KEM-768 Encap | 0.3 ms |
| ML-KEM-768 Decap | 0.2 ms |
| Parallel Verify (8) | 0.03 ms / signature |
Rationale
Separate chain enables independent upgrades. NIST algorithms only. Stamping service brings quantum security to other chains without modifying them. Hybrid mode bridges the transition.
Backwards Compatibility
LP-4000 supersedes LP-0082. Both numbers resolve to this document.
Test Cases
github.com/luxfi/node/vms/quantumvm/*_test.go:
func TestQuantumSigner(t *testing.T)
func TestParallelVerification(t *testing.T)
func TestConfigValidation(t *testing.T)
func TestQuantumStampExpiration(t *testing.T)
func TestMLKEMKeyExchange(t *testing.T)
func TestMLDSASignVerify(t *testing.T)
Reference Implementation
github.com/luxfi/node — vms/quantumvm, crypto/{mlkem,mldsa,slhdsa}.
Security Considerations
Assumes quantum computers capable of breaking classical crypto. Implementations must be constant-time (side-channel resistance). Quantum keys require larger storage. Hybrid mode prevents "harvest now, decrypt later".
Related LPs
| LP | Relationship |
|---|---|
| LP-0082 | Superseded by this LP |
| LP-4100 | ML-KEM sub-specification |
| LP-4200 | ML-DSA sub-specification |
| LP-4300 | SLH-DSA sub-specification |
| LP-4400 | Quantum Stamping sub-specification |
| LP-4500 | Key Management sub-specification |
Copyright
Copyright and related rights waived via CC0.