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
LABS
Guides

How to Architect Wallet and Key Management for PQC

A technical guide for developers on designing and implementing post-quantum cryptography in blockchain wallets, covering key generation, storage, and signature handling.
Chainscore © 2026
introduction
POST-QUANTUM CRYPTOGRAPHY

Introduction to PQC Wallet Architecture

A guide to designing and implementing wallet systems that are secure against quantum computing threats, focusing on key management, signature schemes, and protocol integration.

Post-quantum cryptography (PQC) refers to cryptographic algorithms designed to be secure against attacks from both classical and quantum computers. For blockchain wallets, this means moving beyond traditional elliptic curve cryptography (ECC) like secp256k1, which is vulnerable to Shor's algorithm. The transition involves adopting new digital signature schemes such as CRYSTALS-Dilithium, Falcon, and SPHINCS+, which are based on mathematical problems considered hard for quantum computers to solve. Architecting a PQC wallet requires understanding these new primitives, their performance characteristics, and how they integrate with existing blockchain protocols.

A PQC wallet's core architecture must manage key generation, storage, and signing operations using quantum-resistant algorithms. Unlike ECC keys, PQC public keys and signatures can be significantly larger—Dilithium2 public keys are about 1.3 KB, compared to ECC's 33 bytes. This impacts network bandwidth and on-chain storage costs. The key management layer must handle these larger key sizes efficiently, often requiring optimized serialization formats and careful consideration of gas costs for on-chain verification, especially on networks like Ethereum.

Implementing PQC signatures requires selecting a standardized algorithm. The NIST PQC Standardization Project has selected CRYSTALS-Dilithium as the primary standard for digital signatures. A basic signing flow in a wallet might involve using a library like liboqs. For example, key generation and signing in a prototype might use: signature = dilithium_sign(private_key, message). Wallets must also support hybrid schemes during the transition period, where a transaction is signed with both a classical ECDSA signature and a PQC signature to maintain compatibility with existing networks.

Integration with existing blockchain protocols presents a major challenge. Smart contracts and nodes must be upgraded to verify the new signature types. For Ethereum, this could mean introducing new precompiled contracts or EVM opcodes for PQC verification. Wallets must be designed to interact with both legacy and upgraded systems. Furthermore, hierarchical deterministic (HD) wallets using BIP-32 need new PQC-compatible key derivation functions, as the current ones rely on ECC. The architecture must plan for a multi-phase migration, ensuring funds remain secure throughout the process.

Beyond signatures, PQC wallet architecture must address encrypted storage and secure communication. Symmetric encryption for keystores, currently relying on AES, is considered quantum-safe, but key exchange protocols like ECDH are not. For peer-to-peer communication or connecting to nodes, wallets may need to integrate PQC key encapsulation mechanisms (KEMs) like Kyber. The overall system design must audit all cryptographic touchpoints—signing, encryption, key exchange—and reinforce them with post-quantum algorithms to create a fully quantum-resistant wallet.

prerequisites
PREREQUISITES AND CORE DEPENDENCIES

How to Architect Wallet and Key Management for PQC

This guide outlines the foundational concepts and dependencies required to architect a quantum-resistant wallet and key management system.

Post-Quantum Cryptography (PQC) aims to secure digital signatures and key encapsulation mechanisms against attacks from quantum computers. For wallet architecture, this primarily involves replacing the Elliptic Curve Digital Signature Algorithm (ECDSA) used by Bitcoin and Ethereum with a quantum-resistant alternative. The core dependency is selecting a standardized PQC algorithm, such as those selected by NIST in its PQC Standardization Project. The leading candidates for digital signatures are CRYSTALS-Dilithium, FALCON, and SPHINCS+, each with distinct trade-offs in key size, signature size, and performance.

A PQC wallet's key management system must handle larger key pairs. For example, a Dilithium2 private key is about 2.5 KB, compared to a 32-byte ECDSA key. This impacts storage, memory, and transaction payload size. Your architecture must plan for this increased data footprint in all components: secure element storage, in-memory processing, and on-chain transaction data. Furthermore, you must integrate a PQC library like liboqs from Open Quantum Safe or a language-specific implementation to perform the cryptographic operations.

