Dev.to Security 🔐 Cybersecurity 👁 0 📖 12 min read

Quantum Wen Save: testing a Solana program like a skeptic, from 7/7 to 43 checks in four days

> "I did not ask anyone to believe me. I asked the chain, the virtual machine and a fuzzer, and I published what they said, including where I was wrong." — Wen, the wandering cat in space TL;DR. In four days, December 2

Quantum Wen Save: testing a Solana program like a skeptic, from 7/7 to 43 checks in four days

 > "I did not ask anyone to believe me. I asked the chain, the virtual machine and a fuzzer, and I published what they said, including where I was wrong." — Wen, the wandering cat in space

TL;DR. In four days, December 2–5, 2026, we went from a dated warning to an open, tested model called Quantum Wen Save (QWS). Its small Rust program now passes 43 Rust checks, 30 of 30 in LiteSVM (every refusal by its exact error code), runs on the live WEN mint copied from mainnet, survived hundreds of thousands of fuzzed inputs (one real flaw found and fixed), costs 91.8% fewer compute units after one change, and is guarded by a test that checks every number on its public page. It is an open draft: not audited, not deployed. Everything below can be repeated with one script.

Why this exists

Three things happened within days in early December 2026:

  • December 2–3. The NSA asked owners of national security systems to speed up the move to post-quantum cryptography and to inventory quantum-vulnerable algorithms; its examples include curves other than P-384 and P-521, and EdDSA, the family Solana uses for every transaction. The joint statement said the advances "do not present an immediate and widespread threat".
  • December 3. Solana set March 31, 2027 as the target for post-quantum asset security on mainnet: holders will be able to pre-register a recovery key under Falcon-512, ML-DSA-44 or SLH-DSA-128s. Post-quantum consensus is targeted for the end of 2027. No action is needed today.
  • Everywhere. Confident summaries, some true, many not ("Ed25519 is already broken", "only one chain has a plan").

We wrote it up the same day, every claim checked against its source: Solana Sets a Post-Quantum Date: Three Posts Checked, and What It Means for WEN. And a dated note on the P-256 rumour: QWS Tab 4.9. Short version: no public attack exists on any 256-bit curve; the timetable changed, not the mathematics.

Wen in an astronaut suit with children by the Golden Gate Bridge; card: P-256, Ed25519 and the NSA advisory

The idea: protect what has no key behind it

WEN is a classic SPL Token on Solana with no mint authority and no freeze authority. Nobody can create more WEN, freeze a holder or "migrate" the token. Because no key stands behind those facts, there is nothing for any computer, classical or quantum, to break.

So QWS separates two things:

What it is Exposed to a future attacker?
WEN's fixed facts no mint, no freeze, the mint address, the SPL Token program No: there is no key to attack
Each holder's key a Solana address is its public key Yes, for as long as it holds funds

The second row is measured in time: an address is visible from its first deposit; a one-time key behind a hash is visible only until its transaction is final (Tab 4.8, the human moment). Solana's recovery keys shorten that window. That is why the honest advice is short: when your own wallet offers a recovery key, set it up there yourself, and never approve a "migration" for anyone.

Wen with children above the Ilulissat Icefjord; card: safe points and fixed points, 0 mint authority, 0 freeze authority

March 2027, seen from today

We put every date on one line, each with its source, and marked what is done, what is today and what is only a target: March 2027, Seen From Today: A Dated Timeline for WEN Holders.

Date What Status
Aug 13, 2024 NIST publishes FIPS 203, 204, 205 done
Oct 11, 2026 A prototype Solana cluster runs with post-quantum signatures at 18.5k TPS done
Dec 2–3, 2026 NSA advisory; Solana sets its dates done
Dec 4–5, 2026 QWS public; LiteSVM 7/7 → 18/18 → 28/28 → 30/30; Rust 33 → 43 done
Mar 31, 2027 Holders can pre-register a recovery key target
End of 2027 Post-quantum consensus target

Wen with children in a crystal valley; card: March 2027, seen from today

The program

