Docs · protocol v1

How Q-Day works

The full technical picture: hash-based keys, how they are derived from your wallet, what each signature commits to, and what the vault program enforces on Solana. Every formula here matches the open @qday/pq code byte for byte.

WOTS(w=16, SHA-256) + Merkle(h=8)SHA-256 onlySolana mainnet
§01

Overview

Q-Day is a launchpad on Solana where every coin, every identity and every vault withdrawal carries a hash-based post-quantum signature: Winternitz one-time signatures (WOTS) collected under a Merkle tree, built on SHA-256 alone. Anyone can check those signatures with the open @qday/pq library, and the qday_vault Solana program enforces them for funds held in a Quantum Vault.

Signature
2,404 B
leaf ‖ WOTS σ ‖ auth path
Public key
64 B
root ‖ pkSeed
One-time keys
256
per identity, h = 8
Vault program
listed on the status page
qday_vault (Anchor)

Coins are created on a Solana bonding curve with the platform treasury as creator. The identity is derived from one wallet signature, so there is no new seed phrase. The page below specifies each step exactly as the code does it.

§02

Threat model

A large enough quantum computer running Shor's algorithm recovers an ed25519 or ECDSA secret key from its public key. Every Solana account that has ever signed has a public key on chain, so on that day every such key is forgeable. Hash functions are only weakened by Grover's algorithm, which gives a square-root speed-up: finding a second preimage of SHA-256 still costs about 2128 quantum work.

  • Assumed: SHA-256 is second-preimage and collision resistant; the user's browser is not compromised while keys are in memory.
  • Not assumed: ed25519 stays secure. Q-Day signatures must hold up even after it falls.
  • Attacker goals we defend: forging a launch attestation, impersonating an identity, spending a Quantum Vault.
  • Out of scope: Solana consensus and normal account security. Solana itself still accepts only ed25519 for ordinary accounts (see PQ wallet).
§03

Primitives

One hash, SHA-256 (n = 32 bytes), used as a tweakable hash. Every call is domain-separated by a public seed and a 32-byte address (ADRS), so no two hash calls anywhere in the scheme share an input prefix.

formula
F(pkSeed, ADRS, x) = SHA-256(pkSeed ‖ ADRS ‖ x)
BytesField (u32 big-endian)Meaning
0–3type0 chain · 1 leaf public key · 2 tree node · 3 secret-key PRF
4–7aleaf index (types 0, 1, 3) or height (type 2)
8–11bchain index (types 0, 3) or node index at that height (type 2)
12–15cchain step j (type 0)
16–31—zero
§04

WOTS one-time keys

Winternitz parameter w = 16. A 32-byte digest is split into 64 base-16 digits (high nibble first), followed by a 3-digit checksum, giving len = 67 hash chains of length 15.

digits
d[2i]   = msg[i] >> 4          for i in 0..31
d[2i+1] = msg[i] & 0x0f
C       = Σ_{i<64} (15 − d[i])      // 0 ≤ C ≤ 960 < 16³
d[64..66] = C as 3 nibbles, high nibble first

The checksum is what makes the scheme unforgeable: raising any message digit (walking a chain further, which anyone can do) lowers C, and lowering a checksum digit would require inverting SHA-256.

keys, sign, verify
skᵢ = SHA-256(skSeed ‖ ADRS(3, leaf, i))
step j of chain i:   x ← F(pkSeed, ADRS(0, leaf, i, j), x)
pkᵢ = F¹⁵(skᵢ)                     // steps 0..14
σᵢ  = F^dᵢ(skᵢ)                    // steps 0..dᵢ−1
verify: F^(15−dᵢ)(σᵢ), starting at step dᵢ, must equal pkᵢ
Chain i of leaf L · each arrow is F(pkSeed, ADRS(0, L, i, j), ·)0123456789101112131415skᵢσᵢpkᵢsigner: dᵢ steps (here dᵢ = 6)verifier: 15 − dᵢ steps, must land on pkᵢskᵢ = SHA-256(skSeed ‖ ADRS(3, L, i)) · 67 chains per key · total sign + verify = 67 × 15 = 1,005 hashes
Fig. 1One of the 67 chains. The signer reveals the value at step dᵢ; the verifier completes the remaining steps.
CostValue
WOTS signature67 × 32 B = 2,144 B
Sign + verify hashes for one digest67 × 15 = 1,005 (they always sum to this)
Verify hashes, range45 (every digit 15) to 990 (every digit 0)
Key generation per leaf67 PRF + 1,005 chain steps + 1 leaf hash = 1,073