The system must support key generation, signature creation, and signature verification. A practical implementation in a TypeScript/Node.js environment might start by installing the pqcrypto library. Key generation would involve creating a keypair object, which contains the significantly larger public and private keys. The signing function would take a transaction hash and the private key to produce a signature, while verification would use the public key and signature to validate the transaction's authenticity.

Beyond the core signing algorithm, architecting for PQC requires planning for hybrid schemes and migration. A hybrid approach, where a transaction is signed with both ECDSA and a PQC algorithm, provides a transitional security model. This ensures backward compatibility with existing blockchain networks while introducing quantum resistance. Your key management logic must be able to generate, store, and process these dual-key structures, which doubles the complexity of signing and verification routines.

Finally, consider the security envelope for key storage. While the cryptography is quantum-resistant, the keys themselves are still vulnerable to classical attacks if not stored properly. The architecture should integrate with Hardware Security Modules (HSMs), Trusted Execution Environments (TEEs), or secure enclaves designed to handle larger PQC key material. The choice here will dictate your wallet's client-side requirements, such as specific mobile TEE APIs or HSM connectivity for institutional custody solutions.

key-concepts-text
ARCHITECTURE GUIDE

Key PQC Concepts for Wallet Developers

Post-quantum cryptography (PQC) requires fundamental changes to how wallets generate, store, and use keys. This guide explains the core concepts developers must understand to architect secure, future-proof systems.

The transition to PQC is not a simple algorithm swap. It introduces new key and signature formats with significantly larger sizes. For example, a CRYSTALS-Dilithium2 public key is ~1,312 bytes, compared to 33 bytes for a secp256k1 ECDSA key. This impacts every layer of a wallet's architecture: storage, memory usage, network transmission, and transaction fees. Developers must plan for key encapsulation mechanisms (KEMs) like Kyber for encryption and digital signature algorithms like Dilithium or Falcon for signing, each with distinct performance and size trade-offs.

A hybrid approach is the recommended strategy for a smooth transition. This involves combining a classical algorithm (like ECDSA) with a PQC algorithm (like Dilithium) to create a dual signature. The wallet generates and manages two separate key pairs. This maintains compatibility with existing blockchain networks and clients while the PQC signature provides quantum resistance. The major architectural consideration is managing the lifecycle of both key sets and ensuring they are always used and validated together.

Key storage and backup mechanisms must be redesigned. A 2,589-byte Dilithium private key cannot be efficiently stored as a 12 or 24-word mnemonic phrase using BIP-39 in its current form. Developers need to evaluate new mnemonic standards or alternative backup schemes. Furthermore, in-memory handling of these large keys during signing operations requires careful management to prevent sensitive data leakage, impacting secure element integration and the design of hardware wallet firmware.

On-chain, larger signatures increase transaction sizes, directly raising gas costs on networks like Ethereum. A dual ECDSA+Dilithium signature could be ~2,000 bytes versus ~70 bytes for ECDSA alone. Wallet developers must implement intelligent fee estimation and may need to advocate for or utilize new transaction formats that optimize for PQC data. Smart contracts for multisigs and account abstraction will also need upgrading to support new verification logic, requiring coordination with broader ecosystem development.

For practical implementation, start by integrating a PQC library like liboqs or PQClean. Focus on creating a clean abstraction layer for your crypto provider, allowing you to switch between classical, PQC, and hybrid modes. Test extensively with the larger data payloads to profile performance on target devices (mobile, desktop, HSM). The architecture should be modular, anticipating further changes as NIST standards evolve and blockchain protocols adopt final PQC standards.

NIST STANDARDIZED ALGORITHMS

PQC Signature Algorithm Comparison for Wallets

Comparison of NIST-selected PQC signature algorithms for key generation, signing, and verification in blockchain wallets.

Metric / FeatureCRYSTALS-DilithiumFalconSPHINCS+

NIST Security Level

2, 3, 5

1, 5

1, 3, 5

