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 Manage the Transition from ECDSA to PQC in ZK-Rollups

A developer guide for executing a phased migration of a ZK-rollup's signature scheme from ECDSA to a post-quantum algorithm, including timeline, code changes, and backward compatibility.
Chainscore © 2026
introduction
INTRODUCTION

How to Manage the Transition from ECDSA to PQC in ZK-Rollups

A guide for developers on preparing zero-knowledge rollups for the quantum computing era by migrating from classical to post-quantum cryptography.

The cryptographic foundation of modern blockchains, including ZK-rollups, relies on Elliptic Curve Digital Signature Algorithm (ECDSA) for wallet authentication and transaction signing. This algorithm's security is based on the computational difficulty of the elliptic curve discrete logarithm problem. However, large-scale quantum computers, using Shor's algorithm, could theoretically break ECDSA, exposing private keys and compromising the integrity of settled state. For ZK-rollups, which derive their security from the underlying L1, this presents a critical long-term risk that requires proactive architectural planning.

Post-quantum cryptography (PQC) refers to cryptographic algorithms designed to be secure against both classical and quantum computer attacks. Unlike ECDSA, PQC algorithms are based on mathematical problems believed to be hard for quantum computers to solve, such as lattice-based problems (e.g., CRYSTALS-Dilithium), hash-based signatures (e.g., SPHINCS+), or multivariate cryptography. The transition involves replacing the signature scheme used for L1 transaction verification and potentially the proof system's internal cryptography. The National Institute of Standards and Technology (NIST) has been standardizing PQC algorithms, with CRYSTALS-Dilithium selected as the primary standard for digital signatures.

Managing this transition is a multi-phase process. First, audit and inventory all cryptographic dependencies in your rollup stack, including the prover, verifier smart contract, sequencer, and any bridge components. Next, evaluate PQC candidates like Dilithium or Falcon for signatures, and Kyber for key encapsulation, considering their trade-offs in signature size, verification cost, and implementation maturity. For ZK-rollups, a major challenge is the gas cost impact; PQC signatures and verifications are larger and more computationally intensive, which could significantly increase L1 verification costs unless optimized.

A practical migration strategy often involves hybrid signatures. During a transition period, transactions can be signed with both an ECDSA signature and a PQC signature. The verifier contract would accept either, allowing for a gradual rollout. This approach maintains backward compatibility while testing the new PQC stack in production. Teams should also prepare for hard forks or migration events on the base layer (e.g., Ethereum), as the ultimate security depends on the L1 adopting PQC. Proactive development includes forking and testing PQC-enabled versions of critical libraries like circom, halo2, or the zkEVM circuit.

Developers should begin by experimenting with PQC libraries in a test environment. For example, integrating the Open Quantum Safe (OQS) library's Dilithium implementation into a mock prover-verifier flow. Monitor the performance and output size of proofs that use PQC primitives internally. The goal is to build expertise and contribute to the ecosystem's readiness, ensuring ZK-rollups remain secure and viable in a post-quantum future. The transition is not imminent, but the preparatory work is complex and must start years in advance.

prerequisites
SECURITY MIGRATION

Prerequisites and Project Scope

This guide outlines the technical and strategic groundwork required to manage the transition from Elliptic Curve Digital Signature Algorithm (ECDSA) to Post-Quantum Cryptography (PQC) within a ZK-Rollup architecture.

The transition from ECDSA to PQC is not a simple library swap; it's a fundamental upgrade to a core cryptographic primitive. For ZK-Rollups, this directly impacts the signature scheme used for transaction authorization, the SNARK proving system's underlying arithmetic, and the verification keys stored on the base layer (L1). A successful migration requires a clear project scope that defines the specific components to be upgraded, such as the signature scheme for user transactions (e.g., moving from secp256k1 to a lattice-based scheme like Dilithium) and the elliptic curve used within the proving system (e.g., transitioning from BN254 to a PQC-friendly curve).

Key prerequisites include a deep understanding of your current ZK-Stack. You must audit your codebase to identify all cryptographic dependencies, including the signature library (like libsecp256k1), the proving system backend (e.g., Halo2, Plonky2, or Groth16), and the serialization formats for proofs and public keys. Furthermore, establishing a test environment is critical. This involves forking your rollup's L1 contract and sequencer to a testnet, deploying a parallel prover with PQC integrations, and creating a suite of test vectors to validate correctness and performance against the classical system.

