Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
comparison-of-consensus-mechanisms
Blog

Why Code-Based Cryptography Is Fading for Blockchain Use

An analysis of why code-based schemes, despite NIST approval, are being sidelined by blockchain architects in favor of lattice-based and hash-based alternatives due to fundamental performance constraints.

introduction
THE SHIFT

Introduction

Code-based cryptography is being displaced by intent-based architectures as the primary paradigm for user-centric blockchain applications.

Code-based cryptography is failing users. It forces users to understand complex transaction mechanics like gas management and slippage tolerance, creating a hostile UX that limits adoption.

Intent abstraction is the new standard. Protocols like UniswapX and CowSwap let users declare what they want, not how to achieve it, outsourcing execution to a competitive solver network.

This is a fundamental architectural pivot. It moves trust from perfect code execution to economic security and competition, a model proven by Across Protocol and intent-centric rollups like Anoma.

deep-dive
THE PRACTICAL REALITY

The Fatal Flaws: Key Size and Latency

Code-based cryptography fails in blockchain due to massive key sizes and slow operations, making it impractical for real-time systems.

Key sizes are untenable. A McEliece public key is 1MB, while an RSA-2048 key is 0.256KB. This makes key distribution and on-chain storage for protocols like Ethereum or Solana economically impossible.

Verification latency kills UX. Signing and verification take milliseconds for ECDSA but seconds for code-based schemes. This breaks high-frequency DeFi applications on Uniswap or dYdX that require sub-second finality.

The trade-off is asymmetric. Post-quantum security is achieved by making classical computers suffer. This creates a dead zone where systems are quantum-resistant but unusable for modern blockchain throughput.

Evidence: The NIST PQC finalist Classic McEliece requires ~1MB keys, while lattice-based CRYSTALS-Dilithium uses ~2KB. The industry standard is shifting toward lattices, not codes, for this exact reason.

WHY CODE-BASED CRYPTOGRAPHY IS FADING

Post-Quantum Algorithm Performance Matrix

A direct comparison of post-quantum cryptographic candidates for blockchain use, highlighting the practical trade-offs that make code-based schemes like Classic McEliece non-viable.

Feature / MetricCode-Based (Classic McEliece)Lattice-Based (Kyber/Dilithium)Hash-Based (SPHINCS+)

Public Key Size

1 MB

1.3 KB

1 KB

Signature Size

~200 bytes

2.5 KB

41 KB

Verification Speed

< 1 ms

< 1 ms

~10 ms

On-Chain Gas Cost (Est.)

$100 per tx

$5-10 per tx

$20-30 per tx

NIST Standardization Status

Primary (KEM)

Primary (KEM & Sig)

Primary (Sig)

Resilient to Side-Channel Attacks

Smart Contract Integration Feasibility

Key Generation Time

~100 ms

< 10 ms

< 10 ms

counter-argument
THE USER EXPERIENCE IMPERATIVE

The Steelman: What If Keys Don't Matter?

The dominance of private key management is the primary barrier to mainstream blockchain adoption, forcing a shift towards code-based authentication.

Private keys are a UX dead-end. They demand perfect user custody for a system designed for imperfect humans, creating an insurmountable adoption barrier.

Code-based cryptography replaces key custody. Systems like ERC-4337 account abstraction and MPC wallets (e.g., Safe) delegate signing logic to smart contracts or distributed services.

The model shifts from 'what you have' to 'what you do'. Authentication uses social recovery, biometrics, or device clusters, mirroring Web2 logins without central data silos.

Evidence: The $1B+ in user funds lost annually to key mismanagement proves the current model is unsustainable for mass adoption.

protocol-spotlight
THE CRYPTOGRAPHIC SHIFT

Who's Building What: The Post-Quantum Pipeline

Code-based cryptography, once a leading post-quantum candidate, is being abandoned by blockchain builders due to fundamental incompatibilities with decentralized systems.

01

The Problem: Gigantic Keys Break Consensus

Classic McEliece keys are ~1MB, making them impossible for on-chain verification or consensus messaging. This breaks the core assumption that all nodes can cheaply verify all signatures, a requirement for networks like Ethereum or Solana.

  • State Bloat: Storing public keys would dominate chain storage.
  • Network Overhead: Propagating signatures would cripple block propagation times.
1MB+
Key Size
~10KB
Sig. Size
02

The Solution: Lattice-Based Cryptography Dominates

Projects like QANplatform and SandboxAQ are standardizing on lattice-based schemes (e.g., CRYSTALS-Dilithium). These offer ~2KB keys/signatures, making them viable for blockchains. The NIST standardization process has cemented this as the industry's path forward.

  • Performance: Verification is fast enough for high-TPS chains.
  • Agility: Supports signature aggregation, crucial for rollups like Arbitrum and Optimism.
~2KB
Key Size
NIST Std.
Status
03

The Pragmatic Bridge: Hybrid Schemes

Protocols aren't waiting for a full transition. Chainlink's CCIP and cross-chain bridges like LayerZero are deploying hybrid signatures, combining classical ECDSA with post-quantum algorithms. This provides quantum resistance today without breaking existing infrastructure.

  • Backwards Compatible: Works with current wallets and tools.
  • Risk Mitigation: Protects against 'harvest now, decrypt later' attacks on sensitive data.