Signature Size (avg.)

2,420 bytes

666 bytes

7,856 bytes

Public Key Size

1,312 bytes

897 bytes

32 bytes

Private Key Size

2,528 bytes

1,281 bytes

64 bytes

Signing Time

< 100 ms

< 10 ms

< 1 sec

Verification Time

< 100 ms

< 10 ms

< 1 sec

Key Generation Time

< 100 ms

< 1 sec

< 1 sec

Lattice-Based

Hash-Based

Hardware Acceleration

Resistance to Side-Channel

Recommended for Mobile

architecture-hybrid-keys
POST-QUANTUM CRYPTOGRAPHY

Architecting for Hybrid Key Pairs

A practical guide for developers on integrating quantum-resistant algorithms with existing blockchain key management systems.

Hybrid key pairs combine a traditional elliptic curve key (like ECDSA or Ed25519) with a post-quantum cryptography (PQC) key into a single cryptographic identity. This architecture is the recommended migration path for Web3 wallets, as it provides backwards compatibility with existing blockchains while adding a layer of quantum resistance. The core principle is dual-signature verification: a transaction is only valid if it contains valid signatures from both the classical and the PQC key components. This ensures the system remains secure against both current and future quantum attacks.

Implementing a hybrid scheme requires careful key lifecycle management. A user's wallet must generate, store, and use two distinct private keys. For Ethereum, this could mean pairing the standard secp256k1 key with a CRYSTALS-Dilithium key. The keys should be derived from a single, strong entropy source or seed phrase, often using different derivation paths (e.g., m/44'/60'/0'/0/0 for ECDSA and m/44'/60'/0'/1/0 for Dilithium). Secure storage is critical; both keys must be protected with equal rigor, as compromising either compromises the hybrid security.

The signing process involves creating two signatures. For a transaction tx, the wallet generates sig_classical = sign(priv_classical, tx) and sig_pqc = sign(priv_pqc, tx). These are then serialized into a single signature payload for the blockchain. On-chain, a smart contract or upgraded protocol validates the transaction by calling two verification functions: verify_classical(pub_classical, tx, sig_classical) and verify_pqc(pub_pqc, tx, sig_pqc). This approach is being pioneered by protocols like EigenLayer's restaking ecosystem and certain Layer 2 solutions preparing for the quantum transition.

Architectural decisions involve choosing a PQC algorithm. The NIST Post-Quantum Cryptography Standardization project has selected CRYSTALS-Dilithium for general digital signatures. Its key and signature sizes are larger than ECDSA (~2-4 KB), impacting gas costs and storage. Developers must design serialization formats (like using 0x01 as a version byte) and may need to deploy verifier contracts for chains that don't natively support PQC. Testing with libraries such as Open Quantum Safe's liboqs is essential for integration.

The ultimate goal is a seamless user experience. Wallets should abstract the dual-key complexity, presenting a single address and recovery phrase to the user. Migration from a classical-only wallet involves generating a new PQC key pair and broadcasting a binding transaction to associate it with the existing address, a process known as key hybridization. By adopting this architecture now, projects future-proof their applications without disrupting current users, ensuring security in both the classical and quantum computing eras.

key-derivation-storage
POST-QUANTUM CRYPTOGRAPHY

Key Derivation and Secure Storage

This guide explains how to architect wallet and key management systems resilient to quantum computers, focusing on post-quantum cryptography (PQC) algorithms and secure storage practices.

Traditional blockchain wallets rely on Elliptic Curve Cryptography (ECC), specifically the secp256k1 curve, for generating key pairs and signing transactions. While secure against classical computers, algorithms like ECDSA are vulnerable to Shor's algorithm, which a sufficiently powerful quantum computer could use to derive a private key from its corresponding public key. This threat necessitates a transition to Post-Quantum Cryptography (PQC), a suite of algorithms designed to be secure against both classical and quantum attacks. The migration involves replacing the core cryptographic primitives for key generation, digital signatures, and key encapsulation.

