Documentation · v1.0

SafeQuant docs

Everything the site does, written down: the index, the reasoning behind each score, the analyst's contract, and the constraints the project refuses to break.

Overview

SafeQuant has three parts.

PartWhat it doesNeeds the network?
ScannerMaps 5 chains and 13 primitives to a fixed 0–100 score with a band, a gauge and one line of explanation.No
AnalystAnswers questions about wallet cryptography in English, scoped by a server-side harness.Yes
Docs, paper, tokenomicsStatic pages. The paper is print-ready.No

The scanner is the product. If the analyst is unreachable, the score above it still resolves instantly, because every value is a constant in a JavaScript file rather than a model output.

Methodology

Scores encode one question: what would a fault-tolerant quantum computer running Shor's and Grover's algorithms do to this primitive?

  1. Shor decides the red band. If the primitive depends on integer factorization or the discrete logarithm problem — RSA, ECDSA, EdDSA, Schnorr, finite-field DH — it is capped below 40. Nothing about key length or popularity moves it out.
  2. Grover decides how much margin is left. Symmetric primitives with a quadratic quantum speed-up are scored by the margin that survives: AES-128 lands at 55 (WEAKENED), while AES-256 at 82, SHA-256 at 71 and SHA-512 at 78 keep enough margin to stay RESILIENT.
  3. Design intent decides the newest band. Standards selected by NIST against quantum adversaries score 94–96: ML-KEM, ML-DSA, SLH-DSA.
The exact table. RSA-1024 4 · RSA-2048 11 · ECDSA secp256k1 23 · ECDSA P-256 24 · Schnorr BIP-340 26 · Ed25519 28 · AES-128 55 · SHA-256 71 · SHA-512 78 · AES-256 82 · ML-KEM 94 · ML-DSA 95 · SLH-DSA 96.

Chains inherit the score of what signs their transactions: Bitcoin, Ethereum and XRP use ECDSA secp256k1 (23); Solana and Cardano use Ed25519 (28).

The index file

assets/js/data.js is the single source of truth. The scanner, the tables, the share text and the analyst's grounding all read from it, so a score cannot disagree with itself.

window.SQ = {
  SCHEMES: [{ id, name, score, family, primitive, note }, ...],
  CHAINS:  [{ id, name, ticker, scheme, note }, ...],
  BANDS:   [{ key, label, min, max, color }, ...],
  META:    { ticker, feePct, supply, disclaimer, shareTemplate },
  resolve(kind, id) -> result object,
  shareText(score) -> "My SafeQuant score is 23/100. ..."
};

Adding a primitive means adding one object with a fixed score. It does not mean adding a calculation: the index is published, not computed from live data.

Analyst API

The analyst is a single POST endpoint. The model key lives in the deployment's environment and is never sent to the browser.

POST /api/analyst
Content-Type: application/json

{
  "question": "How safe is my Bitcoin wallet against a quantum computer?",
  "context":  { "kind": "chain", "id": "bitcoin", "score": 23,
                "band": "EXPOSED", "scheme": "ECDSA secp256k1" }
}

Success returns a scoped answer and the guard verdict:

{
  "answer": "Bitcoin signs with ECDSA secp256k1, which scores 23/100…",
  "guard":  "pass",
  "model":  "mistralai/mistral-small-24b-instruct-2501",
  "notes":  ["Educational index based on known exposure…"]
}

Errors are deliberately boring:

StatusMeaning
400Over-long question (limit 400 characters). A missing question returns 200 with the scope refusal.
405Wrong method. Only POST and OPTIONS are served.
429Rate limit: 24 questions per IP per hour.
500Unexpected failure. The scanner is unaffected.

A 200 with "guard": "off_scope" is a correct answer, not an error: the question was outside wallet cryptography and the model was never called.

The desk (token gated)

The landing page ships a free sample of the analyst. The desk is the paid surface: dashboard.html, unlocked once per wallet by holding 10,000 $SQUANT.

  1. Connect. eth_requestAccounts on Robinhood Chain. Read-only: the desk never asks for a signature and never moves funds.
  2. Verify. The page calls balanceOf(address) on the $SQUANT contract and compares the result to UNLOCK_AMOUNT in assets/js/config.js. Nothing is transferred or locked; the check is a read.
  3. Unlock. The result is remembered per address in localStorage. Clearing site data or switching wallets asks again.

With the wallet connected, the desk reads that address across a short list of EVM chains (eth_getBalance over public RPCs) and scores every chain that holds a balance with the same index the scanner uses. The portfolio headline is the weakest funded chain, because exposure is set by the chain that scores lowest — not by the average.

Until the contract exists, TOKEN_ADDRESS in config.js is empty and the gate opens in preview mode, labelled as such. Adding an ?addr=0x… parameter to the preview shows a real portfolio for that address so the flow can be reviewed before launch.

Harness rules

The model is treated as untrusted output. Three layers enforce the boundary.

1 · Input gate

Before any tokens are spent, the server requires a domain term (curve, cipher, protocol, key management) and rejects known out-of-scope patterns: prices and trading, politics, requests to attack or drain a wallet, and prompt-injection phrases. Everything else is refused before a model is called.

2 · System contract

The prompt fixes the subject to wallet cryptography, signature curves, key exchange, hashing, post-quantum standards and the protocols that choose them. It requires English regardless of the question's language, forbids financial advice and token talk, forbids "quantum-proof" and "unhackable" claims, and forbids revealing or rewriting the rules.

3 · Output gate

Every answer is checked for banned claims, for non-English output, and for length. A rejected answer is replaced by a deterministic, index-grounded sentence and reported as "guard": "fallback". The user always gets a correct statement about the scheme, even if the model misbehaves or the provider is down.

Scanner internals

No framework, no build step. Four files:

  • data.js — the index and the resolver.
  • app.js — selector, tabs, gauge animation, share/copy, tables, deep links.
  • analyst.js — chat UI and the cheap client-side scope pre-check.
  • config.js — the endpoint URL, in one place.

Deep links work: ?c=bitcoin for a chain, ?s=ed25519 for a primitive. Sharing uses the Web Share API where available and falls back to the clipboard.

Accessibility: the gauge is decorative and hidden from screen readers, the number is live text, the band is text rather than color alone, focus states are visible, and all animation is disabled under prefers-reduced-motion.

Deployment

The site is static and can be served from any file host. The analyst needs one Node function with three environment variables: one required, two optional.

OPENROUTER_API_KEY   required   server-side only
ANALYST_MODEL        optional   default: mistralai/mistral-small-24b-instruct-2501
ANALYST_FALLBACK_MODEL optional default: deepseek/deepseek-v4.1-flash-1017

Set SITE_ORIGIN in assets/js/config.js to the public origin so the function's CORS allow-list matches where the page is served from. Never place the key in config.js or any file that ships to the browser.

Limitations

  • Scores describe primitives, not products. No wallet or contract is inspected.
  • Operational security — seed handling, device integrity, phishing — is out of scope.
  • No date for a cryptographically relevant quantum computer is implied.
  • The analyst is educational. It can be wrong and must not be treated as an audit.

Changelog

VersionDateChange
1.0Dec 2026Scanner, index v1.0, harnessed analyst, docs, white paper, tokenomics.
Educational index based on known exposure to Shor's and Grover's algorithms. Not an audit. Not financial advice.