2-of-2
Sig. Scheme
Zero-Downtime
Migration
04

The Hidden Cost: Signature Aggregation Dies

Post-quantum signatures kill a key scaling primitive. BLS signatures, used by Ethereum for consensus and rollups like zkSync for cheap batch verification, rely on pairing-friendly curves with no known PQ equivalent. This forces a trade-off between quantum security and scalability.

  • Scalability Hit: Rollup proof aggregation becomes more expensive.
  • Research Gap: New math is needed to reconcile PQ security with efficient aggregation.
BLS
Endangered
10-100x
Cost Increase
future-outlook
THE SHIFT

The Roadmap: Hybrid Schemes and Specialized Hardware

Post-quantum cryptography for blockchains is abandoning pure code-based systems in favor of hybrid schemes and hardware-accelerated lattice cryptography.

Hybrid schemes dominate adoption. Projects like NIST's ML-KEM (Kyber) and ML-DSA (Dilithium) are being deployed in hybrid mode, combining classical ECDSA with new PQC algorithms. This provides a safety net against algorithmic breaks in either system, a critical hedge for high-value, immutable ledgers.

Code-based cryptography is fading. Its massive key and signature sizes create prohibitive on-chain bloat. A single Classic McEliece signature is ~1MB, dwarfing a 64-byte ECDSA sig. This directly contradicts blockchain's need for state efficiency, unlike the batched, off-chain verification used in Across Protocol or LayerZero messages.

Lattice cryptography wins for hardware. Algorithms like Falcon and Dilithium are optimized for fast verification, a perfect fit for consensus nodes and validators. Their structure allows for efficient FPGA and GPU acceleration, making them the only viable path for maintaining high TPS in a post-quantum world.

Evidence: Ethereum's PQC R&D efforts explicitly prioritize lattice-based and multivariate schemes, while dismissing code-based and hash-based signatures for general transaction use due to their size and verification overhead.

takeaways
THE POST-QUANTUM SHIFT

TL;DR for the Time-Poor CTO

Code-based cryptography, once a promising post-quantum candidate, is being abandoned by blockchain due to fundamental incompatibilities with decentralized systems.

01

The Problem: Gigantic Keys & Signatures

Code-based schemes like Classic McEliece produce signatures in the megabyte range and public keys in hundreds of kilobytes. This is untenable for blockchains where every node must store and verify every signature, bloating state and crippling throughput.\n- State Bloat: A single signature can be larger than an entire block.\n- Network Overhead: Propagating transactions becomes a bandwidth DoS attack.

~1MB
Per Signature
1000x
Larger Than ECDSA
02

The Solution: Lattice-Based Cryptography

Schemes like CRYSTALS-Dilithium (NIST-standardized) and FALCON offer compact signatures (~2-4KB) and fast verification, aligning with blockchain's resource constraints. Projects like QANplatform and SandboxAQ are pioneering integrations.\n- Compact Footprint: Keys and signatures are orders of magnitude smaller.\n- Performance: Verification is fast enough for high-TPS environments.

~2KB
Signature Size
NIST Std.
Dilithium
03

The Problem: Lack of Aggregation & Composability

Blockchain scaling relies on signature aggregation (BLS in Ethereum, EdDSA in Solana) and smart contract composability. Code-based schemes are mathematically opaque and cannot be efficiently aggregated or easily used in ZK-SNARK circuits.\n- No BLS-Like Magic: Kills layer-2 and rollup efficiency gains.\n- ZK-Unfriendly: Hinders privacy-preserving applications.

0
Aggregation Support
High Cost
In ZK Circuits
04

The Pragmatic Path: Hybrid Schemes & Phased Migration

The industry consensus is to use hybrid signatures (e.g., ECDSA + Dilithium) during transition, as seen in proposals from the PQShield and Cloudflare research. This preserves current security while adding quantum resistance.\n- Backwards Compatibility: No breaking changes to existing wallets/transactions.\n- Risk Mitigation: Defends against both classical and quantum adversaries.

2-for-1
Signature Overhead
Phased
Deployment
05

The Ultimate Benchmark: On-Chain Gas Cost

The final arbiter is gas. Early benchmarks show lattice-based verification at ~500k gas vs. ECDSA's ~3k gas. Code-based would be prohibitively expensive (>10M gas), making simple transfers economically impossible.\n- Economic Viability: Lattice is expensive but feasible; code-based is not.\n- Optimization Frontier: Dedicated precompiles (like EIP-7212) are essential.

500k gas
Dilithium Verify
>10M gas
Code-Based Est.
06

Entity Spotlight: QANplatform & The Pragmatists

While theoretical papers still explore code-based crypto, real-world blockchain builders have unanimously pivoted. QANplatform launched the first quantum-resistant L1 with lattice-based sigs. Ethereum, Algorand, and Polkadot ecosystems are all researching lattice/ZKP hybrids, not code-based.\n- Market Signal: Builders vote with their code.\n- Future-Proofing: Lattice schemes are agile and can be upgraded as math advances.

Live L1
QANplatform
0
Major Code-Based L1s
ENQUIRY

Get In Touch
today.

Our experts will offer a free quote and a 30min call to discuss your project.

NDA Protected
24h Response
Directly to Engineering Team
10+
Protocols Shipped
$20M+
TVL Overall
NDA Protected Directly to Engineering Team