For key derivation, PQC introduces new algorithm families. The most prominent for digital signatures, as standardized by NIST, include CRYSTALS-Dilithium, FALCON, and SPHINCS+. For key encapsulation (used in key exchange), CRYSTALS-Kyber is the primary standard. A PQC-secure wallet architecture must integrate these algorithms. For example, a hierarchical deterministic (HD) wallet's master seed would no longer derive ECC keys but instead generate a root key for a PQC signature scheme. The key derivation path m/44'/60'/0'/0/0 would yield a PQC key pair, not an ECDSA one.

Secure storage of PQC private keys presents new challenges. Many PQC algorithms, particularly lattice-based ones like Dilithium, produce larger key sizes—private keys can be several kilobytes. This impacts storage efficiency and performance for in-browser or mobile wallets. Strategies include using hardware security modules (HSMs) with PQC support for cold storage and optimizing in-memory handling for hot wallets. Furthermore, key encapsulation mechanisms (KEMs) like Kyber enable secure symmetric key exchange, which can then protect the larger PQC private key material when stored or transmitted, adding an extra layer of security.

Implementation requires careful library selection and side-channel resistance. Developers should use vetted libraries such as liboqs (Open Quantum Safe) or provider-specific SDKs. Code must be audited for timing attacks, as the mathematical operations in lattice cryptography can leak information. A basic key generation example using liboqs in C would look like:

c
#include <oqs/oqs.h>
OQS_SIG *sig = OQS_SIG_new(OQS_SIG_alg_dilithium_2);
uint8_t public_key[OQS_SIG_dilithium_2_length_public_key];
uint8_t secret_key[OQS_SIG_dilithium_2_length_secret_key];
OQS_SIG_keypair(sig, public_key, secret_key);

Always follow the library's documentation for secure memory zeroing.

Architecting for the transition is critical. A hybrid approach is recommended, where transactions are signed with both a classical (ECDSA) and a PQC signature. This maintains compatibility with existing blockchain networks while establishing quantum resistance. Wallets should be designed with algorithm agility, allowing for the runtime selection or upgrade of cryptographic primitives without requiring a hard fork of the wallet software itself. The ultimate goal is a system where the master seed is processed through a PQC-secure key derivation function (KDF) and all derived keys are inherently quantum-resistant, future-proofing digital asset security.

signature-handling
ARCHITECTURE GUIDE

Post-Quantum Cryptography for Wallets

This guide explains how to architect wallet and key management systems to be resilient against quantum computing attacks using post-quantum cryptography (PQC).

The cryptographic foundation of Web3—primarily the Elliptic Curve Digital Signature Algorithm (ECDSA) used by Ethereum and Bitcoin—is vulnerable to attack by sufficiently powerful quantum computers. This threat, known as Store Now, Decrypt Later (SNDL), means an adversary can record today's public transactions and decrypt them later once quantum computers are capable. To counter this, wallet architectures must integrate Post-Quantum Cryptography (PQC), a suite of algorithms designed to be secure against both classical and quantum attacks. The transition involves moving from ECDSA to quantum-resistant signature schemes like CRYSTALS-Dilithium, Falcon, or SPHINCS+, which are based on mathematical problems considered hard for quantum computers to solve, such as lattice-based or hash-based cryptography.

Architecting a PQC-ready wallet requires a hybrid signature approach during the transition period. A single transaction should carry two signatures: one using the traditional ECDSA (for current network compatibility) and one using a PQC algorithm (for future-proofing). This dual-signature model ensures wallets remain functional on existing blockchains while embedding quantum-safe guarantees. The architecture must manage two separate key pairs and a signing process that produces a concatenated signature payload. Developers should design their signature verification logic to check both signatures, with the PQC signature taking precedence for validity in a post-quantum future. This strategy is endorsed by standards bodies like NIST, which finalized its first PQC standards (FIPS 203, 204, 205) in 2024.