A small Rust program (qws-core, no_std, plus qws-program on solana-program 2.3) with two patterns and one check:

  • QWS-001, a proof used once. The program computes a nullifier = SHA-256 over a domain tag, the proof, the signer, the mint and an epoch (every field length-prefixed), and stores it in a sorted registry. A replay is refused. A full registry refuses; it never evicts.
  • QWS-002, t of n with a window and a veto. A shared rule changes only with t real signatures, after a public window of slots; any listed signer can veto inside the window. Finalize is accepted at slot >= at; a veto only at slot < at.
  • CheckWen. Reads the 82-byte mint at the WEN address and fails on any breach: another address, another token program, any mint or freeze authority.

Error codes are part of the interface, so the tests can demand them:

Code Name Meaning
0x1 REPLAY this proof was already used
0x2 FULL the registry is full; nothing is evicted
0x3 BAD_REGISTRY wrong owner, layout, or set up twice
0xa NOT_SIGNER the key is not on the list
0xc NOT_ENOUGH fewer than t real signatures
0xd NOTHING_PENDING nothing to finalize or veto
0xe WINDOW_OPEN too early to finalize
0xf WINDOW_CLOSED too late to veto
0x14 NOT_WEN not the WEN mint, or a power exists

The path, run by run

Each step was run on a real computer and published unedited. Each step opened only after the last one was checked.

When Run Result Report
Dec 4, evening Rust on the host; program built for the Solana VM; LiteSVM v1 33/33, 7/7 Tab 4.4
Dec 4, night LiteSVM v2: every refusal by its exact code 18/18 18 of 18
Dec 5 LiteSVM v3: the edges and the live WEN mint 28/28 v3
Dec 5 v3.1: dated offline snapshot, byte-by-byte comparison 30/30, Rust 36 Tab 3
Dec 5, night Compute units per instruction, then the SHA-256 system call −91.8% Tab 4.5
Dec 5, night Fuzzing and real post-quantum libraries flaw found, fixed; Rust 43 Tab 4.4
Dec 5, night Rebuild after the fix 43/43, 30/30, new fingerprint Tab 4.5
Dec 5, night Self-audit, and a test for the page itself 11/11 Self-audit

Wen with children on a balcony above floating ice islands; card: road map, each stage opens only after the last is checked

1. A pass must prove exactly what its line says

The first LiteSVM run passed 7 of 7. Then we read our own test: a refusal counted as a pass if the transaction failed for any reason. A typo in an account list would have "passed". Version 2 demands the program's own code:

PASS  03 QWS-001 replay of the same proof refused with REPLAY  [custom 0x1]
PASS  06 QWS-001 a use without the sender's signature refused: MissingRequiredSignature
PASS  08 QWS-002 a listed key that did not sign does not count: refused with NOT_ENOUGH  [custom 0xc]
PASS  11 QWS-002 a fake clock account refused: InvalidArgument

Every check and what it proves, in plain words, with a FAQ: QWS in LiteSVM: 18 of 18.

Wen with children in a glowing mushroom forest; card: QWS in LiteSVM, 18 of 18

2. Test the edges, where trust leaks

Version 3 went to the boundaries an honest test often skips:

# Tried Result What it proves
15 Registry set up again BAD_REGISTRY (0x3) a ledger of used proofs cannot be wiped and restarted
17 Third proof into a registry of 2 FULL (0x2) full means no, never "forget the oldest"
18 First proof again, registry full REPLAY (0x1) being full does not make it forget
20 Veto by a key outside the list, really signed NOT_SIGNER (0xa) a stranger cannot freeze agreed rules
21 Finalize one slot early WINDOW_OPEN (0xe) no change arrives early, not by one slot
22 Veto at the exact end WINDOW_CLOSED (0xf) no change is blocked late
23 Finalize at the exact end accepted effective at the stated slot
25 Same bytes at another address NOT_WEN (0x14) the address is the identity
27 Right address, another token program NOT_WEN (0x14) the owner program is part of the identity

3. Read the real account, not our own fixture

Check 28 reads the live WEN mint from mainnet with one read-only getAccountInfo at finalized, injects the 82 bytes into LiteSVM and runs CheckWen on them. The slot comes from the same response, so bytes and slot belong together.

