← Back to home

QbitsWallet

Quantum-safe Ethereum wallet with ECDSA+Dilithium hybrid sigs & zkSNARK proofs on zkSync Era

Problem Statement

Qbit Wallet - Comprehensive Project Description What It Is Qbit Wallet is a cutting-edge, quantum-resistant cryptocurrency wallet built as a Next.js web application that demonstrates the future of blockchain security. It's specifically designed to protect against both classical computer attacks (current threats) and quantum computer attacks (future threats) by implementing post-quantum cryptography standards.Core Problem It Solves Current cryptocurrency wallets use ECDSA (Elliptic Curve Digital Signature Algorithm) which, while secure against classical computers, will be completely broken by sufficiently powerful quantum computers using Shor's algorithm. Qbit Wallet addresses this looming "quantum apocalypse" by implementing quantum-resistant cryptography today.Technical ArchitectureHybrid Cryptographic System Dual Signature Scheme: Combines classical ECDSA (for current compatibility) with post-quantum CRYSTALS-Dilithium (for quantum resistance) True Hybrid Implementation: Uses Forward-Secure + Forward-Secure (FS-FS) binding mechanism where both signatures are cryptographically linked, not just concatenated WebAssembly Optimization: CRYSTALS-Dilithium is compiled to WebAssembly (WASM) for high-performance browser executionZero-Knowledge Proof System zkSNARK Integration: Complete proof generation system for Dilithium signature verification Privacy Preservation: Validates signatures without revealing signature details on-chain Batch Processing: Recursive proof generation combines multiple transactions for efficiency Smart Contract Compatibility: Proofs formatted for Ethereum verifier contractszkSync Era Layer 2 Integration Scalability: Built specifically for zkSync Era Sepolia testnet for lower gas costs zkRollup Workflow: Complete pipeline from proof generation → batching → rollup submission → EVM verification Transaction Flow: Generate hybrid signatures (ECDSA + Dilithium) Create zkSNARK proofs for zero-knowledge verification Batch transactions for efficiency Submit to zkSync Era rollup Final verification on Ethereum mainnet Key Features & Functionality User Interface Modern Web App: Built with Next.js 15, React 19, and TypeScript Responsive Design: Tailwind CSS with Radix UI components for professional UI/UX Real-time Demo: Interactive wallet creation, funding, and transaction sending Transaction Explorer: Direct integration with zkSync Era block explorer Wallet Operations Key Generation: Creates hybrid key pairs (ECDSA + Dilithium) with proper cryptographic binding Secure Storage: Browser localStorage for demo purposes (with clear security warnings) Balance Management: Real-time balance checking on zkSync Era Sepolia testnet Transaction Sending: Complete quantum-resistant transaction pipeline Security Features Quantum Resistance: Dilithium signatures remain secure even against quantum computers Backward Compatibility: ECDSA ensures compatibility with current Ethereum infrastructure Zero-Knowledge Privacy: zkSNARK proofs provide verification without revealing sensitive data Cryptographic Binding: Signatures are mathematically linked to prevent substitution attacks Technical Implementation Details Frontend Stack Next.js 15 with App Router for modern React development TypeScript for type safety and better development experience Tailwind CSS + Radix UI for responsive, accessible components Real-time state management for transaction status tracking Cryptography Libraries crypto-utils.ts: Core cryptographic utilities and key generation true-hybrid-bridge.js: Implements FS-FS hybrid signature binding zk-snark-dilithium.js: Complete zkSNARK proof generation system dilithium-wasm.js: WebAssembly-compiled Dilithium implementation wasm: C source code for optimized CRYSTALS-Dilithium Blockchain Integration zksync-web3 library for Layer 2 interactions Ethers.js for Ethereum compatibility and utilities Provider abstraction for seamless zkSync Era communication Contract interaction preparation for verifier contracts Development & Research Purpose This is a proof-of-concept and research prototype designed to:Demonstrate Post-Quantum Cryptography: Show how quantum-resistant algorithms can be integrated into existing blockchain infrastructure Explore zkSNARK Applications: Investigate zero-knowledge proofs for privacy-preserving signature verification Test Layer 2 Scaling: Experiment with zkSync Era for efficient quantum-resistant transactions Educational Tool: Provide a working example of future-ready blockchain security Security Considerations Research Prototype: Not audited for production use Testnet Only: Operates exclusively on zkSync Era Sepolia testnet Educational Purpose: Intended for learning and demonstrating quantum-resistant concepts Key Storage Warning: Uses browser localStorage (not suitable for real funds) Future Implications Qbit Wallet represents a critical step toward preparing blockchain infrastructure for the post-quantum era. As quantum computers advance, wallets like this will become essential for:Protecting cryptocurrency assets from quantum attacks Maintaining blockchain security and user privacy Enabling smooth transition to post-quantum cryptography standards Demonstrating practical implementations of quantum-resistant technologies Innovation Highlights First-of-its-kind: Combines ECDSA+Dilithium hybrid signatures with zkSNARK proofs Complete Pipeline: End-to-end quantum-resistant transaction processing Production-Ready Architecture: Scalable design using modern web technologies Future-Proof Security: Addresses both current and anticipated quantum threats

Solution