Never reuse a leaf. Two signatures from one WOTS key reveal enough chain values to forge a third. The server ledger refuses any leaf already used, and each vault key signs exactly once before it becomes a tombstone.

§05

Merkle identities

An identity is 256 WOTS keys under a Merkle tree of height 8. The 32-byte root plus the 32-byte pkSeed is the whole public key.

tree
leaf_i      = SHA-256(pkSeed ‖ ADRS(1, i) ‖ pk₀ ‖ … ‖ pk₆₆)
node(h, j)  = SHA-256(pkSeed ‖ ADRS(2, h, j) ‖ left ‖ right)     // h = 1..8
root        = node(8, 0)
Leaf 5 signs. The signature carries the cyan siblings; the verifier rebuilds the amber path to the root.leaf 0leaf 1leaf 2leaf 3leaf 4leaf 5leaf 6leaf 7n(1,0)n(1,1)n(1,2)n(1,3)n(2,0)n(2,1)rootrecomputed pathauth path (bottom-up)Production: h = 8, 256 leaves, 8 × 32 B = 256 B auth path
Fig. 2Authentication path for leaf 5. At each height the verifier hashes with the sibling, left or right according to the index bit.
Wire fieldBytes
u32be leaf4
σ₀ … σ₆₆2,144
auth[0..7] (bottom-up)256
Total2,404

The public address is short and checkable:

address
pqAddress = "q1" + base58( SHA-256("qday/addr/v1" ‖ pkSeed ‖ root)[0..20] )

Building the full tree takes 256 × 1,073 + 255 = 274,943 SHA-256 calls. The browser runs this in a Web Worker in roughly half a second, and the secrets never leave that tab's memory.

§06

Key derivation

There is no new seed phrase. The wallet signs a fixed message with signMessage. Ed25519 (RFC 8032) is deterministic, so the same wallet always yields the same 64-byte signature and therefore the same identity. On first use the client asks for two signatures and compares them, to catch wallets that do not sign deterministically.

deriveMessage(wallet)
Q-Day — Post-Quantum Identity Derivation v1

Signing this message derives your post-quantum identity in this browser.
It is not a transaction and costs nothing.

Wallet: <wallet base58>
seeds
h_pass = scrypt(NFKC(passphrase), salt = SHA-256("qday/salt/v1" ‖ walletPubkey),
                N = 32,768, r = 8, p = 1, dkLen = 32)      // optional
IKM    = σ_wallet ‖ h_pass                  // just σ_wallet without a passphrase
skSeed = HKDF-SHA256(IKM, salt = "qday/identity/v1", info = "sk:"  ‖ walletPubkey, 32)
pkSeed = HKDF-SHA256(IKM, salt = "qday/identity/v1", info = "pub:" ‖ walletPubkey, 32)

Every other key is a domain sub-key: subkey(ikm, label, extra) = HKDF-SHA256(ikm, no salt, info = label ‖ extra, 32).

UseDerivation
Mint keypair for the launch signed by leaf Led25519 seed = subkey(skSeed, "qday/mint/v1", u32be(L))
Scheme key s (ML-DSA, SLH-DSA, Falcon…)subkey(skSeed, "qday/scheme/v1", utf8(s))
Vault key #iskSeed_i = subkey(skSeed, "qday/vault/v1/sk", u32be(i))
pubSeed_i = subkey(pkSeed, "qday/vault/v1/pub", u32be(i))
Pool seedssubkey(skSeed, "qday/pool/v1/sk")
subkey(pkSeed, "qday/pool/v1/pub")
App wallet #indexed25519 seed = subkey(skSeed, "qday/wallet/v1", u32be(index))

Because the mint keypair is derived from the leaf that signs the launch, each coin's mint address is tied to exactly one one-time key.

§07

Registration + on-chain anchor

Registration publishes the root and pkSeed. One canonical statement is signed twice: by the wallet (ed25519) and by WOTS leaf 0, which is then burned. Canonical form is a domain line followed by key=value lines with keys sorted, each ending in a newline.

registration statement
qday/register/v1
height=8
pqAddress=<q1…>
pubSeed=<hex>
root=<hex>
scheme=WOTS(w=16,SHA-256)+Merkle(h=8)
wallet=<base58>

The wallet signs the statement text; leaf 0 signs SHA-256(statement). The server checks both, checks that pqAddress matches root and pkSeed, and records leaf 0 as used. The wallet then posts an SPL Memo so the binding is public and timestamped on Solana:

memo
qday:v1:anchor:<pqAddress>:<root hex>

The server stores the memo transaction signature only after confirming it on chain.

§08

Launch attestation

Each coin is attested by one leaf of the creator's tree. The digest covers every field that defines the coin:

