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#
| Name | Value | Meaning | Source | Status |
|---|---|---|---|---|
N | 32 | hash output / chain value size, bytes (SHA-256) | wots.ts | Built |
W | 16 | Winternitz parameter | wots.ts | Built |
LEN1 / LEN2 / LEN | 64 / 3 / 67 | message digits / checksum digits / chains | wots.ts | Built |
WOTS_SIG_BYTES | 2,144 | one WOTS signature (67 × 32) | wots.ts, XMSS.sol | Built |
| WOTS verify cost | 45 – 990 | SHA-256 calls to finish the chains (best / worst) | derived | Built |
| Checksum range | 0 – 960 | Σ(15 − dᵢ), three base-16 digits, not left-shifted | wots.ts | Built |
| ADRS types | 0 / 1 / 2 / 3 | chain / leaf / node / secret | wots.ts | Built |
TREE_HEIGHT | 8 | height of each XMSS tree | xmss.ts, XMSS.sol | Built |
TREE_LEAVES | 256 | one-time keys per tree | xmss.ts | Built |
| Tree build cost | 274,943 | SHA-256 calls per tree (256 × 1,073 + 255) | derived | Built |
HT_LAYERS | 2 | hypertree layers | hypertree.ts | Built |
HT_CAPACITY | 65,536 | one-time signatures per identity (256 × 256) | hypertree.ts, QuantumAnchor.sol (MAX_CAPACITY) | Built |
HT_SIG_BYTES | 4,804 | hypertree signature: 4 + 2 × (2,144 + 8 × 32) | hypertree.ts | Built |
| Identity public key | 64 bytes | root_top ‖ pubSeed | hypertree.ts | Built |
| Bottom trees cached | 2 | the current bottom tree and its successor | hypertree.ts | Built |
| Reserved index | 0 | registration digest only; all other signers use ≥ 1 | attestation.ts, session.ts | Built |
| Top tree build | 420 ms | measured, Node (noble) | ARCHITECTURE §6.3 | Built |
| First bottom tree + sign | 398 ms | measured, Node (noble) | ARCHITECTURE §6.3 | Built |
| Each further signature | 1.1 ms | measured, Node (noble) | ARCHITECTURE §6.3 | Built |
PQ_ADDRESS_PREFIX | pq1 | address prefix; body = Base-58 of 20 digest bytes | address.ts | Built |
Encoding and domain#
| Name | Value | Meaning | Source | Status |
|---|---|---|---|---|
app (APP_ID) | qlab | domain identifier, permanent | protocol/messages.ts, QuantumDigest.sol | Built |
chain | 32 bytes | the chain id as a big-endian uint256, in every digest (56 = BNB Chain, 97 = testnet) | encoding.ts (chainBinding) | Built |
| Type tags | 0x01 str · 0x02 u64 · 0x03 bytes | field value types | encoding.ts | Built |
| Purpose pattern | ^[a-z][a-z0-9_-]{0,63}$ | allowed digest purposes | encoding.ts | Built |
| Key pattern | ^[a-z][a-zA-Z0-9_]{0,63}$ | allowed field names | encoding.ts | Built |
PROTOCOL_VERSION | 1 | version of every message | protocol/messages.ts | Built |
| Purposes | address, register, rotate, bind, launch, proof, wallet-attach, wallet-rotate, transfer, vault-register, vault-spend | one builder each, fixed field set | pq-crypto/address.ts, protocol/messages.ts | Built |
| Addresses in digests | raw 20 bytes (tag 0x03) | never hex text; letter case cannot change a digest | protocol/messages.ts | Built |
| Amounts in digests | 32 big-endian bytes (tag 0x03) | uint256 in the token's smallest unit | encoding.ts (u256) | Built |
| Native coin | 0x0000000000000000000000000000000000000000 | BNB wherever a token address is expected (NATIVE) | protocol/messages.ts | Built |
| Signed text | no control characters (U+0000–U+001F, U+007F) | rejects newline injection | protocol/messages.ts | Built |
| URLs in signed fields | https, no credentials, ≤ 200 chars | twitter, telegram, website | protocol/messages.ts | Built |
| Anchor call | anchor(bytes32 root, bytes32 pubSeed, uint32 capacity) | sent by the wallet to the anchor contract; the first anchor of a wallet is its origin for good | QuantumAnchor.sol, protocol/messages.ts (anchorArgs) | Built |
| Attestation key | qlab | metadata key of the LaunchAttestation | protocol/attestation.ts | Built |
| Attestation protocol | qlab/launch/v1 | protocol field | protocol/attestation.ts | Built |
MAX_ROTATIONS | 32 | longest rotation chain a verifier accepts | protocol/attestation.ts | Built |
Key derivation#
| Name | Value | Meaning | Source | Status |
|---|---|---|---|---|
| Wallet signature | 64 bytes | r ‖ s of the ECDSA (secp256k1) personal_sign signature over the derivation message; the recovery byte is dropped | kdf.ts | Built |
| HKDF salts | enc(app) ‖ "pub/v1", "sk/v1", "salt/v1", "child/v1" | domain-separated labels | kdf.ts | Built |
| HKDF info (seeds) | chain ‖ wallet (32 + 20 = 52 bytes) | binds the chain id and the wallet address | kdf.ts | Built |
Argon2id m | 65,536 KiB (64 MiB) | memory | kdf.ts ARGON2_PARAMS | Built |
Argon2id t | 3 | passes (0.76 s measured in Node, ~2 s in browsers) | kdf.ts | Built |
Argon2id p | 1 | lanes | kdf.ts | Built |
| Argon2id output | 32 bytes | hardening appended to the signature | kdf.ts | Built |
| Passphrase normalization | NFKC | before hashing | kdf.ts | Built |
MIN_PASSPHRASE_BITS | 60 | minimum log2 of zxcvbn-ts guesses (with score 4); a generated diceware phrase (6 EFF words ≈ 77.5 bits) is accepted on its entropy | kdf.ts, web app | Built |
| Child seed info | chain ‖ enc(purpose) ‖ u64(index) ‖ u16(length) | chain id and output length bound; length 16 – 8,160 bytes | kdf.ts | Built |
| Child purposes | scheme/<id> (index 0), mint, mint/scheme, wallet, vault/sk, vault/pub | mint and mint/scheme are CREATE2 salts; wallet is a secp256k1 private key | kdf.ts, protocol/session.ts, pq-crypto/vault.ts | Built |
| Scheme context | qlab/<chain id>/<purpose> | FIPS 204/205 and composite ctx (not Falcon) | schemes/index.ts | Built |
Launch and fees#
| Name | Value | Meaning | Source | Status |
|---|---|---|---|---|
| Launch modes | standard, quantum, war | quantum and war deliver the first buy to a vault | protocol/messages.ts | Built |
WAR_PLATE_SCHEMES | slh_dsa_sha2_128s, ml_dsa_65, falcon_512 | the three armor plates of a war launch, in this order | protocol/attestation.ts | Built |
| Token | 18 decimals, fixed supply | no owner, mint, tax, blacklist or pause | QuantumToken.sol | Built |
| Launch config | supply, opening market cap, pool fee, tick spacing | chosen with configId; the configs on offer are read from the factory | QuantumFactoryBase.sol | Built |
MAX_POOL_FEE | 100,000 (10 %) | highest pool fee a launch config may carry, in hundredths of a basis point | QuantumFactory.sol | Built |
| Creator side | feeCreatorBps = 10,000 − factory.protocolFeeBps() | of quote-side swap fees; stored in the locker at launch, fixed per coin; signed in the attestation | QuantumLockerBase.sol, protocol/messages.ts | Built |
MAX_PROTOCOL_FEE_BPS | 5,000 | the most the protocol's share can be; the value in force is read from the factory | QuantumFactoryBase.sol | Built |
| Token-side fees | burned | sent to 0x…dEaD at every collection | QuantumLockerBase.sol | Built |
holdersBps | 0 – 10,000 | part of the creator side streamed to holders; > 0 deploys a reward token | protocol/messages.ts, QuantumFactoryBase.sol | Built |
| Reward stream | 1 hour – 7 days | a batch streams for as long as it took to build up (MIN_STREAM, MAX_STREAM) | QuantumRewardToken.sol | Built |
MAX_ANTI_SNIPE_SECONDS | 1,800 | longest anti-snipe window; 0 = a plain pool with no hook | protocol/messages.ts, QuantumSnipeGuard.sol (MAX_DURATION) | Built |
Anti-snipe START_FEE | 990,000 (99 %) | what a buy pays in the first second; falls in a straight line to the pool fee | QuantumSnipeGuard.sol | Built |
MAX_LAUNCH_FEE | 1 BNB | cap on the flat launch fee; the fee in force is read from the factory (launchFeeWei) | QuantumFactoryBase.sol | Built |
| Opening-tick tolerance | 3 tick spacings (at most 25) | how far from previewLaunch a launch may open | txbuild/launch.ts | Built |
| Seal | AES-256-GCM, 32-byte key, 12-byte IV, 16-byte tag, plaintext ≤ 2,048 bytes | commitment = SHA-256(iv ‖ ciphertext) | api-contract/seal.ts | Built |
| Seal timing | reveal 60 s – 24 h after creation; open window 24 h | then the seal expires | api-contract/seal.ts | Built |
Ledger and data model#
| Name | Value | Meaning | Source | Status |
|---|---|---|---|---|
| Client ledger states | allocated → signing → signed | per index | ledger.ts | Built |
| Server ledger states | reserved → signed → burned (no release) | per (identity, idx), never re-issued | schema.prisma | Built |
leaf_ledger.idx | 0 – 65,535 | CHECK | invariants.sql | Built |
identities.capacity | 1 – 65,536, default 65,536 | CHECK | invariants.sql | Built |
| Active identity | needs anchor_tx_hash and anchor_block | CHECK | invariants.sql | Built |
| Addresses, hashes, amounts | ^0x[0-9a-f]{40}$, ^0x[0-9a-f]{64}$, 0 … 2^256 − 1 | CHECK on every such column; lowercase only | invariants.sql | Built |
| Challenge nonce | 32 bytes, single use | CHECK + atomic consume | schema.prisma | Built |
| Transfer nonce | 32 bytes, UNIQUE | replay protection, with tx_nonce | schema.prisma | Built |
| Quantum and war launch | needs a vault address and a first buy > 0 | CHECK | invariants.sql | Built |
launches.anti_snipe_seconds, holders_bps, fee_creator_bps | 0 – 1,800, 0 – 10,000, 0 – 10,000 | CHECK | invariants.sql | Built |
vaults.next_leaf, spends | 0 – 256, spends ≤ next_leaf | mirrors of the on-chain vault state | schema.prisma | Built |
| Launch name / symbol / description | ≤ 32 / ≤ 10 / ≤ 500 chars | column limits | schema.prisma | Built |
Vault#
| Name | Value | Meaning | Source | Status |
|---|---|---|---|---|
| Vault address | CREATE2(factory, SHA-256(root ‖ pubSeed), EIP-1167 clone of the implementation) | stable deposit address, computed locally | QuantumVaultFactory.sol, protocol/vault-address.ts | Built |
| State | root, pubSeed, nextLeaf (uint16), spends (uint16) | plus the immutable factory | QuantumVault.sol | Built |
| Leaf rule | withdraw at leaf L needs L ≥ nextLeaf, then nextLeaf = L + 1 | a newer spend kills every older signature | QuantumVault.sol | Built |
| Spend digest | purpose vault-spend: program (the vault factory), vault, leaf, recipient, mint, amount | the contract rebuilds it with block.chainid | protocol/messages.ts, QuantumDigest.sol | Built |
| Spends per vault | 256 | one XMSS tree of height 8 (CAPACITY) | pq-crypto/vault.ts, QuantumVault.sol | Built |
| Withdraw signature | 2,401 bytes | u8(leaf) ‖ σ (2,144) ‖ auth (256) (VAULT_SIG_BYTES), passed as calldata | pq-crypto/vault.ts, QuantumVault.sol | Built |
| Transactions per withdrawal | 1 | verification and payment in the same call; the first spend can also deploy the clone | QuantumVaultFactory.sol | Built |
| On-chain XMSS verification | ≈ 215k gas | local measurement; varies with the digest (45–990 chain steps at about 360 gas each) | contract tests, vault-client/config.ts | Built |
| Whole withdrawal | 265k – 320k gas | local measurement, deployed vault | vault-client/config.ts | Built |
| First withdrawal with deployment | 360k – 415k gas | local measurement, factory.withdraw deploys the clone | vault-client/config.ts | Built |
| Gas budget | 700,000 / 850,000 | what the client budgets for a deployed / undeployed vault (WITHDRAW_GAS) | vault-client/config.ts | Built |
| Cancel | 1 wei of the native coin to the vault itself, at a newer leaf | the only way to retire a signed, unsent spend | vault-client/plan.ts | Built |
| Owner, upgrades | none | no owner, no upgrade path, no pause, no rescue function | QuantumVault.sol, QuantumVaultFactory.sol | Built |
| Independent audit | of the vault, anchor and launchpad contracts | Planned |
Schemes#
| Scheme id | Signature (bytes) | Public key (bytes) | Seed (bytes) | Status |
|---|---|---|---|---|
wots (hypertree) | 4,804 | 64 | – | Built |
ml_dsa_65 | 3,309 | 1,952 | 32 | Built |
ml_dsa_87 | 4,627 | 2,592 | 32 | Built |
slh_dsa_sha2_128s | 7,856 | 32 | 48 | Built |
slh_dsa_shake_128f | 17,088 | 32 | 48 | Built |
falcon_512 | ≤ 666 | 897 | 48 | Built |
falcon_1024 | ≤ 1,280 | 1,793 | 48 | Built |
composite_mldsa65_ed25519 (draft-19, OID 1.3.6.1.5.5.7.6.48) | 3,373 | 1,984 | 64 | Built |
Libraries#
| Library | Version | Used for |
|---|---|---|
@noble/hashes | 2.4.0 | SHA-256, HKDF, Argon2id, Keccak-256 (addresses) |
@scure/base | 2.4.0 | Base-58 (pq address) |
@noble/post-quantum | see backend/packages/schemes/package.json | ML-DSA, SLH-DSA, Falcon |
@noble/curves | see backend/packages/schemes/package.json | Ed25519 (the classical half of the composite scheme) |
viem | see backend/packages/evm/package.json | EVM clients, ABI encoding, transaction parsing |
| Solidity | 0.8.28, EVM version cancun | the contracts; OpenZeppelin for clones and token transfers |
