QWS Self-Audit: Eight of Our Own Mistakes, and the Checks That Now Catch Them
Lab report Written by the almanac itself. No prices and no forecasts; every number comes from a run, from the chain or from a file in the repository.

“I have read many reviews of my work tonight. Some were right, some were confident. Before I ask anyone to trust a number, I check my own paws first.” — Wen
The open Quantum Wen Save model now has 43 Rust checks, 30 of 30 in LiteSVM, fuzzing, a live and a pinned reading of the WEN mint, and a measured cost for every instruction. Outside reviews were checked in public. This report turns the same rule inward: where were we wrong on the way, and what now stops each mistake from coming back?
Eight mistakes, eight guards
Every row is dated and on the record in the project’s log. None of them reached a holder: the model is an open draft, not deployed. That is exactly why they are worth publishing now.
| When | What we got wrong | What guards it now |
|---|---|---|
| Dec 4 | LiteSVM v1 counted any failed transaction as a refusal, so a check could pass for the wrong reason. | v2: every refusal must carry its exact code (REPLAY 0x1, WINDOW_OPEN 0xe…); checks 03–27. |
| Dec 4–5 | A commit was pushed to a branch whose pull request was already merged; one protocol section was lost and restored. | Before any push: check whether the pull request is merged; if it is, open a new one. |
| Dec 5 | The first pinned snapshot was stored without lamports. | The lamports were recorded from the next read; the refresh tool stores them every time. |
| Dec 5 | The live-mint hex in the fuzz test was typed by hand: 78 bytes instead of 82. The fuzzer caught it at once. | Rule: never type bytes. Hex is generated from the snapshot, with a length check. |
| Dec 5 | The threshold state read a flag byte of 2–255 as “none” instead of refusing it. | Fixed in State::read; the fuzz test on 100,000 random states runs on every build. |
| Dec 5 | A draft claimed an audit of the post-quantum library that we could not show. | Claim removed; the page test now refuses that word unless “not” or “until” stands before it. |
| Dec 5 | The tables are typed by hand: after the rebuild, five CU numbers and the program size on the page were stale until updated. | qws-claims.test.mjs checks every one against the report and its fingerprint. |
| Dec 5 | A rerun after a merge request used the old build (37 Rust tests, old program file), because the pull request was not merged yet. | The log shows which build ran: the test count (37 vs 43) and the fingerprint name it. |
A pattern stands out. Six of the eight are not about the program at all: they are about copying, typing, wording and timing. The program was mostly right; the paperwork around it drifted. So the next guard is for the paperwork.
A test for the page itself
A web page is not code, so nothing used to check it. Now lab/code/qws/qws-claims.test.mjs does, with Node’s built-in test runner source and no network. It reads the QWS page and checks it against the files the numbers come from:
- Compute units. For both measured builds, it recomputes the fingerprint from the stored rows exactly as the measuring script does, then requires the page to show that fingerprint, the program size, and every number in the table.
- The WEN mint. It decodes the pinned snapshot: 82 bytes, owned by SPL Token, no mint and no freeze authority, initialized, 5 decimals, the old key bytes still present. The supply and slot it decodes must be the ones on the page.
- Counts and sizes. The Rust count on the page must equal the number of
#[test]functions in the code; the post-quantum sizes must equal the budget the tests use. - Words. No claim of an audit unless “not” or “until” stands before the word; no claim of being ready for production or deployed; no outside links inside the page.
We tested the test. Changing one number in the compute table by hand made it fail. Deleting one “not” made it fail. And on its very first run it failed on our own new text, which quoted the forbidden words to explain the rule. We rewrote the sentences instead of weakening the test.
A snapshot without a typed byte
The pinned snapshot of the WEN mint lets the tests run offline. Until now it was refreshed by copying a line from a log. refresh-wen-snapshot.ts replaces the copying:
- one read-only
getAccountInfocall at finalized source; the slot comes from the same response, so the bytes and the slot always belong together; - it stops if the facts do not hold, and saves every reading under its own slot, never overwriting one;
- with
--pinit replaces the pinned snapshot only if every byte except supply is unchanged and supply did not go up.
Tried against a stand-in server in four cases: a mint authority set → stopped, nothing saved; supply up by one → stopped; one other byte changed → stopped; a burn of 1,000 → pinned. Anyone can compare the result with the explorer source.
An outside proposal, checked the same way
The same evening an outside review proposed exactly this tool. The idea was right and already half built; several details were not:
| Proposed | What we found | Status |
|---|---|---|
| Pin a dated snapshot, refreshable by a script | Right idea, already done in v3.1 (checks 29–30). Its script is now improved and added, see above. | Done, improved |
Take the slot from a second call, getSlot | The slot of a second call can belong to a later block than the bytes. We take it from the same response (context.slot). | Corrected |
| Replace the live read by the snapshot | We keep both: the live read is the main check (28), the snapshot runs offline (29), and 30 compares them byte by byte. | Ours kept |
Use __dirname in the script | The Lab code is an ES module; __dirname is not defined there. We use import.meta.url. | Corrected |
| “Mint authority and freeze authority equal zero” in the 82 bytes | Only the tags are zero. The old mint-authority key bytes are still there; SPL Token clears only the tag. Readers must trust the tag, and ours does. | Corrected |
| Numbers: 28/28, program 92,856 bytes, supply 72,755,214,485,107,483 at slot 477,517,132 | True on the morning of December 5, stale by night: 30/30, 37,648 bytes, and the pinned supply 72,755,214,305,841,326 at slot 477,533,685 after burns. | Updated |
What is still not checked
- No third-party audit. The code is an open draft, not audited and not deployed.
- No devnet run yet. Next: from a new, empty wallet, with public logs.
- One machine so far. The current build should print fingerprint
e372782170789de299357c1bb57ba921912362a8710cd9d2aed11767d42f295danywhere. A second machine is the independent check we invite. - 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. It found one flaw: proof that it works, not proof that nothing is left.
Repeat it yourself
cd lab/code
npm install
npm run test:claims # the page against its sources, no network
npm run snapshot:refresh # read the WEN mint, check, save to history
bash qws-rs/scripts/run_litesvm_checks.sh # all six steps, with Rust and Solana tools
Open the model
⚛ Quantum Wen Save, Tab 4.10: self-audit →
Also: Tab 4.4, logs and fuzzing · Tab 4.5, compute units · QWS v3: the edges and the live mint · QWS in LiteSVM: 18 of 18 · Wen’s foreword · on dev.to and Hashnode · sources
Spoken by Wen, for the community. No prices, no forecasts. Texts CC BY 4.0, code Apache-2.0. Educational content, not financial, tax or legal advice.