launchDigest
d = SHA-256(
  "qday/launch/v1\n" +
  "creator=<wallet>\n" + "image=<ipfs://…>\n" + "leaf=<L>\n" + "mint=<mint>\n" +
  "name=<name>\n" + "scheme=<scheme>\n" + "symbol=<symbol>\n"
)   // keys sorted; a value containing a newline is rejected
BrowserQ-Day serverSolana mainnet1 · derive mint_LHKDF(skSeed, mint, L)2 · d = launchDigestWOTS sign + auth path3 · verify XMSSburn leaf L4 · pin metadatabuild v0 create_v2 tx5 · sign txmint_L, then wallet6 · coin livecreator = treasuryThe server checks fee payer, mint and pump program before sending (submit).
Fig. 3A launch, end to end. Leaf L is burned before the transaction is built, so a failed launch still consumes the leaf.
  1. The browser derives mint_L and computes d.
  2. It signs d with WOTS leaf L and attaches the auth path.
  3. POST /api/launch/prepare with the fields, mint_L and the signature.
  4. The server verifies the XMSS signature against the registered root and burns leaf L in the ledger.
  5. It pins the metadata JSON to IPFS (Pinata).
  6. It builds a v0 transaction: the bonding-curve create_v2 instruction (Token-2022) with creator = platform treasury, an optional dev buy and a compute-budget instruction, using an address lookup table (about 40 accounts would exceed the 1,232-byte limit without it).
  7. The browser signs as mint_L, then as the wallet, and calls POST /api/launch/submit.
  8. The server checks the fee payer, the mint and that the pump program is invoked, then sends.

Metadata

The standard token metadata carries a qday object so any indexer can verify the coin without asking us:

metadata.json
{
  "name": "<name>",
  "symbol": "<symbol>",
  "description": "<description>",
  "image": "ipfs://<cid>",
  "twitter": "<x link>",
  "website": "<site>/coin/<mint>",
  "qday": {
    "version": 1,
    "scheme": "WOTS(w=16,SHA-256)+Merkle(h=8)",
    "pqAddress": "q1…",
    "root": "<64 hex>",
    "pubSeed": "<64 hex>",
    "height": 8,
    "messageHash": "<hex of d>",
    "signature": { "leaf": <L>, "wots": "<2,144 B hex>", "auth": ["<32 B hex>", "… 8 entries"] }
  }
}

Modes and creator fees

  • Standard: the dev buy goes to the creator's wallet.
  • Quantum: the dev buy is deposited into the creator's Quantum Vault in the same transaction.
  • Dev buy 0–2 SOL; image PNG/JPG/WEBP/GIF up to 5 MB; about 0.02 SOL in rent and fees. Pair: SOL.

The treasury is the creator of every Q-Day coin, so all creator fees accrue to it. The keeper claims them hourly with collect_creator_fee on the bonding curve and collect_coin_creator_fee on PumpSwap (see Revenue).

§09

Signature schemes

WOTS + Merkle is the default and the only scheme the vault program verifies. A launch can additionally carry a signature from one of these schemes, implemented with @noble/post-quantum:

SchemeSignaturePublic key
ML-DSA-65 (FIPS 204)3,309 B1,952 B
ML-DSA-87 (FIPS 204)4,627 B2,592 B
SLH-DSA-SHA2-128s (FIPS 205)7,856 B32 B
SLH-DSA-SHAKE-128f (FIPS 205)17,088 B32 B
Falcon-512≤ 666 B897 B
Falcon-1024≤ 1,280 B1,793 B
ed25519 + ML-DSA-65 hybrid (both must verify)3,373 B1,984 B

Binding

A scheme key is derived from skSeed and certified once by a WOTS leaf, so it inherits the identity's root of trust:

bindDigest
bind = SHA-256("qday/bind/v1\n" ‖ pqAddress ‖ "\n" ‖ scheme ‖ "\n" ‖ SHA-256(schemePk))

The scheme key then signs the launch over creator, image, mint, name, scheme, symbol under the launch domain. Each bound scheme costs one leaf.

§10

Proof of possession

Anyone can ask a wallet to prove it still controls its post-quantum identity, using the next unused leaf.

proofDigest
nonce  = 32 random bytes from the server, valid 5 minutes
digest = SHA-256("qday/proof/v1\n" ‖ u32be(leaf) ‖ nonce ‖ walletPubkey)
StatusMeaning
200{ ok: true, leaf }
404No challenge for this wallet and nonce
409Signature does not verify, or the leaf was already used
410Challenge expired

The challenge is consumed even when verification fails, so a nonce can never be retried.

§11

PQ wallet