Key management becomes more complex with PQC. Private keys for lattice-based algorithms like Dilithium are larger (over 2,500 bytes) compared to ECDSA's 32 bytes, impacting storage and in-memory handling. Wallets must update their Key Derivation Functions (KDF) and secure enclave protocols to accommodate these larger key sizes. Furthermore, key generation is computationally more intensive. It's critical to use audited libraries such as liboqs from Open Quantum Safe or provider-specific SDKs. The mnemonic phrase (BIP-39) system remains viable for seed generation, but the derived key material will feed into the new PQC key generation routines, not just ECDSA.

For developers, implementing PQC signing involves integrating new libraries. Below is a conceptual example in pseudocode for a hybrid signing operation:

python
# Pseudo-code for hybrid ECDSA/PQC signing
import pqc_signer # e.g., Dilithium library
import ecdsa_signer

def sign_transaction(tx_data, ecdsa_privkey, dilithium_privkey):
    # Generate traditional ECDSA signature
    ecdsa_sig = ecdsa_signer.sign(tx_data, ecdsa_privkey)
    
    # Generate post-quantum signature
    dilithium_sig = pqc_signer.sign(tx_data, dilithium_privkey)
    
    # Construct final hybrid signature payload
    hybrid_signature = encode_for_network(ecdsa_sig, dilithium_sig)
    return hybrid_signature

The verification function would decode the payload and validate both signatures, failing the transaction if the PQC signature is invalid, even if the ECDSA one checks out.

The path forward requires proactive protocol upgrades and community coordination. Ethereum's ongoing EIP-7212 (secp256r1/R1 curve support) and research into EIP-XXXX for PQC demonstrate the ecosystem's direction. Wallet developers should:

  • Audit dependencies for PQC library integration.
  • Plan for gas cost increases due to larger signature sizes (e.g., a Dilithium2 signature is ~2,420 bytes).
  • Implement graceful upgrade paths for users, potentially using smart contract account abstraction (ERC-4337) to manage key rotation.
  • Monitor standardization via NIST and the IETF's TLS 1.3 PQC drafts. Building with PQC today future-proofs assets and establishes a critical security advantage in the Web3 landscape.
migration-strategy
POST-QUANTUM CRYPTOGRAPHY

Phased Migration Strategy for Existing Wallets

A practical guide to incrementally integrating quantum-resistant cryptography into existing blockchain wallet architectures without disrupting user experience.

The transition to post-quantum cryptography (PQC) is not a single upgrade but a multi-year migration. For wallet developers, the primary goal is to maintain backward compatibility with existing blockchain networks (like Ethereum or Bitcoin) while progressively hardening key material against future quantum attacks. This requires a phased strategy that layers new PQC algorithms over current elliptic curve cryptography (ECC) systems, such as secp256k1. The first phase typically involves implementing hybrid signatures, where a transaction is signed with both the legacy ECDSA algorithm and a new PQC algorithm like CRYSTALS-Dilithium. This ensures the transaction is valid on today's network while future nodes can be upgraded to require the PQC component.

