Skip to content
QLab
On this page

Parameters

Built values are read from backend/packages/pq-crypto/src, backend/packages/schemes/src, backend/packages/protocol/src, the Solidity contracts and the database schema (backend/packages/db/prisma). Planned values may change. Values that the factory's owner sets (launch configs, launch fee, protocol share) and all contract addresses are not constants: they are read from the chain, and this page gives only the limits the contracts enforce.

Hash-based signatures#

NameValueMeaningSourceStatus
N32hash output / chain value size, bytes (SHA-256)wots.tsBuilt
W16Winternitz parameterwots.tsBuilt
LEN1 / LEN2 / LEN64 / 3 / 67message digits / checksum digits / chainswots.tsBuilt
WOTS_SIG_BYTES2,144one WOTS signature (67 × 32)wots.ts, XMSS.solBuilt
WOTS verify cost45 – 990SHA-256 calls to finish the chains (best / worst)derivedBuilt
Checksum range0 – 960Σ(15 − dᵢ), three base-16 digits, not left-shiftedwots.tsBuilt
ADRS types0 / 1 / 2 / 3chain / leaf / node / secretwots.tsBuilt
TREE_HEIGHT8height of each XMSS treexmss.ts, XMSS.solBuilt
TREE_LEAVES256one-time keys per treexmss.tsBuilt
Tree build cost274,943SHA-256 calls per tree (256 × 1,073 + 255)derivedBuilt
HT_LAYERS2hypertree layershypertree.tsBuilt
HT_CAPACITY65,536one-time signatures per identity (256 × 256)hypertree.ts, QuantumAnchor.sol (MAX_CAPACITY)Built
HT_SIG_BYTES4,804hypertree signature: 4 + 2 × (2,144 + 8 × 32)hypertree.tsBuilt
Identity public key64 bytesroot_top ‖ pubSeedhypertree.tsBuilt
Bottom trees cached2the current bottom tree and its successorhypertree.tsBuilt
Reserved index0registration digest only; all other signers use ≥ 1attestation.ts, session.tsBuilt
Top tree build420 msmeasured, Node (noble)ARCHITECTURE §6.3Built
First bottom tree + sign398 msmeasured, Node (noble)ARCHITECTURE §6.3Built
Each further signature1.1 msmeasured, Node (noble)ARCHITECTURE §6.3Built
PQ_ADDRESS_PREFIXpq1address prefix; body = Base-58 of 20 digest bytesaddress.tsBuilt

Encoding and domain#

NameValueMeaningSourceStatus
app (APP_ID)qlabdomain identifier, permanentprotocol/messages.ts, QuantumDigest.solBuilt
chain32 bytesthe chain id as a big-endian uint256, in every digest (56 = BNB Chain, 97 = testnet)encoding.ts (chainBinding)Built
Type tags0x01 str · 0x02 u64 · 0x03 bytesfield value typesencoding.tsBuilt
Purpose pattern^[a-z][a-z0-9_-]{0,63}$allowed digest purposesencoding.tsBuilt
Key pattern^[a-z][a-zA-Z0-9_]{0,63}$allowed field namesencoding.tsBuilt
PROTOCOL_VERSION1version of every messageprotocol/messages.tsBuilt
Purposesaddress, register, rotate, bind, launch, proof, wallet-attach, wallet-rotate, transfer, vault-register, vault-spendone builder each, fixed field setpq-crypto/address.ts, protocol/messages.tsBuilt
Addresses in digestsraw 20 bytes (tag 0x03)never hex text; letter case cannot change a digestprotocol/messages.tsBuilt
Amounts in digests32 big-endian bytes (tag 0x03)uint256 in the token's smallest unitencoding.ts (u256)Built
Native coin0x0000000000000000000000000000000000000000BNB wherever a token address is expected (NATIVE)protocol/messages.tsBuilt
Signed textno control characters (U+0000–U+001F, U+007F)rejects newline injectionprotocol/messages.tsBuilt
URLs in signed fieldshttps, no credentials, ≤ 200 charstwitter, telegram, websiteprotocol/messages.tsBuilt
Anchor callanchor(bytes32 root, bytes32 pubSeed, uint32 capacity)sent by the wallet to the anchor contract; the first anchor of a wallet is its origin for goodQuantumAnchor.sol, protocol/messages.ts (anchorArgs)Built
Attestation keyqlabmetadata key of the LaunchAttestationprotocol/attestation.tsBuilt
Attestation protocolqlab/launch/v1protocol fieldprotocol/attestation.tsBuilt
MAX_ROTATIONS32longest rotation chain a verifier acceptsprotocol/attestation.tsBuilt