Solana still enforces only ed25519. The vault is what enforces PQ. An ordinary Solana account, including the app wallet, can be spent by anyone who holds its ed25519 key, whatever else is attached to the transaction.

The app wallet is derived (qday/wallet/v1) and never stored. Each transfer is dual-signed: the normal ed25519 transaction carries, in a memo, the hash of a WOTS signature over

transferDigest
SHA-256("qday/transfer/v1" ‖ u64le(amount) ‖ from ‖ mint ‖ nonce ‖ to ‖ u32be(leaf))   // mint = 32 zero bytes for SOL

That gives a public, post-quantum audit trail of what the owner authorised. It does not stop a quantum attacker from moving funds out of an ed25519 account. For that, hold funds in a Quantum Vault.

§12

Quantum Vault

qday_vault (program id listed on the status page) holds SOL, SPL and Token-2022 balances in PDAs that have no ed25519 spend path. The only way out is a valid WOTS signature checked on chain.

vault address
keyHash_i = SHA-256(pubSeed_i ‖ pk₀ ‖ … ‖ pk₆₆)           // vault key i, leaf 0 in its own domain
vault_i   = PDA(seeds = ["vault", [0x01], keyHash_i], program)
spend digest
d = SHA-256("qday/vault-spend/v1" ‖ program ‖ vault ‖ recipient ‖ mint ‖ u64le(amount) ‖ keyHash_{i+1})
// mint = 32 zero bytes for SOL; payload = pubSeed_i ‖ wotsSign(d, skSeed_i, pubSeed_i, 0) = 2,176 B
InstructionWhat it does
init_buffer / write_buffer(offset, bytes)Stage the 2,176 B payload in a buffer account over about 3 transactions
withdraw_sol / withdraw_token(amount, recipient, next)Walk the 67 chains with the sol_sha256 syscall, recompute keyHash, check it derives this PDA, pay the recipient, move the remainder to next, tombstone the vault, close the buffer
forward(tombstone)Permissionless: push any later deposit to the tombstone's recorded next vault
buffer accountpubSeed ‖ σ₀…σ₆₆2,176 B · ~3 txsvault[i] PDA["vault", 0x01, keyHash_i]walk 67 chains · check PDAwithdrawrecipientamountvault[i+1] PDAfresh WOTS key, never usedremaindervault[i] = tombstonenext = vault[i+1]forward(): anyone pushes late depositsdigest binds program, vault,recipient, mint, amount andH(vault[i+1]) · no ed25519 path
Fig. 4A withdrawal spends the vault's only key, so the remainder moves to the next vault and the old address becomes a forwarding tombstone.
  • Roll-over: because the digest commits to keyHash_{i+1}, the signature also fixes where the change goes. Nobody can redirect it.
  • Tombstones: a spent vault records next and can never be spent again, so its key is used exactly once.
  • Live index: the first vault index that is not a tombstone. Spends are also recorded in the browser under an HMAC key only the owner can compute.
  • Compute: between 45 and 990 SHA-256 syscalls, about 140 CU each plus overhead, under 400k CU. The client requests 600k.
§13

Quantum pools

Deposit SOL, USDC, $q/day or any SPL token. A pool position is a chain of vaults derived from the pool seeds (qday/pool/v1/sk, qday/pool/v1/pub), so it has the same post-quantum spend rule as any vault.

  • Yield: 20% of platform revenue, paid in SOL every 24 h to each live vault.
  • Pro-rata by USD value with w = min(value now, value at previous payout), so a deposit starts earning at the next payout.
  • Paid from a public rewards wallet.
§14

Quantum holder rewards

Half of every coin's creator fees belongs to the holders who keep that coin in a Quantum Vault.

formula
owed(coin) = 50% × Σ creatorFees(coin) − paid(coin)
w_v        = min(balance_v now, balance_v at previous payout)
payout_v   = owed(coin) × w_v / Σ_v w_v
  • Fee source: pump trade events. Bonding-curve trades report creatorFee; PumpSwap trades report coinCreatorFee.
  • Paid in SOL to vault PDAs with a memo naming the coin, every 24 h.
  • The min rule means buying just before a payout earns nothing until the next one.
§15

Encrypted launches

A creator can seal a launch so its details are hidden until a short countdown ends.

  1. The creator encrypts the launch details with AES-256-GCM under a random key k.
  2. While sealed, only the ciphertext and the commitment SHA-256(iv ‖ c) are published.
  3. A countdown of about 60 s runs on the home page.
  4. The creator signs and publishes k. The server decrypts, checks every field against the signed launch and refuses on any mismatch.
§16

War mode