PASS  28 CheckWen passes on the live WEN mint copied from mainnet  [mainnet slot 477554740, owner Tokenkeg…, 82 bytes, supply 72755214305841326, decimals 5, mint authority none, freeze authority none]
      program log: WEN custody: no mint authority, no freeze authority, SPL Token, supply 72755214305841326
PASS  29 CheckWen passes on the dated offline snapshot of the WEN mint  [snapshot slot 477533685, supply 72755214305841326, old mint-authority key bytes still present: yes]
PASS  30 Since the snapshot: every byte except supply unchanged, and supply never went up
30/30 passed

Two things we learned only by looking at real bytes:

  1. Removing an authority clears only the 4-byte tag. The old key bytes stay in the account. A reader must trust the tag, never "are the bytes zero". The official spl-token reader and ours both do; a Rust check on the real snapshot proves it.
  2. Supply only goes down. At slot 477,517,132 supply was 72,755,214,485,107,483 base units; at slot 477,533,685 it was 72,755,214,305,841,326: 179,266,157 base units burned, nothing minted. Every later read since matches the snapshot byte for byte.

The snapshot is refreshed by a tool, never by hand (section 7).

Wen with children before a starry sea of coral and whales; card: QWS v3, the edges and the live WEN mint

4. Measure, don't assume

qws.cu.ts runs every instruction in LiteSVM, fills a registry from 0 to 63, records compute units, and prints a run fingerprint: SHA-256 over all rows and the program size. Keys come from fixed seeds, so the same build prints the same fingerprint on any machine.

