Protocol Whitepaper

QuantumDEX Whitepaper

A karma-powered, consciousness-aware decentralised exchange built natively on ThiChain L1 — the world's first quantum-safe, dharmic blockchain.

Version 0.9 (Draft)Date April 2026Chain ThiChain L1 · 420420

Abstract

QuantumDEX is the native decentralised exchange of the ThiChain Layer 1 blockchain — a quantum-safe, dharmic-ethics-embedded proof-of-karma blockchain. Unlike existing DEXs that treat all users identically, QuantumDEX introduces karma-adjusted trading: fees, liquidity incentives, and governance weight are dynamically computed from each participant's on-chain karma score, creating an ecosystem that rewards constructive, non-harmful behaviour.

QuantumDEX combines an automated market maker (AMM) with a perpetuals engine, a cross-chain bridge with ML-DSA-65 (NIST FIPS 204) post-quantum signatures, and governance via veQBIT vote-escrow — all governed by the Five Yamas ethical framework.

1. Background

1.1 The Problem with Existing DEXs

Current decentralised exchanges operate on purely financial logic: fees are flat, liquidity mining rewards short-term capital, and governance is dominated by large token holders. This produces:

  • Mercenary liquidity — capital leaves immediately when incentives end
  • Governance plutocracy — whale votes override community consensus
  • Quantum vulnerability — ECDSA signatures are broken by quantum computers, threatening all existing DEX state by approximately 2030
  • Ethics-blind execution — protocols cannot distinguish predatory from constructive behaviour

1.2 ThiChain as Foundation

ThiChain L1 provides three capabilities unavailable on any other chain:

  • Proof of Karma consensus — validator selection weight = karma × stake, making validator behaviour consequential
  • ML-DSA-65 cryptography — NIST FIPS 204 post-quantum signatures natively at the protocol layer
  • Dharmic Validator precompile (0x0423) — on-chain ethical validation of contract operations against the 5 Yamas

2. Architecture

Core Contracts
  • QuantumFactory.sol — pair registry
  • QuantumPair.sol — x·y=k AMM with karma fees
  • QuantumRouter.sol — swap routing + slippage
  • QuantumPerps.sol — perpetuals engine
  • QuantumBridge.sol — cross-chain ML-DSA-65
Governance Contracts
  • VotingEscrow.sol — veQBIT lock mechanism
  • QuantumGovernor.sol — proposal + voting
  • TimelockController.sol — 48h execution delay
  • FeeDistributor.sol — protocol revenue distribution
  • GaugeController.sol — liquidity gauge weights

2.1 ThiChain Integration Layer

All QuantumDEX contracts interact with ThiChain-native precompiles:

PrecompileAddressFunction
KarmaOracle0x0421On-chain karma score lookup per address
DharmicValidator0x04235-Yama ethical validation gate
ConsciousnessAI0x0420ML inference for QCS 15D scoring

3. Karma-Adjusted AMM

3.1 Fee Model

Standard AMMs charge flat fees. QuantumDEX charges fees inversely proportional to karma score:

Karma TierScore RangeFee
Visitor0–25030 BPS (0.30%)
Practitioner251–75015 BPS (0.15%)
Guardian751+Karma-scaled toward 0 BPS

3.2 x·y = k with Karma Modifier

The invariant is the standard constant product formula. Karma modifies the effective fee component f extracted before the invariant check, incentivising long-term positive-sum behaviour rather than pure arbitrage extraction.

3.3 TWAP Oracle

Price feeds use time-weighted average prices accumulated in QuantumPair._update(). Perpetuals mark prices are sourced from IQuantumTWAPOracle.getMarkPrice() — not spot price — to prevent oracle manipulation attacks.

4. Perpetuals Engine

QuantumPerps supports up to 20× leverage on supported pairs. Liquidations are capped at MAX_LIQUIDATION_BPS = 5000 (50% of position) to honour the Ahimsa principle — protecting counterparties from catastrophic loss.

Risk Notice: Perpetuals trading involves high risk of loss. Leverage amplifies both gains and losses.

5. Tokenomics

QBIT — Governance Token

Protocol governance token. Lock QBIT for veQBIT to vote, earn fees, and boost liquidity mining rewards (1×–2.5× boost based on lock duration).

THI — Gas Token

Thideva (ธิเทวา) is the native gas token of ThiChain L1. All QuantumDEX transactions consume THI for gas. QBIT is separate from THI.

Note: Final tokenomics figures (supply, allocation, vesting schedule) are pending legal confirmation. This document will be updated prior to NCA MiCA filing (deadline: July 2026).

6. Governance

Protocol upgrades, fee parameter changes, and gauge weights are controlled by veQBIT holders via QuantumGovernor.sol. All passed proposals execute through a 48-hour TimelockController — honouring the Aparigraha principle of non-hasty action.

The Six Sages Council (ThiChain-native) provides a non-binding advisory layer for proposals with significant dharmic implications.

7. Security

  • 1,827+ passing tests (Hardhat + Vitest), 0 failures
  • Reentrancy guards on all 8+ entry points in QuantumRouter
  • ML-DSA-65 post-quantum signatures on bridge (3,309-byte signatures)
  • Internal self-audit engine: 96.2/100 overall score
  • External security audit: planned post-testnet (Q3 2026)

See the Security page and Bug Bounty programme for details.

8. Roadmap

PhaseMilestoneStatus
0ThiChain L1 local testnet (3-node Docker)COMPLETE
1Public testnet — Hetzner VPS, DNS, BlockscoutIN PROGRESS
2QuantumDEX public testnet deploymentPLANNED
3External security audit (bridge priority)Q3 2026
4Mainnet launch + MiCA NCA filing2026
5KarmaLend + DharmicStable (ThiChain P3)Post-mainnet