War mode signs one launch with four independent post-quantum families, so it survives a break of any three.

  • Plates: WOTS + SLH-DSA-SHA2-128s + ML-DSA-65 + Falcon-512. All four are verified before the leaf is burned.
  • Each plate's SHA-256 is pinned in the metadata.
  • Arming costs 3 leaves, one to bind each non-WOTS key; the launch itself uses one more.
  • The dev buy goes to the Quantum Vault.
§17

Revenue

Revenue is the creator fees of every Q-Day coin. Of each coin's fees, 50% is reserved for its quantum holders. The remaining 50% is split:

Share of remainderOf total feesUseStatus
60%30%Buy $q/day on the market and burn it, hourlyHourly
20%10%Quantum pools yieldEvery 24h
20%10%Backs top-performing coinsOngoing

/revenue shows $q/day bought and burned, SOL spent, buyback count, share of supply burned, a cumulative chart and recent buybacks, all read from chain. $q/day itself is a fair launch: 1B supply, 0% team.

§18

Security analysis

A compromised Q-Day server can

  • Refuse service: decline registrations, launches or proofs.
  • Hide or delay coins in the Q-Day interface.
  • Build a bad transaction. Your wallet shows it before you sign; the signed attestation covers only the digest fields.
  • Withhold or misreport keeper payouts, which are visible on chain.

It cannot

  • Forge a launch attestation or proof: it never sees skSeed.
  • Create a coin at your derived mint address: the mint key comes from skSeed too.
  • Spend a Quantum Vault: only the program's WOTS check releases funds.
  • Make a forged signature verify for anyone running @qday/pq themselves.

Passphrase hardening

Without a passphrase, the identity is a function of one ed25519 signature. An attacker who can forge your wallet's ed25519 signatures, as a quantum attacker could, can re-derive your identity and vault keys. Set a passphrase: h_pass = scrypt(N = 32,768, r = 8, p = 1) is mixed into the IKM, so breaking ed25519 alone is no longer enough. The passphrase is NFKC-normalised, salted per wallet and never sent anywhere. A lost passphrase cannot be recovered.

Other limits

  • Leaf budget: 256 one-time keys per identity. Registration, every launch, proof and scheme binding each use one.
  • Leaf reuse: enforced by the server ledger for identities and by tombstones for vaults.
  • Browser: secrets live only in tab memory. Malware in the browser defeats any scheme.
§19

Parameters

ParameterValue
HashSHA-256, n = 32 B
Winternitz w / log w16 / 4
len1 / len2 / len64 / 3 / 67
Chain length15
Tree height / leaves8 / 256
WOTS signature2,144 B
Auth path256 B
XMSS signature2,404 B
Public key64 B (root ‖ pkSeed)
Vault payload2,176 B (pubSeed ‖ σ)
Scheme stringWOTS(w=16,SHA-256)+Merkle(h=8)
Protocol version1
scryptN = 32,768, r = 8, p = 1, dkLen = 32
Tree build274,943 SHA-256 calls
Vault compute request600,000 CU
Proof challenge TTL5 minutes
Vault program idlisted on the status page
§20

Verify it yourself

Every attestation is public. This script checks a coin's launch signature against the creator's registered root using only @qday/pq:

verify.ts
import { fromHex, launchDigest, pqAddress, toHex, xmssVerify } from "@qday/pq";

const SITE = "<q-day site>";
const mint = "<coin mint>";

const coin = await (await fetch(`${SITE}/api/coins/${mint}`)).json();
const a = coin.attestation;                       // same object as metadata.qday
const id = await (await fetch(`${SITE}/api/identity/${coin.creator}`)).json();

// 1. Rebuild the digest from the coin's own fields.
const d = launchDigest({
  creator: coin.creator, image: coin.image, leaf: a.signature.leaf,
  mint: coin.mint, name: coin.name, scheme: a.scheme, symbol: coin.symbol,
});
console.assert(toHex(d) === a.messageHash, "digest mismatch");

// 2. The attestation must use the creator's registered root.
const root = fromHex(a.root), pubSeed = fromHex(a.pubSeed);
console.assert(a.root === id.root && pqAddress(root, pubSeed) === id.pqAddress, "identity mismatch");

// 3. Verify the WOTS + Merkle signature.
const ok = xmssVerify(
  { leaf: a.signature.leaf, wots: fromHex(a.signature.wots), auth: a.signature.auth.map(fromHex) },
  d, root, pubSeed,
);
console.log(ok ? "valid post-quantum launch signature" : "INVALID");

For full independence, read the metadata from IPFS instead of our API, and check the registration memo qday:v1:anchor:<pqAddress>:<root> in the creator wallet's transaction history on Solana.