Skip to content
QORECHAIN
Register

Quantum Pass

Q-Gate

Post-Quantum Payment Gateway on QoreChain ML-KEM-1024 Encrypted Invoices & ML-DSA-87 Guarded Settlement

Share on X

About

Q-Gate (powered by QorePayGuard.sol) is a non-custodial, post-quantum payment link, encrypted invoicing, and quantum-guarded merchant settlement gateway built on the QoreChain testnet (qorechain-diana, EVM Chain ID 9800). In traditional EVM payment gateways, a compromised classical secp256k1 private key allows an attacker to immediately drain merchant escrow funds or hijack payout addresses. Q-Gate eliminates this Q-Day threat on-chain: - Merchants generate shareable payment links for native QOR and testnet fUSD with optional client-side ML-KEM-1024 + X25519 encrypted invoice metadata powered by QoreSeal (@qorechain/qoreseal). - Every sensitive merchant action (withdrawing settled funds or rotating payout addresses) is enforced on-chain by QoreChain's native post-quantum precompiles (pqcVerify at 0x...0a01 and pqcKeyStatus at 0x...0a02), requiring a valid ML-DSA-87 signature. - Includes a live interactive "Simulate Classical Key Leak" demo proving on-chain attack rejection vs. ML-DSA-87 authorized settlement, plus a wallet-free Dual-RPC Public Receipt Verifier that cross-checks transactions directly in the browser against both public qorechain-diana nodes (api-testnet.qore.host and api-testnet-2.qore.host).

How it's made

1. Architecture Q-Gate (powered by QorePayGuard.sol) is built on dual create-qorechain-dapp scaffolds (root Hardhat 3 + apps/web Vite/React/TypeScript frontend) deployed live on qorechain-diana (EVM Chain ID 9800): - Post-Quantum Settlement Contract (contracts/QorePayGuard.sol): Compiled with solc 0.8.28, evmVersion "paris", viaIR: true, and optimizer 200 runs (0xd1a8e0b314f827d151a1244670f4109544332623, deployed at block #11168136). Payments in native QOR (18 decimals) or fUSD (0x97143B771D34ddb9130b807b135Ae675A5a963CA, 6 decimals) credit per-merchant guarded escrow balances, while sensitive actions (withdrawWithPQC, rotatePayoutAddressWithPQC) enforce a 4,627-byte ML-DSA-87 signature verified on-chain via QoreChain's pqcVerify (0x...0a01) and pqcKeyStatus (0x...0a02) precompiles with monotonic nonces and deadlines. - Client-Side QoreSeal Invoicing (apps/web/src/lib/qoreseal.ts): Line items, order references, and delivery notes are encrypted locally in the browser using @qorechain/qoreseal (ML-KEM-1024 + X25519). Plaintext never touches the chain only the keccak256 integrity digest is anchored in createInvoice. - Interactive Security & Wallet-Free Verifier (apps/web/): Features 5 production flows (Landing, Merchant Studio, Consumer Checkout, Quantum Vault + Live Classical Key Leak Simulator, and Dual-RPC Verifier) with automatic QoreX coin-60/coin-118 lane checks and in-memory session signer fallback. - Dual-RPC Browser Consensus (apps/web/src/lib/dualRpcVerifier.ts): Queries both public qorechain-diana endpoints (api-testnet.qore.host and api-testnet-2.qore.host plus EVM RPCs) in parallel to verify block heights, PQCHybridSignature extensions, pqc_hybrid_verify events, and invoice state without requiring a wallet. 2. Kits & Network Features Used Verified packages present in package.json and apps/web/package.json: - create-qorechain-dapp (Hardhat + fullstack-web scaffolds) - @qorechain/sdk, @qorechain/react, and @qorechain/evm (chain presets, decodeEvmError, EVM authorization window status & top-up via evmWindowStatus / evmWindowCost) - @qorechain/pqc (local ML-DSA-87 key & signature verification byte-parity tests) - @qorechain/qoresign (qorechain-msg-v1|qorechain-diana| domain-separated arbitrary message signing & verifyMessageWithChain) - @qorechain/qoreseal (ML-KEM-1024 client-side invoice encryption & MsgRegisterKEMKey registry lookup) - @qorechain/qorex-types and @qorechain/qorex-wallet-mock (QoreX EIP-6963 + native signAndBroadcast hybrid transaction dispatch, capability gating, and Vitest wallet tests) - Live QoreChain features verified on qorechain-diana: PQC precompiles (0x...0a01 & 0x...0a02), EVM authorization windows, hybrid secp256k1 + ML-DSA-87 transactions (PQCHybridSignature), and on-chain ML-KEM key registry (MsgRegisterKEMKey), backed by AI_USAGE.md and THREAT_MODEL.md. 3. What Was Hard (Engineering Hurdles Solved Live) 1) Exact pqcKeyStatus 4-Tuple & Lowercase Precompile Addresses: Live probing on qorechain-diana confirmed pqcKeyStatus (0x...0a02) returns a 4-tuple (registered, algorithmId, pubkey, possessionProven), and Solidity checksums require strictly lowercase precompile addresses (0x...0a01 and 0x...0a02). 2) Avoiding the qorechain-diana eth_call stateOverride Bug: Passing any stateOverride parameter (even {}) causes QoreChain's EVM precompiles to return 0x. All viem contract reads and attack simulations strictly omit stateOverride. 3) EVM Gas Target Discovery (paris + viaIR): Our initial QorePayGuard.sol deployment hit out-of-gas under Hardhat 3's default unoptimized cancun profile; switching hardhat.config.ts to evmVersion: "paris", viaIR: true, and optimizer: 200 deployed cleanly (0x710d5335...). 4) Domain-Separated Message Parity & Wallet Lane Safety: Matched @qorechain/qoresign's "qorechain-msg-v1|qorechain-diana|" prefix byte-for-byte in Solidity, verified pqcKeyFromRecoveryCode(code, qorAddress) argument order, resolved QoreSeal jsdom cross-realm Uint8Array issues, and added live QoreX coin-118 vs. coin-60 lane mismatch detection and recovery. 5) End-to-End Verification Coverage: 17 passing root tests (15 Solidity unit + 256-run fuzz tests in QorePayGuard.t.sol + 2 Node/@qorechain/pqc byte-parity tests) plus 6 passing frontend Vitest tests (@qorechain/qorex-wallet-mock, QoreSeal round-trip & tamper checks, and Dual-RPC verification).

Timeline

Q-GateQuantum Pass

Earned a Ship Weeks badge.

Q-GateQuantum Pass

Pushed 9 commits to main

  • 37f1269 fix(wallet): detect QoreX coin-118 vs coin-60 mismatch, auto-sync account on focus, and auto-open Session Signer on EVM lane block · web-flow
  • 4c76a80 design(app): consumer fintech overhaul of Merchant, Checkout, Vault, and Verifier screens with live preview, toggles, tabs, and action animations · web-flow
  • a78978c feat(ui): consumer fintech polish, Light/Dark mode, Grainient WebGL shader, multi-font pairing, and paris/viaIR compiler alignment · web-flow
  • 2bcb902 design(landing): architectural long-scroll landing page, bespoke Q-Gate logo, and cover assets · web-flow
  • eefcd17 design(web): complete Swiss-minimalist obsidian redesign, clean logo/cover, and short useqgate.vercel.app domain · web-flow

and 4 more commits

Q-GateQuantum Pass

New project.

Comments and questions

  • No comments yet.