Post-Quantum WOTS+ RFQ Protocol on Elysium
Quantum DEX replaces elliptic-curve custody and order authorization with hash-based Winternitz One-Time Signatures Plus (WOTS+) authenticated inside Merkle trees. Security reduces solely to the preimage and second-preimage resistance of Keccak256 — a symmetric hash primitive unaffected by Shor's algorithm.
1. WOTS+ Cryptographic Parameterization
Both the Solidity verifier (WOTSPlusVerifier.sol) and the TypeScript browser/server engine (src/lib/wots.ts) share an exact 1:1 domain-separated Keccak256 layout verified by automated cross-language parity vectors.
| Parameter | Value | Purpose |
|---|---|---|
| Hash Primitive | keccak256 | EVM-native 256-bit sponge; 128-bit post-quantum security margin under Grover |
| Winternitz Base (w) | 16 (MAX_STEP = 15) | 4-bit nibble encoding balancing signature size vs. EVM gas cost |
| Message Chains (LEN1) | 64 | 256-bit digest split into 64 big-endian 4-bit nibbles |
| Checksum Chains (LEN2) | 3 | sum(15 - m_i) in [0..960], encoded as 3 big-endian nibbles to prevent chain-forwarding forgery |
| Total Chains | 67 | Fixed bytes32[67] signature array per proof |
| Merkle Tree Height | 4..8 (default 6 = 64 leaves) | Single-slot uint256 leaf-burn bitmap tracks up to 256 one-time signatures per epoch |
// Exact 71-byte domain-separated chain step (Solidity <-> viem encodePacked 1:1)
chainStep(pubSeed, leafIndex, chainIdx, step, x) =
keccak256(abi.encodePacked(
bytes32 pubSeed, // 32 bytes
uint32 leafIndex, // 4 bytes (big-endian)
uint16 chainIdx, // 2 bytes (big-endian, 0..66)
uint8 step, // 1 byte (0..14)
bytes32 x // 32 bytes
))
// Leaf & Merkle interior domain separation
leafHash = keccak256(0x00 || pk[0] || pk[1] || ... || pk[66]) // 2,145 bytes
nodeHash = keccak256(0x01 || left || right) // 65 bytes2. Honest EVM Threat Model
Standard EVM chains still require an outer transaction sender to pay execution gas. Quantum DEX separates gas transport from custody and trade authorization so a compromised ECDSA private key cannot steal vaulted assets or forge maker quotes:
- Relayer-Agnostic Withdrawals:
QuantumQuoteVault.withdrawWithPQProofaccepts proofs submitted by any third-party relayer or fresh EOA. Funds release only whenWOTSPlusVerifier.verifyreconstructs the registered Merkle root over the domain-separated withdrawal digest and burns an unused leaf bit. - Balance-Guarded Keyset Rotation: Calling
registerKeysetwith ECDSA alone reverts withRotationRequiresPQProof()whenevernonZeroBalanceCount[account] > 0. Rotating an active funded keyset requires a valid WOTS+ proof from the current keyset viarotateKeysetWithPQProof. - Vault-Locked Maker Proceeds: When a taker settles an RFQ order through
QuantumDexRouter.fillQuantumQuote, the taker's payment tokens are pulled directly intoQuantumQuoteVaultand credited to the maker's quantum-locked balance — never sent to an unprotected EOA. - Strict Replay Protection: Every burned leaf sets its bit in
usedLeafBitmap[account][epoch]before external token transfers (Checks-Effects-Interactions + reentrancy guard), and every quote digest is marked inconsumedQuotes[digest].
3. Smart Contract Architecture & Gas Benchmarks
Compiled with solc 0.8.24 (via_ir = true, optimizer_runs = 200) and verified via Foundry gas reports:
| Contract / Function | Role | Median Gas |
|---|---|---|
| WOTSPlusVerifier.verify | 67-chain Winternitz reconstruction + Merkle path check | 95,254 gas |
| QuantumQuoteVault.withdrawWithPQProof | Verify WOTS+ proof, burn leaf, debit vault, transfer ERC-20 / unwrap HYPE | 173,192 gas |
| QuantumQuoteVault.rotateKeysetWithPQProof | PQ-authenticated epoch bump and Merkle root replacement | 203,052 gas |
| QuantumDexRouter.fillQuantumQuote | Verify maker WOTS+ quote, swap vault/ERC-20 legs atomically, update pair stats | 198,665 gas |
| QuantumDexRouter.cancelQuoteWithPQProof | Verify cancel-domain WOTS+ proof and mark quote digest consumed | 214,325 gas |
4. Elysium (Chain ID 99901) Registry
RPC: https://rpc.elysium.kinetiq.xyz | Explorer: https://elysium.kinetiq.xyz
| Asset / Contract | Decimals / Type | Elysium Address |
|---|---|---|
| WHYPE (Wrapped HYPE) | 18 decimals | 0xbA876237B0F021A6c6D852d6c26E107997cC5E81 |
| USDC (USD Coin) | 6 decimals | 0xb47c4C8F73F009CC0C0d3f92B388d13E293F0B65 |
| kHYPE (Kinetiq Staked HYPE) | 18 decimals | 0x248888D396A546A69A188f3Deb476964e581E9d0 |
| MONTRA (Montra) | 18 decimals | 0x063F7Cc5339f92a5FD7BaF3D22233044FdA1F327 |
| Aerodrome CL kHYPE/WHYPE Pool | Slipstream 6-word slot0() | 0x180Aa783D1cFFc984CECb27B710686146A8905Db |
| QuantumQuoteVault | PQ Custody Vault | 0x1957f8eA5E6bbcF26d5D06C735CF9231FF4Eb05f |
| QuantumDexRouter | RFQ Settlement & Pair Factory | 0xEd547718Cc99e322fbD777363CeE88a75dD2C06c |