Performance benchmarking is a non-negotiable prerequisite. PQC algorithms typically have larger key and signature sizes, and may require more computational overhead. You must profile the impact on proof generation time, proof verification gas cost on L1, and transaction payload size. For example, a Dilithium2 signature is ~2.5KB, compared to ~65 bytes for an ECDSA signature, which affects calldata costs in rollups. Tools like hyperfine for CLI benchmarking and custom gas profiling scripts against a forked Ethereum mainnet are essential for this phase.

Finally, the project scope must define a clear migration strategy. A dual-signing period, where the system accepts both ECDSA and PQC signatures for a predefined epoch, allows users to transition their accounts without service interruption. The scope should also include a plan for updating the verification smart contract on L1, managing the upgradeability mechanism (e.g., via a proxy or a new contract deployment), and creating comprehensive documentation and tooling for dApp developers and end-users to generate and manage new PQC keys.

key-concepts
ZK-ROLLUP SECURITY

Core Cryptographic Concepts

Quantum computers threaten current blockchain signatures. This guide covers the practical steps for transitioning ZK-Rollups from ECDSA to Post-Quantum Cryptography (PQC).

04

Hybrid Signature Transition Strategy

A sudden switch is impossible. A phased hybrid signature approach is necessary for a smooth migration.

  1. Phase 1 (Coexistence): The rollup accepts both ECDSA and a PQC signature (e.g., Dilithium) for validity. This is backwards compatible.
  2. Phase 2 (PQC Primary): After sufficient adoption, the rollup mandates PQC signatures for new transactions, while still verifying old ECDSA ones.
  3. Phase 3 (PQC Only): ECDSA support is deprecated and removed from the protocol.

This requires careful state management and clear user/client SDK updates.

06

Auditing & Security Considerations

PQC integration introduces new attack surfaces. A rigorous security process is critical.

  • Side-Channel Attacks: Lattice-based schemes may be vulnerable to timing or power analysis. Implementations must be constant-time.
  • Parameter Selection: Using non-standard or weakened parameters for performance can cripple security.
  • ZK Circuit Audits: The circuit implementing the PQC verification must be audited separately from the cryptographic library audit.
  • Fallback Mechanisms: Have a governance-driven upgrade path to switch to another PQC algorithm (e.g., SPHINCS+) if Dilithium is compromised.
KEY CANDIDATES

Post-Quantum Signature Algorithm Comparison

Comparison of leading post-quantum signature schemes for ZK-Rollup key management and transaction signing.

Algorithm / MetricDilithiumSPHINCS+Falcon

NIST Security Level

2, 3, 5

1, 3, 5

1, 5

Signature Size (avg.)

~2.5 KB

~8-49 KB

~0.7-1.3 KB

Public Key Size

~1.3-2.5 KB

~1 KB

~0.9-1.8 KB

ZK-SNARK Proving Overhead

High

Medium

Very High

Standardization Status

Primary (ML-KEM)

Primary

Primary

Resistant to Side-Channels

On-Chain Gas Cost (rel.)

High

Very High

Medium

phase-1-planning-assessment
PLANNING AND ALGORITHM ASSESSMENT

How to Manage the Transition from ECDSA to PQC in ZK-Rollups

This guide outlines the initial strategic planning and technical evaluation required to prepare a ZK-Rollup for the post-quantum era, focusing on algorithm selection and risk assessment.

The transition from Elliptic Curve Digital Signature Algorithm (ECDSA) to Post-Quantum Cryptography (PQC) is not a simple library swap. For ZK-Rollups, where security and performance are paramount, it requires a structured, phased approach. Phase 1 focuses on planning and algorithm assessment. The primary goal here is to understand the cryptographic dependencies within your system—such as transaction signing, state root commitments, and prover/verifier key generation—and to evaluate how quantum threats specifically target them. This phase establishes the roadmap, defining the scope, timeline, and success criteria for the entire migration project.