The first measurement showed that almost the whole cost of UseProof was SHA-256 in software. One change, solana_program::hash::hashv (Solana's SHA-256 system call), with a Rust check that both give byte-identical nullifiers:

Instruction 1. software SHA-256 2. system call 3. current (+ flag check)
UseProof, median of 64 22,195 1,813 1,813
UseProof, refused replay 21,431 1,050 1,050
Propose, 5 signatures 2,861 2,861 2,867
Veto 1,399 1,399 1,412
Finalize 1,136 1,136 1,149
CheckWen 1,062 1,062 1,062
Program size 92,856 bytes 37,552 bytes 37,648 bytes
  • −91.8% compute for the main instruction; the program shrank by 59.6%.
  • The heaviest instruction is 2,867 CU: about 1.4% of the default 200,000 per instruction.
  • The base fee is 5,000 lamports per signature regardless of CU; fewer CU only lower the optional priority fee (CU limit × price ÷ 1,000,000) (Tab 4.5).
  • Build 2's fingerprint 179d0f2d… came out identical in three separate runs. Build 3: e372782170789de299357c1bb57ba921912362a8710cd9d2aed11767d42f295d.

5. Fuzz everything that reads bytes

Six seeded fuzz tests (xorshift64*, fixed seeds, no extra tools, same inputs on any machine), 0.40 seconds in total:

Target Inputs Result
82-byte mint reader vs the official spl-token reader 200,000 random mints agreed on every one (3,249 read, 196,751 refused)
Wrong lengths 0 to 299 bytes all refused, never read
The live WEN mint, corrupted 100,000 copies, 1–5 bytes changed CheckWen passes exactly when the facts survive
Registry layout 100,000 random buffers never panics
Registry vs a simple model 50 × 1,000 operations always equal, always sorted
Threshold state 100,000 random states flaw found

The flaw: a corrupted threshold flag byte of 2–255 was read as "none" instead of being refused. Fixed in State::read, rebuilt, measured again (table above: only the three instructions that read that state got 6–13 CU dearer).

Our own mistake, caught the same minute: a hex string of the live mint in the fuzz test was typed by hand: 78 bytes instead of 82. Since then the rule is simple: never type bytes. They are generated from the snapshot, with a length check.

6. Post-quantum sizes from a real library

Solana named three schemes for recovery keys. We generated keys, signed, verified, refused a wrong message and measured, with @noble/post-quantum 0.7.1:

Scheme Public key Signature Fits one legacy tx (1,232 B)? Fits one v1 tx (4,096 B)?
Falcon-512 897 650–661 compressed, 666 padded signature only yes, with its key
ML-DSA-44 1,312 2,420 no yes, with its key
SLH-DSA-128s 32 7,856 no no

Why 666? A padded Falcon-512 signature is 1 header byte + 40 bytes of nonce + 625 bytes for the compressed vector. The compressed length varies from signature to signature (the coefficients are Gaussian); a fixed size removes a length side channel and simplifies protocols, and a signature that would not fit is simply made again. The number itself is a coincidence. For budgets, count 666, not the average.

7. Audit ourselves, and the page

Before asking anyone to trust a number, we turned the same rule on ourselves: QWS Self-Audit: Eight of Our Own Mistakes, and the Checks That Now Catch Them.

What we got wrong What guards it now
v1 counted any failure as a refusal exact error codes in every refusal
a commit pushed to an already merged branch check the merge before every push
the first snapshot had no lamports the refresh tool stores them
hex typed by hand, 4 bytes short never type bytes; length check
threshold flag 2–255 read as "none" refused in State::read; fuzzed on every build
an audit claimed for a library we did not audit the page test refuses the word unless "not" precedes it
five numbers on the page stale after a rebuild the page test (below)
a rerun used the old build before the merge the test count and the fingerprint name the build

Six of the eight are not about the program at all: copying, typing, wording, timing. So the last guard is for the paperwork. qws-claims.test.mjs (Node's built-in runner, no network) reads the public page and:

  • recomputes both fingerprints from the stored rows and requires them on the page, with the program size;
  • requires every number in the compute-unit table to equal the current report;
  • decodes the pinned snapshot (82 bytes, SPL Token, tags 0, initialized, 5 decimals, old key bytes present) and requires its supply and slot on the page;
  • requires the Rust count on the page to equal the #[test] functions in the code;
  • refuses an audit claim, a deploy claim, and outside links inside the page.

We tested the test: change one number by hand, or delete one "not", and it fails. On its first run it failed on our own new paragraph, which quoted the forbidden words; we rewrote the paragraph, not the test.

refresh-wen-snapshot.ts replaces copying a line from a log: one read-only call, slot from the same response, every reading saved under its slot and never overwritten, and --pin only if nothing but a burn changed. Tried against a stand-in server: a mint authority set → stopped; supply up by one → stopped; another byte changed → stopped; a burn of 1,000 → pinned.

What is not checked yet

  • No third-party audit. Not deployed.
  • No devnet run yet: next, from a new empty wallet, with public logs.
  • One machine so far. If you run it, compare your fingerprint: that is the independent check we are asking for.
  • LiteSVM runs the real program in the Solana VM, but it is not a full validator.
  • The fuzzing is seeded and random, not coverage-guided.

Repeat it

git clone https://github.com/wen-watt/wen-watt.github.io.git
cd wen-watt.github.io
bash lab/code/qws-rs/scripts/run_litesvm_checks.sh

Needs Rust, the Solana CLI (Agave, for cargo build-sbf) and Node 20+. Six steps, with logs:

== 1/6 rules and program on the host        → 43 passed
== 2/6 lint                                  → clippy clean
== 3/6 build the program for the Solana VM   → qws_program.so, 37,648 bytes
== 4/6 LiteSVM                               → 30/30 passed
== 5/6 compute units and run fingerprint     → e372782170789de2…
== 6/6 self-audit of the page                → # pass 11

Without Rust: cd lab/code && npm install && npm run test:claims && npm run test:qws (11 page checks and 25 model checks, no network). To read the live mint yourself: npm run snapshot:refresh. Set SOLANA_RPC to use your own node.

All the links

Spoken by Wen, for the community. The one real WEN is the Solana mint WENWENvqqNya429ubCdR81ZmD69brwQaaBYY6p3LCpk: check addresses, not names. No prices, no forecasts; educational content, not financial, tax or legal advice. Texts CC BY 4.0, code Apache-2.0. Art of Wen, made with AI tools.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.