Architecturally, this means modifying the wallet's key derivation and signing engine. A user's existing seed phrase can be used to generate two key pairs: the traditional ECC key and a new PQC key. The PQC private key should be derived deterministically from the seed, often using a separate derivation path (e.g., m/44'/60'/0'/0'/1' for PQC) to avoid interfering with the legacy key. The signing function must then produce a concatenated signature Sig = ECDSA_Sig || PQC_Sig. Wallets must also update their serialization logic to handle these larger, composite signatures within transaction data structures, potentially using new EIPs or BIPs for standardization.

The second phase focuses on key encapsulation mechanisms (KEMs) for secure communication, such as when a wallet interacts with a remote signing service or encrypts backup files. Algorithms like CRYSTALS-Kyber can replace or complement ECDH for establishing shared secrets. Implementations should use hybrid KEM modes, combining X25519 with Kyber768, as recommended by NIST. This protects the confidentiality of data in transit from future quantum decryption. Wallet developers must integrate these into their networking layers and backup encryption routines, ensuring all new communication channels default to hybrid PQC.

The final, long-term phase is the eventual deprecation of legacy ECC. This requires broad ecosystem coordination and is contingent on blockchain protocol upgrades (e.g., an Ethereum hard fork) to make PQC signatures mandatory. Wallets must plan for a grace period where they support both signature types, provide clear user education on the migration, and offer tools for users to move assets to new, PQC-native addresses. Monitoring the standardization progress of FIPS 203 (ML-KEM) and FIPS 204 (ML-DSA) is crucial, as these will become the benchmark for regulatory and institutional compliance.

Throughout all phases, key management remains paramount. The seed phrase, as the root of trust, must be protected. PQC key generation should not increase the attack surface; the same hardware security module (HSM) or secure enclave that protects ECC keys should be used for PQC operations. Developers should leverage established libraries like liboqs from Open Quantum Safe for prototyping, but for production, seek audited, optimized implementations. Testing must include performance benchmarking, as PQC signatures and keys are significantly larger, impacting transaction fees and storage.

KEY MANAGEMENT

PQC Wallet Implementation FAQ

Answers to common technical questions about architecting wallets and managing cryptographic keys for post-quantum security.

Directly swapping ECDSA for a PQC algorithm like Dilithium or Falcon often fails due to fundamental architectural mismatches.

Key differences include:

  • Signature Size: PQC signatures are significantly larger (2-50KB vs. 64-72 bytes for ECDSA). This impacts transaction size, gas costs on EVM chains, and storage.
  • Key Generation Time: Some PQC algorithms have slower key generation, affecting wallet creation UX.
  • Algorithm Agility: Wallets must support multiple algorithms during the transition period, requiring a structured multi-algorithm signing strategy.
  • Address Derivation: PQC public keys are not compatible with existing address derivation schemes (like Ethereum's keccak256). You need a new derivation path or a wrapper contract.

A successful migration requires redesigning the wallet's serialization, transaction format, and state management to handle these new constraints.

conclusion
POST-QUANTUM CRYPTOGRAPHY

Conclusion and Next Steps

This guide has outlined the architectural considerations for integrating post-quantum cryptography into wallet and key management systems. The transition is a multi-year journey requiring careful planning.

Architecting for PQC is not a simple algorithm swap. It requires a hybrid approach, combining classical algorithms like ECDSA with new PQC standards like CRYSTALS-Dilithium. This ensures backwards compatibility and maintains security during the transition period, which could last a decade. Your system must be designed to manage multiple key types and signature schemes concurrently, with clear versioning for key material and signed data payloads.

The next steps involve concrete implementation. Start by auditing your current cryptographic inventory—identify every use of digital signatures (e.g., transaction signing, authentication) and key encapsulation (e.g., encrypted backups). For development, integrate a library like Open Quantum Safe (liboqs) into a test environment. Begin with hybrid signing, where a single message produces both an ECDSA and a Dilithium signature, allowing you to test performance and serialization without affecting production systems.

Performance and UX are critical hurdles. PQC signatures and keys are larger: a Dilithium2 signature is ~2,400 bytes versus 64-72 bytes for ECDSA. This impacts gas costs on-chain, storage requirements, and sync times. You must profile these changes and consider techniques like signature aggregation or state channels to mitigate cost. For user experience, educate users on why backup file sizes may increase and ensure your UI can handle longer transaction confirmation times during signing operations.

Engage with the broader ecosystem. Follow the NIST standardization process for the final PQC algorithms (FIPS 203, 204, 205). Participate in working groups like the PQ-Crypto Consortium or ETHeritage. For blockchain-specific guidance, monitor and contribute to EIPs (Ethereum Improvement Proposals) related to PQC, such as discussions around new precompiles or transaction types. The transition will be a coordinated effort across protocols.

Finally, develop a long-term migration roadmap. Phase 1: Research and internal testing (Now). Phase 2: Hybrid signature support in devnet/testnet (Next 12-18 months). Phase 3: Optional hybrid mode in mainnet, with heavy monitoring (2-3 years). Phase 4: Mandatory PQC support for new accounts or features (3-5 years). This phased approach manages risk while preparing for the eventual post-quantum era. Your architecture decisions today will determine your resilience tomorrow.

How to Architect Wallet and Key Management for PQC | ChainScore Guides