Begin with a comprehensive cryptographic inventory. Audit your entire stack to identify every instance of ECDSA and other classical algorithms like RSA or Schnorr. Key areas in a ZK-Rollup include:

  • User transaction signatures for L2 state updates.
  • The trusted setup ceremony for zk-SNARK circuits (if applicable).
  • The digital signatures used in rollup batch submissions to the L1 (e.g., the sequencer's signature).
  • Any internal authentication mechanisms. Documenting these creates a dependency graph, highlighting which components are most critical and which are most vulnerable to a cryptographically relevant quantum computer (CRQC).

Next, assess the post-quantum algorithm landscape based on NIST's standardization process. For digital signatures, the primary candidates are:

  • CRYSTALS-Dilithium: The primary standard for general-purpose signatures, favored for its strong security and reasonable performance.
  • Falcon: Offers smaller signature sizes, which is crucial for minimizing L1 calldata costs, but involves more complex floating-point arithmetic.
  • SPHINCS+: A conservative, hash-based signature scheme that is large but simple and resistant to a broader range of quantum attacks. Your assessment must weigh signature size, verification speed, key generation time, and implementation complexity against your rollup's specific constraints, such as gas costs on Ethereum and prover overhead.

A critical part of the assessment is hybrid signature schemes. Deploying a pure PQC algorithm immediately carries implementation risks. A pragmatic interim strategy is to use ECDSA/Dilithium hybrid signatures, where a transaction is signed with both algorithms. This provides cryptographic agility, ensuring backward compatibility while introducing quantum resistance. Evaluate libraries like Open Quantum Safe (OQS) that provide prototypes for such hybrid modes. This approach mitigates risk while the PQC algorithms undergo further real-world cryptanalysis and optimization for zero-knowledge proof systems.

Finally, define a testing and rollout strategy based on your assessment. Plan for a long-term parallel run or a canary deployment on a testnet where hybrid signatures are used. Establish clear metrics for success: verification gas cost increase, signature size impact on batch data, and prover performance. This phase concludes with a finalized algorithm selection (e.g., "Dilithium2 for L1 batch posting, Falcon-512 for user transactions"), a detailed impact analysis, and a phased implementation plan for the subsequent development and integration stages.

phase-2-sdk-wallet-updates
PHASE 2

Implementing SDK and Wallet Support

This guide details the practical steps for integrating Post-Quantum Cryptography (PQC) into the developer tooling and user-facing wallets of a ZK-rollup ecosystem.

The transition to Post-Quantum Cryptography (PQC) in ZK-rollups is not just a cryptographic upgrade; it's a full-stack migration. The second phase focuses on the tools developers and users interact with directly: the Software Development Kit (SDK) and the wallet. The SDK must provide a seamless interface for developers to generate and verify PQC signatures, while wallets must handle the new key formats and signing operations transparently for end-users. This requires careful API design to maintain backward compatibility where possible and clear documentation for breaking changes.

A core challenge is managing the dual-signature period. During the transition, the system must support both traditional ECDSA signatures and the new PQC signatures (e.g., Dilithium). Your SDK's signTransaction function might need to be overloaded or accept a parameter specifying the signature scheme. For example, a TypeScript SDK could introduce a new Signer interface:

typescript
interface PQCSigner {
  sign(message: Uint8Array): Promise<{signature: Uint8Array, scheme: 'dilithium5'}>
}

Simultaneously, the rollup's smart contracts or state transition function must be updated to validate signatures from both schemes, checking a flag in the transaction data to determine the verification algorithm.

Wallet integration involves updating key generation, storage, and the signing process. Wallets must generate PQC key pairs, which are significantly larger than ECDSA keys. The mnemonic phrase (BIP-39) derivation path must be extended to produce the necessary entropy for PQC private keys. User experience is critical: wallets should abstract the complexity, perhaps initially generating both ECDSA and PQC key pairs in the background. The UI must clearly communicate the security upgrade and may allow users to approve transactions with a "Quantum-Secure" badge when using the new signature type.

Developer education and tooling are paramount. The SDK should include utilities for key conversion and signature translation for testing purposes. Comprehensive guides must cover migrating existing dApp logic, estimating the increased gas costs or proof sizes associated with larger PQC signatures, and setting up local testnets with PQC validation enabled. Providing a phased migration script that helps dApps switch their default signing scheme can dramatically ease adoption across the ecosystem.

Finally, this phase requires close coordination with infrastructure providers. RPC node operators and block explorers must update their clients to parse, display, and index the new transaction formats. Indexing services like The Graph need new subgraphs to handle events containing PQC signatures. Successful implementation hinges on this ecosystem-wide alignment, ensuring that from the developer's IDE to the end-user's wallet, the transition is as smooth and secure as the cryptography it implements.

phase-3-verifier-upgrade
PHASE 3: MIGRATION EXECUTION

On-Chain Verifier Contract Upgrade

This guide details the technical process for upgrading a ZK-Rollup's on-chain verifier smart contract from ECDSA to a post-quantum secure signature scheme, a critical step in a phased migration.

The on-chain verifier contract is the final arbiter of state transitions in a ZK-Rollup. It receives a zero-knowledge proof and public inputs, then executes a verification algorithm. To transition to post-quantum cryptography (PQC), this contract's core verification logic must be updated. This involves deploying a new verifier contract that implements the verification routine for a PQC-based proof system, such as one using STARKs with a PQC-friendly hash (e.g., Rescue-Prime) or a SNARK with a PQC-secure trusted setup. The old ECDSA-based verifier contract must be deprecated, and the rollup's bridge contract or state manager must be reconfigured to point to the new verifier's address.

A successful upgrade requires careful state management and coordination. You cannot simply swap contracts; you must ensure a seamless handoff. The standard pattern is a timelock-controlled proxy upgrade. The verifier is typically accessed via a proxy contract (e.g., OpenZeppelin TransparentUpgradeableProxy). The upgrade is scheduled by the protocol's multi-sig governance, giving users and node operators time to prepare. Critical steps include: freezing state submissions on the old verifier, deploying and rigorously testing the new PQC verifier contract on a testnet, and finally executing the upgrade through the proxy to point it to the new implementation. All pending proofs must be verified by the old verifier before the cutover.

The new verifier's gas cost is a major consideration. PQC algorithms often have larger key and signature sizes, which can significantly increase calldata and computation costs on-chain. For example, a Dilithium signature verification in Solidity will be more expensive than a standard ecrecover call for ECDSA. You must optimize the new contract using techniques like verification key decomposition (splitting the key into on-chain and off-chain components), leveraging precompiles if available (e.g., BN254 pairing for certain SNARKs), and using efficient finite field arithmetic libraries. Benchmark gas costs thoroughly and consider potential impacts on transaction fees for end-users.

Post-upgrade, comprehensive monitoring is essential. You must verify that the new contract correctly validates proofs generated by the updated prover (Phase 2). Set up event monitoring for ProofVerified and UpgradeCompleted. Use a canary proof—a simple, known-valid proof—to test the live contract immediately after upgrade. Monitor for any failed verifications that should pass, which would indicate a critical bug. Also, ensure the upgrade proxy's admin functions are properly secured and, ideally, transferred to a decentralized governance contract like a DAO to complete the migration to a fully PQC-secure and decentralized system.

phase-4-transition-deployment
OPERATIONAL GUIDE

Phase 4: Coordinated Transition and Deprecation

This guide details the final phase of migrating a ZK-Rollup from ECDSA to a post-quantum secure signature scheme, focusing on operational coordination and secure deprecation of the legacy system.

The coordinated transition and deprecation phase is a critical, time-bound operation to permanently shift the rollup's security foundation. The primary goal is to deactivate the legacy ECDSA prover and verifier smart contracts after a successful grace period under the new PQC system. This requires precise coordination between the rollup operator, sequencer, and users. A formal deprecation announcement should be published at least 90 days in advance, specifying the exact block height or timestamp for the finality cutoff of ECDSA proofs. All ecosystem participants—including wallet providers, block explorers, and bridge operators—must update their clients to recognize only the new PQC state roots and validity proofs.

Technically, this phase involves deploying and activating a final kill switch function in the main rollup contract. This function, callable only by a decentralized governance mechanism or a pre-defined multi-signature wallet after the grace period, will update the contract's verifier address pointer to a new, PQC-only verifier and permanently set a flag rejecting any further ECDSA proof submissions. Before executing this, you must verify that the new PQC prover has been consistently generating valid proofs for several weeks and that the bridge contracts on L1 are correctly attesting to the new state roots. A successful test on a long-running testnet replica is non-negotiable.

For developers, the client-side transition is paramount. Your node software, such as a modified version of zksync-era or starknet, must have its proving and verification logic updated. The sequencer must be configured to stop creating batches with ECDSA proofs after the cutoff. Example configuration change for a sequencer:

code
# In sequencer config.yaml
signature_scheme: "dilithium5" # Change from "ecdsa"
ecda_deprecation_height: 10500000 # Activate after this L1 block

All subsequent L1 bridge withdrawals must be proven using the new PQC proofs, requiring updates to the withdrawal verification scripts.

A phased deprecation with a dual-verification period is the safest approach. For a set number of blocks (e.g., 20,000), the L1 contract can accept both ECDSA and PQC proofs, but only the PQC proofs advance the official state. This creates a safety net. Monitor key metrics during this period: proof submission failure rates, sequencer health, and cross-bridge message latency. Establish a clear rollback plan that can be executed via governance if critical issues are found in the PQC circuits, though this should become impossible once the ECDSA verifier is fully deprecated and its contract logic is nullified.

Post-deprecation, the old ECDSA proving keys and the associated trusted setup artifacts should be securely archived or destroyed, as they no longer confer security but could cause confusion. The final step is to update all public documentation, SDKs, and API endpoints to reflect that the system now exclusively uses PQC (e.g., CRYSTALS-Dilithium or Falcon). This complete, audited transition ensures the ZK-Rollup maintains its security guarantees against both classical and future quantum adversaries, future-proofing the network's core cryptographic layer.

ECDSA TO PQC TRANSITION

Frequently Asked Questions

Common questions and technical guidance for developers preparing zero-knowledge rollups for the post-quantum era.

The security of Elliptic Curve Digital Signature Algorithm (ECDSA), used by wallets like MetaMask and in many ZK-proof systems, relies on the computational hardness of the Elliptic Curve Discrete Logarithm Problem (ECDLP). A sufficiently powerful quantum computer could solve ECDLP using Shor's algorithm, breaking signature forgery and potentially allowing theft of funds secured by ZK-Rollups. Transitioning to Post-Quantum Cryptography (PQC) algorithms, which are based on mathematical problems believed to be hard even for quantum computers, is a proactive measure to ensure long-term security. This is critical for rollups, which often hold billions in locked value and require signatures for state updates and bridge operations.

conclusion-next-steps
IMPLEMENTATION ROADMAP

Conclusion and Next Steps

Successfully transitioning ZK-rollups from ECDSA to Post-Quantum Cryptography (PQC) is a multi-year, community-driven effort requiring careful planning and phased execution.

The transition from ECDSA to PQC is not a simple library swap; it's a fundamental upgrade to the cryptographic bedrock of ZK-rollups. This process must be meticulously planned to avoid network forks, preserve user funds, and maintain interoperability with the underlying L1 and other rollups. A successful migration hinges on backward compatibility, allowing ECDSA-based proofs to remain valid during a lengthy co-existence period, and community consensus, as upgrades often require coordinated action from sequencers, provers, and users.

A practical migration roadmap typically involves four key phases. Phase 1: Research & Standardization involves selecting a candidate algorithm (like Falcon, Dilithium, or SPHINCS+) and defining the new circuit constraints and proof format. Phase 2: Implementation & Testing requires forking the prover/verifier code (e.g., in Circom, Halo2, or Noir), creating extensive test suites with both ECDSA and PQC proofs, and deploying the new verifier contract to a testnet. Rigorous auditing by multiple firms is critical at this stage.

Phase 3: Coexistence & Gradual Rollout begins with a mainnet deployment where the new PQC verifier runs in parallel with the old one. Sequencers can optionally accept PQC proofs, creating a dual-proof system. This phase allows for real-world testing and performance monitoring under mainnet conditions. Phase 4: Full Migration & Sunset is triggered by governance, setting a final deadline after which only PQC proofs are accepted by the sequencer, and the old ECDSA verifier contract is eventually deprecated.

For developers and researchers, the immediate next steps are clear. Begin by experimenting with PQC libraries like liboqs or PQClean to understand performance characteristics. Integrate these into a simple zero-knowledge circuit to benchmark proof generation times and sizes. Actively participate in working groups within ecosystems like Ethereum (EIP process), StarkNet, and zkSync to contribute to standardization efforts. The transition to quantum resistance is a shared challenge that will define the long-term security of the entire Layer 2 landscape.