Key derivation#

NameValueMeaningSourceStatus
Wallet signature64 bytesr ‖ s of the ECDSA (secp256k1) personal_sign signature over the derivation message; the recovery byte is droppedkdf.tsBuilt
HKDF saltsenc(app) ‖ "pub/v1", "sk/v1", "salt/v1", "child/v1"domain-separated labelskdf.tsBuilt
HKDF info (seeds)chain ‖ wallet (32 + 20 = 52 bytes)binds the chain id and the wallet addresskdf.tsBuilt
Argon2id m65,536 KiB (64 MiB)memorykdf.ts ARGON2_PARAMSBuilt
Argon2id t3passes (0.76 s measured in Node, ~2 s in browsers)kdf.tsBuilt
Argon2id p1laneskdf.tsBuilt
Argon2id output32 byteshardening appended to the signaturekdf.tsBuilt
Passphrase normalizationNFKCbefore hashingkdf.tsBuilt
MIN_PASSPHRASE_BITS60minimum log2 of zxcvbn-ts guesses (with score 4); a generated diceware phrase (6 EFF words ≈ 77.5 bits) is accepted on its entropykdf.ts, web appBuilt
Child seed infochain ‖ enc(purpose) ‖ u64(index) ‖ u16(length)chain id and output length bound; length 16 – 8,160 byteskdf.tsBuilt
Child purposesscheme/<id> (index 0), mint, mint/scheme, wallet, vault/sk, vault/pubmint and mint/scheme are CREATE2 salts; wallet is a secp256k1 private keykdf.ts, protocol/session.ts, pq-crypto/vault.tsBuilt
Scheme contextqlab/<chain id>/<purpose>FIPS 204/205 and composite ctx (not Falcon)schemes/index.tsBuilt

Launch and fees#

NameValueMeaningSourceStatus
Launch modesstandard, quantum, warquantum and war deliver the first buy to a vaultprotocol/messages.tsBuilt
WAR_PLATE_SCHEMESslh_dsa_sha2_128s, ml_dsa_65, falcon_512the three armor plates of a war launch, in this orderprotocol/attestation.tsBuilt
Token18 decimals, fixed supplyno owner, mint, tax, blacklist or pauseQuantumToken.solBuilt
Launch configsupply, opening market cap, pool fee, tick spacingchosen with configId; the configs on offer are read from the factoryQuantumFactoryBase.solBuilt
MAX_POOL_FEE100,000 (10 %)highest pool fee a launch config may carry, in hundredths of a basis pointQuantumFactory.solBuilt
Creator sidefeeCreatorBps = 10,000 − factory.protocolFeeBps()of quote-side swap fees; stored in the locker at launch, fixed per coin; signed in the attestationQuantumLockerBase.sol, protocol/messages.tsBuilt
MAX_PROTOCOL_FEE_BPS5,000the most the protocol's share can be; the value in force is read from the factoryQuantumFactoryBase.solBuilt
Token-side feesburnedsent to 0x…dEaD at every collectionQuantumLockerBase.solBuilt
holdersBps0 – 10,000part of the creator side streamed to holders; > 0 deploys a reward tokenprotocol/messages.ts, QuantumFactoryBase.solBuilt
Reward stream1 hour – 7 daysa batch streams for as long as it took to build up (MIN_STREAM, MAX_STREAM)QuantumRewardToken.solBuilt
MAX_ANTI_SNIPE_SECONDS1,800longest anti-snipe window; 0 = a plain pool with no hookprotocol/messages.ts, QuantumSnipeGuard.sol (MAX_DURATION)Built
Anti-snipe START_FEE990,000 (99 %)what a buy pays in the first second; falls in a straight line to the pool feeQuantumSnipeGuard.solBuilt
MAX_LAUNCH_FEE1 BNBcap on the flat launch fee; the fee in force is read from the factory (launchFeeWei)QuantumFactoryBase.solBuilt
Opening-tick tolerance3 tick spacings (at most 25)how far from previewLaunch a launch may opentxbuild/launch.tsBuilt
SealAES-256-GCM, 32-byte key, 12-byte IV, 16-byte tag, plaintext ≤ 2,048 bytescommitment = SHA-256(iv ‖ ciphertext)api-contract/seal.tsBuilt
Seal timingreveal 60 s – 24 h after creation; open window 24 hthen the seal expiresapi-contract/seal.tsBuilt

Ledger and data model#

