Skip to main content

Post-Quantum Cryptography

Quantus replaces every quantum-vulnerable cryptographic primitive in the blockchain stack. This page covers the three PQC systems: transaction signatures, P2P encryption, and hierarchical deterministic wallet derivation.

The Quantum Threat

Shor's algorithm, running on a sufficiently powerful quantum computer, can break:

  • ECDSA (Bitcoin, Ethereum transaction signatures)
  • RSA (legacy systems)
  • Diffie-Hellman (key exchange)

Hash functions like SHA-256 are weakened by Grover's algorithm (security halved) but not broken. The practical timeline is debated, but NIST has already standardized post-quantum replacements -- the threat is real enough that the US government mandated migration by 2035.

ML-DSA-87 (Dilithium) -- Transaction Signatures

Every Quantus transaction is signed with ML-DSA-87 (formerly CRYSTALS-Dilithium), the NIST post-quantum digital signature standard.

How It Works

Dilithium is a lattice-based signature scheme. Its security relies on the hardness of the Module Learning With Errors (MLWE) problem, which has no known efficient quantum algorithm.

PropertyValue
Security LevelNIST Level 5 (equivalent to AES-256)
Public Key Size~2,592 bytes
Signature Size~4,627 bytes
Verification Time~2-3ms (vs ~0.5ms for ECDSA)
Quantum ResistantYes -- based on lattice problems

Integration in Quantus

// Runtime type definitions
pub type Signature = DilithiumSignatureScheme;
pub type AccountId = <<Signature as Verify>::Signer as IdentifyAccount>::AccountId;

Dilithium is the only signature scheme in the runtime. There is no fallback to ECDSA. Addresses use SS58 format with prefix 189 (addresses start with qz...).

Source: qp-rusty-crystals -- Pure-Rust, no-std, constant-time implementation. Audited by Neodyme.

The Signature Size Problem

The 70x size increase from ECDSA to Dilithium is the core challenge:

MetricECDSA (Bitcoin)ML-DSA-87 (Quantus)
Signature~65 bytes~4,627 bytes
Public Key~33 bytes~2,592 bytes
Per-transaction overhead~98 bytes~7,219 bytes

This is why Quantus uses Wormhole addresses with ZK proof aggregation to compress thousands of transactions into a single proof.

ML-KEM-768 (Kyber) -- P2P Encryption

Node-to-node communication is encrypted using ML-KEM-768 (formerly CRYSTALS-Kyber), the NIST post-quantum key encapsulation mechanism.

PropertyValue
Security LevelNIST Level 3
Ciphertext Size1,088 bytes
Shared Secret Size32 bytes
PurposeSecure P2P channel establishment

Quantus forked the Rust libp2p networking stack to replace classical key exchange with ML-KEM-768 and peer identity authentication with ML-DSA-87:

This means the entire communication layer is quantum-secure, not just the transactions.

HD-Lattice Wallets -- Key Derivation

Standard BIP-32 hierarchical deterministic (HD) wallets rely on elliptic curve algebra that doesn't exist in lattice cryptography. Quantus implements a custom HD derivation scheme adapted for lattice-based keys.

Derivation Path

Following BIP-44 structure:

m / 44' / 189189' / account' / 0' / 0'
ComponentValueMeaning
Purpose44'BIP-44 standard
Coin Type189189'Quantus Network identifier
Accountindex'Account index (configurable)
Change0'External chain
Address0'First address

All components are hardened (indicated by ') because lattice-based key derivation requires it -- unhardened derivation would leak information about the parent key.

How It Works

  1. Generate or restore a 24-word BIP-39 mnemonic
  2. Derive a 64-byte seed using standard BIP-39 mnemonic_to_seed()
  3. Apply HMAC-based derivation along the path, using each step's output as entropy for lattice key generation
  4. Generate a Dilithium keypair from the final derived seed
# Generate a new key
./quantus-node key quantus

# Restore from mnemonic
./quantus-node key quantus --words "autumn bear..."

# Restore from seed
./quantus-node key quantus --seed "<64-HEX-STRING>"

Source: qp-rusty-crystals (hdwallet module)

Poseidon2 -- ZK-Friendly Hashing

While not a PQC algorithm per se (hash functions are already quantum-resistant), Poseidon2 was chosen specifically for zero-knowledge proof efficiency:

PropertyPoseidon2SHA-256Blake2
ZK circuit constraints~300~25,000~10,000
Native speedSlowerFastFastest
ZK-circuit speedFastestSlowestSlow

Poseidon2 uses arithmetic operations over prime fields, which map directly to ZK circuit operations. This makes it ~100x more efficient than SHA-256 inside a ZK proof.

Where Poseidon2 is Used

  • Block headers -- All block hashes use PoseidonHasher
  • Storage trie -- State trie uses Poseidon for ZK-compatible storage proofs
  • QPoW mining -- Double Poseidon2 hashing for proof-of-work
  • Wormhole circuits -- Merkle proof verification inside ZK proofs

Sources: qp-poseidon, qp-poseidon-constants

Cryptographic Dependency Map

External Audits

AuditorScopeStatus
NeodymeML-DSA-87 implementation (qp-rusty-crystals)Completed
EigerHash algorithm and consensusCompleted
EigerZK circuits (qp-zk-circuits)In progress
HashcloakThreshold signatures (near-mpc)In progress