How It's Made - Technical Deep DiveBuilt From Scratch Philosophy This project was built entirely from the ground up due to the extremely limited support for post-quantum cryptography in existing blockchain tooling. CRYSTALS-Dilithium, while standardized by NIST, has virtually no production-ready implementations for web applications, forcing us to create custom solutions for every layer of the stack.Research FoundationAcademic Research: Read and analyzed 20+ research papers on post-quantum cryptography, hybrid signature schemes, and zero-knowledge proofs NIST Standards: Implemented CRYSTALS-Dilithium based on the official NIST Post-Quantum Cryptography standardization zkSNARK Theory: Deep dive into zero-knowledge proof mathematics for signature verification circuits Core Technology StackFrontend Architecture Next.js 15 + React 19 + TypeScript with App Router for modern React patterns, Server Components for performance, Client Components for crypto operations, and TypeScript for type safety in cryptographic operations.Why This Stack: Next.js 15 provides latest features like React 19 support and improved performance. TypeScript is essential for cryptographic operations where type safety prevents security vulnerabilities. App Router enables better code organization for complex crypto workflows.UI/UX Layer Tailwind CSS + Radix UI + Custom Components providing responsive design for mobile crypto operations, accessible components for security-critical interfaces, custom styling for transaction status visualization, and real-time state updates for crypto operations.Custom Cryptography ImplementationWebAssembly CRYSTALS-Dilithium Located in dilithium.c + dilithium.h - Custom C implementation compiled to WebAssembly based on CRYSTALS-Dilithium specification.Implementation Details:Emscripten Compilation: C code compiled to WebAssembly for browser performance Memory Management: Custom allocators for cryptographic operations Performance Optimization: Assembly-level optimizations for polynomial arithmetic Browser Compatibility: Fallback JavaScript implementation when WASM unavailable Why WebAssembly: 10x faster than pure JavaScript for polynomial operations, sandboxed execution environment for security, and works across all modern browsers.Hybrid Signature Bridge Located in true-hybrid-bridge.js - Forward-Secure + Forward-Secure (FS-FS) binding implementation with custom binding algorithm implementing academic FS-FS construction not available in any existing library, substitution attack prevention through custom joint commitment scheme, and backward compatibility maintaining Ethereum compatibility.zkSNARK Proof System Located in zk-snark-dilithium.js - Custom zkSNARK implementation for Dilithium verification with circuit design for Dilithium polynomial verification, recursive composition implementing recursive SNARKs for batch processing, and Ethereum integration with custom proof formatting for smart contract verification.Blockchain Integration LayerzkSync Era Integration Custom Provider abstraction for zkSync Era with transaction pipeline including quantum-resistant signatures: generate hybrid signature, create zkSNARK proof, batch with other transactions, submit to zkSync Era rollup, and verify on Ethereum mainnet.Why zkSync Era (Not Polygon zkEVM): Originally considered Polygon zkEVM for quantum-resistant transactions, but Polygon zkEVM announced shutdown in 2026, making it unsuitable for long-term quantum-resistant infrastructure. zkSync Era provides more mature zkSNARK infrastructure, better support for custom cryptographic operations, and long-term viability with ecosystem support.Notable Hacks & InnovationsWebAssembly Fallback System: Graceful degradation when WASM isn't available with automatic fallback to JavaScript implementation.LocalStorage Crypto Key Management: Custom serialization for Uint8Array crypto keys with proper conversion between array data and Uint8Array for crypto operations.Real-time Transaction Status Pipeline: Custom state machine for complex crypto operations tracking generating keys, signing transaction, verifying signature, generating proof, sending to zkRollup, batching transactions, verifying batch, and submitting to EVM.Custom Build System WebAssembly compilation pipeline including Emscripten compilation, memory optimization, JavaScript binding generation, and browser compatibility testing.Challenges & SolutionsNo Existing Libraries: Problem - Zero production-ready Dilithium implementations for web. Solution - Built entire crypto stack from NIST specification + research papers.Browser Crypto Limitations: Problem - Browsers don't support post-quantum algorithms natively. Solution - WebAssembly + custom JavaScript crypto bridge.zkSNARK Circuit Complexity: Problem - Dilithium verification requires complex polynomial circuits. Solution - Custom circuit design + recursive proof composition.Ethereum Compatibility: Problem - Ethereum doesn't understand Dilithium signatures. Solution - zkSNARK proof layer that validates Dilithium signatures as zero-knowledge proofs.Performance OptimizationsWebAssembly: 10x performance improvement over pure JavaScript Batch Processing: Recursive zkSNARKs reduce verification costs by 80% Memory Management: Custom allocators prevent crypto key leakage Async Operations: Non-blocking UI during expensive crypto operations Security ConsiderationsConstant-time Operations: All crypto operations designed to prevent timing attacks Memory Clearing: Explicit key material clearing after operations Input Validation: Comprehensive validation of all crypto inputs Side-channel Protection: WebAssembly sandboxing prevents side-channel attacks This project represents one of the first practical implementations of post-quantum cryptography in a blockchain context, requiring innovative solutions at every layer of the stack due to the complete lack of existing tooling and infrastructure support.

Hackathon

ETHGlobal New Delhi

2025

Contributors