NameValueMeaningSourceStatus
Client ledger statesallocated → signing → signedper indexledger.tsBuilt
Server ledger statesreserved → signed → burned (no release)per (identity, idx), never re-issuedschema.prismaBuilt
leaf_ledger.idx0 – 65,535CHECKinvariants.sqlBuilt
identities.capacity1 – 65,536, default 65,536CHECKinvariants.sqlBuilt
Active identityneeds anchor_tx_hash and anchor_blockCHECKinvariants.sqlBuilt
Addresses, hashes, amounts^0x[0-9a-f]{40}$, ^0x[0-9a-f]{64}$, 0 … 2^256 − 1CHECK on every such column; lowercase onlyinvariants.sqlBuilt
Challenge nonce32 bytes, single useCHECK + atomic consumeschema.prismaBuilt
Transfer nonce32 bytes, UNIQUEreplay protection, with tx_nonceschema.prismaBuilt
Quantum and war launchneeds a vault address and a first buy > 0CHECKinvariants.sqlBuilt
launches.anti_snipe_seconds, holders_bps, fee_creator_bps0 – 1,800, 0 – 10,000, 0 – 10,000CHECKinvariants.sqlBuilt
vaults.next_leaf, spends0 – 256, spends ≤ next_leafmirrors of the on-chain vault stateschema.prismaBuilt
Launch name / symbol / description≤ 32 / ≤ 10 / ≤ 500 charscolumn limitsschema.prismaBuilt

Vault#

NameValueMeaningSourceStatus
Vault addressCREATE2(factory, SHA-256(root ‖ pubSeed), EIP-1167 clone of the implementation)stable deposit address, computed locallyQuantumVaultFactory.sol, protocol/vault-address.tsBuilt
Stateroot, pubSeed, nextLeaf (uint16), spends (uint16)plus the immutable factoryQuantumVault.solBuilt
Leaf rulewithdraw at leaf L needs L ≥ nextLeaf, then nextLeaf = L + 1a newer spend kills every older signatureQuantumVault.solBuilt
Spend digestpurpose vault-spend: program (the vault factory), vault, leaf, recipient, mint, amountthe contract rebuilds it with block.chainidprotocol/messages.ts, QuantumDigest.solBuilt
Spends per vault256one XMSS tree of height 8 (CAPACITY)pq-crypto/vault.ts, QuantumVault.solBuilt
Withdraw signature2,401 bytesu8(leaf) ‖ σ (2,144) ‖ auth (256) (VAULT_SIG_BYTES), passed as calldatapq-crypto/vault.ts, QuantumVault.solBuilt
Transactions per withdrawal1verification and payment in the same call; the first spend can also deploy the cloneQuantumVaultFactory.solBuilt
On-chain XMSS verification≈ 215k gaslocal measurement; varies with the digest (45–990 chain steps at about 360 gas each)contract tests, vault-client/config.tsBuilt
Whole withdrawal265k – 320k gaslocal measurement, deployed vaultvault-client/config.tsBuilt
First withdrawal with deployment360k – 415k gaslocal measurement, factory.withdraw deploys the clonevault-client/config.tsBuilt
Gas budget700,000 / 850,000what the client budgets for a deployed / undeployed vault (WITHDRAW_GAS)vault-client/config.tsBuilt
Cancel1 wei of the native coin to the vault itself, at a newer leafthe only way to retire a signed, unsent spendvault-client/plan.tsBuilt
Owner, upgradesnoneno owner, no upgrade path, no pause, no rescue functionQuantumVault.sol, QuantumVaultFactory.solBuilt
Independent auditof the vault, anchor and launchpad contractsPlanned

Schemes#

Scheme idSignature (bytes)Public key (bytes)Seed (bytes)Status
wots (hypertree)4,80464–Built
ml_dsa_653,3091,95232Built
ml_dsa_874,6272,59232Built
slh_dsa_sha2_128s7,8563248Built
slh_dsa_shake_128f17,0883248Built
falcon_512≤ 66689748Built
falcon_1024≤ 1,2801,79348Built
composite_mldsa65_ed25519 (draft-19, OID 1.3.6.1.5.5.7.6.48)3,3731,98464Built

Libraries#

LibraryVersionUsed for
@noble/hashes2.4.0SHA-256, HKDF, Argon2id, Keccak-256 (addresses)
@scure/base2.4.0Base-58 (pq address)
@noble/post-quantumsee backend/packages/schemes/package.jsonML-DSA, SLH-DSA, Falcon
@noble/curvessee backend/packages/schemes/package.jsonEd25519 (the classical half of the composite scheme)
viemsee backend/packages/evm/package.jsonEVM clients, ABI encoding, transaction parsing
Solidity0.8.28, EVM version cancunthe contracts; OpenZeppelin for clones and token transfers