q-trust

Q-Trust logo Q-Trust

Post-Quantum Cryptography Migration & Attestation Protocol

Scan your cryptographic estate · score it against NIST & CNSA 2.0 · plan migration with a GNN · seal tamper-proof attestations on Base L2.

Q-Trust — the post-quantum trust protocol

Your cryptographic estate, in one command

pip install qtrust-inspector
crypto-inspector scan-source . --cyclonedx cbom.json --risk --compliance nist,cnsa

A CycloneDX CBOM of every cryptographic asset in your tree — algorithms, key sizes, quantum exposure, NIST/CNSA compliance — in about a minute. No account, no upload (GitHub Action too).

Surface the same findings natively in GitHub’s code scanning UI:

crypto-inspector scan-source . --sarif qtrust.sarif
# then: github/codeql-action/upload-sarif@v3 with sarif_file: qtrust.sarif


Q-Trust — mission card

🎮 OPERATION: SILENT QUANTUM

   
🎯 OBJECTIVE Migrate a live cryptographic estate before Q-Day — and prove it happened
🧠 INTEL CBOM scanning → NIST & CNSA 2.0 scoring → GNN migration planning → attestation on Base L2
💣 BOSS FIGHT Cryptographic amnesia — you can’t migrate what you can’t see
🏆 LOOT 11 UUPS registries on Base L2 · tamper-proof attestation flows · a plan a CISO can sign
🎮 DIFFICULTY ★★★★★ · the threat has a countdown clock


CI PQC Self-Scan Release Docs License
Security Halmos Docker PyPI PRs Welcome
PyPI qtrust-inspector PyPI qtrust-sdk Live demo Lines of code


⚠️ The Threat · ⚙️ Pipeline · 🎬 Demo · ✨ Capabilities · 📐 Architecture · 📊 Results · 🚀 Quick Start · 🧩 Ecosystem · 🗺 Roadmap · 📚 Docs · 🤝 Contribute


⛓ 11
UUPS registries on Base L2
🔎 10
scanner modules
🧠 1.0000
outcome-optimal migration plans (42-estate LOO, p=1.7e-08)
🧪 211
contract tests
🛡 7
compliance frameworks
EIP-712 gasless · 7-day timelock TLS · SSH · source · binary PyTorch Geometric + RL agent unit · invariant · fuzz · attack NIST · CNSA 2.0 · FIPS · NIS2 · FISMA · FedRAMP · CMMC

📖 Contents

Click to expand / collapse - [⚠️ The Threat](#️-the-threat) - [⚙️ Pipeline](#️-pipeline) - [🎬 Demo](#-demo) - [✨ Capabilities](#-capabilities) - [📐 Architecture](#-architecture) - [📊 Measured Results](#-measured-results) - [🚀 Quick Start](#-quick-start) - [⛓ On-Chain Layer](#-on-chain-layer-base-l2) - [🧠 GPU Analytics](#-gpu-accelerated-analytics-optional) - [🧩 Ecosystem & Packages](#-ecosystem--packages) - [🗺 Roadmap](#-roadmap) - [🧪 Reality Check](#-reality-check) - [📚 Documentation](#-documentation) - [🤝 Contributing](#-contributing) - [🌟 Community](#-community) - [📜 License](#-license)

⚠️ The Threat

NIST IR 8547 HNDL Regulatory


The migration deadline is set by standards bodies, not by attackers.

Every enterprise faces the same wall: cryptography is scattered across TLS endpoints, source code, package manifests, binaries and configs — owned by different teams, with no shared evidence layer between vendors, auditors and customers. Q-Trust closes that loop.

**`discover → score → plan → attest`**

⚙️ Pipeline

flowchart TB
    subgraph SCAN["① SCAN — inspector"]
        direction LR
        tls["TLS / SSH probes"]
        src["Source · Manifests<br/>Binaries · Configs"]
    end

    subgraph SCORE["② SCORE — risk engine"]
        risk["NIST SP 800-131A · CNSA 2.0 · FIPS 140-3<br/>NIS2 · FISMA · FedRAMP · CMMC"]
    end

    subgraph PLAN["③ PLAN — GNN + RL"]
        gnn["PyTorch Geometric GNN<br/>outcome-optimal sequencing · RL agent"]
    end

    subgraph ATTEST["④ ATTEST — Base L2"]
        chain["11 UUPS registries<br/>EIP-712 gasless · 7-day timelock"]
    end

    SCAN -->|"CycloneDX 1.7 CBOM"| SCORE
    SCORE -->|"risk-ranked inventory"| PLAN
    PLAN -->|"migration steps"| ATTEST
    be["⚡ Fastify 5 API + indexer"] -.->|"relays & anchors"| ATTEST
    fe["🖥 Next.js 16 dashboard"] --> be
    sdk["🐍 Python SDK"] -->|"verify / attest"| be

🎬 Demo

Q-Trust live demo — scan, plan, attest

Real CLI, real flow: crypto-inspector scans a live endpoint and emits a CycloneDX 1.7 CBOM, the GNN planner reaches the simulation-optimal migration ordering out-of-sample (E-09), and the evidence root is anchored on Base L2.

▶ Try it live in your browser — paste code, get crypto-usage classification (runs locally via ONNX, no upload) · 📦 datasets · 🤖 model


✨ Capabilities

Enterprise scanner

🔎 Discover

TLS · SSH · source · manifests · binaries · configs

12+ source languages, 10+ manifest formats, OID extraction from binaries, cipher-suite audits — one command, one CBOM.
GNN planner

🧠 Plan

GNN priority ranking + RL sequencing

Out-of-sample on 42 real host-disjoint estates, the learned ordering attains the quantum-risk-days optimum (ratio 1.0000 vs 1.0473 for the priority formula, Wilcoxon p=1.7e-08); RL agent sequences migrations with cost estimates. Synthetic-scale held-out τ_b is 0.975 (labeled as such).
On-chain anchoring

⛓ Attest

Tamper-proof on-chain evidence

Hash-chained evidence ledger anchored to Base L2 via EIP-712 gasless relays — publicly verifiable, revocable, Merkle-rooted.
🔬 Scanner modules — full matrix
| Module | Target | Detects | |---|---|---| | TLS scanner | Network endpoints | Certificate algorithms, key sizes, expiry | | SSH scanner | Network endpoints | Host key algorithms, key types | | Source scanner | 12+ languages | Crypto API usage, hardcoded keys | | Manifest scanner | 10+ formats | Crypto library dependencies | | Binary scanner | Compiled artifacts | Algorithm strings, OIDs | | Config scanner | YAML / TOML / JSON | Cipher suites, crypto settings | | PCAP / netlog | Packet captures | HNDL exposure analysis | | Evidence ledger | All findings | Hash-chained, tamper-evident audit trail | **Output formats** — CycloneDX 1.7 CBOM · SARIF 2.1 (GitHub Advanced Security) · JSON risk/compliance reports · migration roadmap.
🧮 Compliance frameworks — 7 rule sets
| Framework | Scope | Sample rules | |---|---|---| | NIST SP 800-131A | Algorithm deprecation | RSA key sizes, ECDSA curves, hash algorithms | | CNSA 2.0 | NSA-approved algorithms | ML-KEM-1024, ML-DSA-87, AES-256, SHA-384+ | | FIPS 140-3 | Module validation | Approved algorithms, key sizes, modes | | EU NIS2 | EU cybersecurity | Crypto measures, quantum risk, incident reporting | | FISMA | Federal systems | FIPS modules, NIST algorithms, key management | | FedRAMP | Cloud services | CNSA Suite, TLS 1.2+, validated modules | | CMMC | DoD supply chain | CUI protection, key management, audit trails |
📜 Certification bundles — signed, offline-verifiable assurance
Issue a policy-gated, Ed25519-signed snapshot of an organisation's assets, migrations, vendor attestations and latest audit. Verification is fail-closed and runs offline: record digests → sorted-pair Merkle root → signature → validity window. The same bundle verifies byte-for-byte in TypeScript and Python, and CI diffs the committed fixture so the two implementations cannot drift. | Policy | Audit required | Revocation root | Min verified migrations | Max validity | |---|---|---|---|---| | `default` | no | no | 0 | 365 d | | `regulated` | yes | yes | 0 | 180 d | | `strict` | yes | yes | ≥ 90% | 90 d | When the evidence cannot support the requested claim the service **refuses to sign** (409 with per-reason failures) instead of issuing a misleading bundle. ```bash # Issue (operator key), then verify offline (public) curl -sS -X POST "$QTRUST_API/v1/certify" -H "x-api-key: $QTRUST_API_KEY" \ -H 'content-type: application/json' \ -d '{"org":"0x1111…","policy":"regulated"}' > bundle.json cd backend && npm run certify:verify -- ../bundle.json cd .. && python -m qtrust.bundle bundle.json ``` The same verification is available in the browser at **`/certify`** — paste or load a bundle, optionally re-anchor it to Base, and read the per-check report. The page calls the public verify endpoint; it does not re-implement any check. See [docs/CERTIFICATION_AND_ASSURANCE.md](/q-trust/docs/CERTIFICATION_AND_ASSURANCE.html).
📊 Assurance analytics — agility, CRQC exposure, sector packs
`POST /v1/assurance/report` turns a CBOM into three audit-facing views: - **Crypto-agility grade (A–E)** — six weighted factors (posture, abstraction, configurability, PQC path, observability, lifecycle) with per-factor evidence. - **CRQC / HNDL exposure** — Monte-Carlo financial exposure by CRQC arrival year, combining data lifetime, asset value and vulnerability class; assumptions are echoed in the response, never hidden. - **Sector control crosswalks** — `cnsa-2.0`, `pci-dss-4.0`, `dora`, `hipaa`, `fedramp-rev5`. Controls that cannot be decided from machine evidence report `MANUAL`, so a pack cannot overstate readiness.

🏗 Architecture

Q-Trust layered architecture

Six independently deployable subsystems:

Subsystem Stack Role
contracts/ Solidity · Foundry 11 UUPS registries, governance, timelock
inspector/ Python Multi-language PQC scanner + risk engine
planner/ Python · PyTorch Geometric GNN migration planner + RL agent
backend/ TypeScript · Fastify 5 · viem API, indexer, gasless relayer, webhooks
frontend/ Next.js 16 Scanner dashboard, risk gauge, roadmap UI
sdk/ Python QTrustClient, risk, compliance, W3C VCs, DID
📡 Deep dive — attestation lifecycle (sequence)
```mermaid sequenceDiagram autonumber participant V as Vendor participant SDK as Python SDK participant API as Fastify API participant R as Relayer participant C as EvidenceRegistry (Base L2) V->>SDK: sign EIP-712 attestation (nonce-bound) SDK->>API: POST /v1/relay/attestation API->>API: verify signature + nonce anti-replay API->>R: enqueue gasless transaction R->>C: submit meta-tx C-->>API: EvidenceRoot event (indexer) API-->>SDK: tx hash + public verification URL Note over C: admin ops behind 7-day timelock ```
🧩 Full component graph
```mermaid flowchart LR subgraph clients["Clients"] fe["Next.js 16
dashboard"] sdk["Python SDK"] cli["crypto-inspector CLI"] end subgraph services["Services (Docker Compose)"] api["Fastify 5 API
147.8 req/s · p95 11.3 ms"] wh["Webhook fan-out (API)"] plan["Planner microservice
(GNN inference)"] idx["Indexer (viem watchEvent)"] end subgraph data["State"] pg[("Postgres 16
read model")] rd[("Redis
queues + locks")] end subgraph chain["Base L2"] reg["11 UUPS registries
+ governance + timelock"] end fe --> api sdk --> api cli -->|CBOM| api api --> pg api --> rd api --> plan idx --> pg idx -->|watchEvent| reg api -->|EIP-712 relay| reg wh -->|HMAC| vendors["Vendor webhooks"] ```

📊 Measured Results

Capability Result Source
Migration ranking Kendall τ 0.9637 vs heuristic optimum (held-out, 3-seed mean ± 0.0002) planner/results/benchmark.json
GNN v3 @ scale (synthetic) 100K graphs · BF16 · per-graph ListMLE — held-out τ 0.975 planner/results/benchmark_v3.json
GNN v3 + real data (LOO) in-dist τ 0.9710 · out-of-sample 40-fold LOO on host-disjoint real TLS CBOMs (280 hosts, re-run 2026-09-02 on the deterministic-kernel harness, 30-epoch fine-tune, folds sharded across 4 A100s): τ-b 0.7263 vs doctrine heuristic 0.7450 (Δ −0.0188) — reproduces the doctrine on 38/40 held-out real CBOMs (0 wins / 38 ties / 2 losses, both small heavily-tied n≤8 graphs) · +0.503 vs random planner/results/real_cbom_loo_40.json · in-sample suite benchmark_real_v3.json
GNN v3 + real data (42-fold LOO) Same protocol, re-run 2026-09-18 on the 42-CBOM / 277-host disjoint corpus (30-epoch fine-tune, 2 A100 shards): τ-b 0.7168 vs doctrine heuristic 0.7210 (Δ −0.0042, medians identical 0.7237) — 0 wins / 41 ties / 1 loss, model top-10 1.0 on every fold · +0.687 vs random (0.0301) planner/results/real_cbom_loo_42.json
RL migration agent 100% completion on 40 packed real-CBOM estates (risk labels derived from the real scan fields: RSA-1024 → critical, RSA-2048 → high, expired/near-expiry raise the class) · mean reward 140.34 ± 8.13 vs doctrine heuristic 140.62 (Δ −0.28 — statistical tie) vs random 136.84 (+3.50, +2.6%) — learns real risk-priority and matches the doctrine on real estates (bit-reproducible: 2/40 wins · 27 ties · 11 losses) planner/results/rl_benchmark_real_cbom.json
Code discovery model CodeBERTa v4 fine-tuned on 17,171 real code files / 58 sources incl. SolidiFI/SmartBugs/EIPs/WebAuthn blockchain contracts (seed-pinned, deterministic) — clean repo-disjoint held-out (0 % train overlap): F1 0.9205 on the de-duplicated digest eval (1,779 files; P 0.9264 / R 0.9146) and 0.9235 native (2,566 files), beating the TF-IDF+LogReg baseline (0.6675) by +0.25 F1. The legacy v1 0.9395 row is retained as a record, but audit_eval_leakage.py shows 87.6 % of that eval set was paths v1 trained on (E-14/E-15/E-16) training_report_v4.json · eval_dedup_v4.json · ensemble_scores_v4_pinned.json
Real-data corpus 13,973 real code files (incl. SolidiFI/SmartBugs/EIPs/WebAuthn) · 277 live TLS hosts · 401 NVD CVEs · 54 real liboqs timing trace sets scripts/build_real_datasets.py + scripts/expand_real_corpus.py
API throughput 147.8 req/s @ 100 VUs · p95 11.3 ms (anvil, 24-core / A100) docs/PERFORMANCE.md
Contract tests 211 — unit + invariant (1000 runs) + fuzz + attack CHANGELOG.md
Scanner coverage 12+ source languages · 10+ manifest formats inspector/
Side-channel detector 54/54 clean traces → VERIFIED/LOW_RISK (0 false alarms) · 51/54 leak-injected → HIGH_RISK (3 misses, all low-sample keygen ops) — trained on 54 real liboqs trace sets (PQC + RSA/ECC baselines), loss 0.178→0.080, calibration anchors 0.000/1.000 inspector/side_channel_model_real.pt · scripts/train_real_side_channel.py
Crypto discovery head-to-head CryptoAPI-Bench: usage recall 164/187 = 0.877, file-level misuse precision 0.932 · ApacheCryptoAPI-Bench (71/121 mapped): R 0.971 / P 0.532 / F1 0.688 — usage discovery, not misuse detection; no superiority claim over misuse SOTA benchmarks/external/HEAD-TO-HEAD.md
ACVP known-answer vectors ECDSA-SigVer 196/196 · RSA-SigVer 126 (+144 oracle-skipped XOF) · EdDSA 10 (+10 preHash skipped) · SHA2-256 516 (+1 MCT skipped) · HMAC 150 — verified against independent stack; liboqs KATs 6/6 PQC match published hashes inspector/tests/test_acvp_vectors.py · inspector/data/acvp/

Validation status (honest scope): the flagship planner is now trained and evaluated on real data: a real code corpus of 13,973 files (incl. 915 real SolidiFI/SmartBugs/EIPs/WebAuthn blockchain contracts) from production crypto libraries (openssl, boringssl, aws-lc, mbedtls, wolfssl, nodejs, golang, pyca, liboqs, …), 277 live TLS-scanned hosts converted into 40 host-disjoint real enterprise CBOMs, 401 real NVD CVEs, and 5 real liboqs timing trace sets. The planner’s headline out-of-sample real-CBOM score comes from the host-disjoint 40-fold leave-one-out protocol (scripts/eval_real_cbom_loo.py): tie-aware Kendall τ-b 0.7263 vs the doctrine heuristic 0.7450 (Δ −0.0188, 30-epoch fine-tune, 2,000 synthetic per fold, folds sharded across 4 A100s via --fold-start/--fold-end and merged with --merge-shards, re-run 2026-09-02 on the deterministic-kernel harness) — the GNN reproduces the migration doctrine on 38 of 40 held-out real estates (0 wins / 38 ties / 2 losses; the two losing folds are small heavily-tied graphs, n≤8 and n≤13, where one mis-ranked asset swings the whole fold); beats random by +0.503. Note: the earlier τ-b 0.7377 (39/40) figure predates the deterministic-kernel fix in train_gpu.py (seeded shuffles + cudnn deterministic), which changed per-fold fine-tune outcomes slightly — the current number is the reproducible one (verified: a fresh 3-fold run is bit-identical to the merged shards). The 60-epoch fine-tune variant overfits the synthetic mix (Δ −0.055), so 30 epochs is the best out-of-sample operating point. (Identical assets — e.g. eight RSA-2048 certs — are genuinely indistinguishable, so τ-b only rewards ranking the distinguishable groups; dense-rank τ would be meaningless here. The older τ-b 0.807 figure in benchmark_real_v3.json is the in-sample fine-tune, kept only as a ceiling reference.) A serious encoder bug was fixed along the way: X.509 signature names like sha256WithRSAEncryption were being encoded as SHA instead of RSA, silently poisoning real-CBOM features (and EdDSA itself never matched its own map entry — both fixed in model.py / model_v3.py). Models whose labels are inherently proprietary (migration cost, RL trajectories) remain synthetic and say so. See docs/STRATEGIC_ANALYSIS.md for the full developer roadmap and docs/design/ for target design mockups.

Validation status (honest scope): synthetic-graph τ and RL rewards (factory models) demonstrate fidelity to the doctrine rule on generated data — not superiority on real estates. Real-CBOM suites are exercised by planner/qtrust_planner/eval_harness.py --real-cbom and the RL real-CBOM benchmark (scripts/retrain_rl_real_cbom.py + scripts/eval_rl_real_cbom.py, risk labels derived from the real scan fields). A 2026-09-02 audit found the archived “RL beats the heuristic on real estates” figure (130.20 vs 112.40) was not reproducible — every real TLS asset carried the builder’s blanket criticality: medium, so real-CBOM environments had no reward signal for sequencing (all completing policies scored identically). After deriving risk labels from the real certificates (RSA-1024 → critical, RSA-2048 → high, expired/near-expiry raise the class), the honest benchmark is: agent 140.34 vs doctrine heuristic 140.62 (tie, Δ −0.28) vs random 136.84 (+2.6%) — the agent learns real risk-priority and reproduces the doctrine, like the GNN planner. Breaking the ceiling on either model needs expert pairwise labels (QTrust-RiskBench), per docs/DEVELOPER_ROADMAP.md.

Full methodology: docs/PERFORMANCE.md · docs/GPU_FEATURES.md


🚀 Quick Start

⏱ 60 seconds — scan something real (no clone needed)

pip install qtrust-inspector

# Scan a live TLS endpoint → risk + compliance report
crypto-inspector scan example.com --risk --compliance nist,cnsa

# Full evidence trail → CycloneDX 1.7 CBOM + migration roadmap
crypto-inspector scan example.com --cyclonedx cbom.json \
    --evidence ledger.json --roadmap plan.json

Prefer zero-install? Try the live in-browser demo (model runs locally in your browser) or the 60-second Colab. Building from source still works: git clone … && cd q-trust/inspector && pip install -e .

🐳 10 minutes — full stack on Docker

cd q-trust
cp .env.example .env      # set REDIS_PASSWORD, POSTGRES_PASSWORD, GRAFANA_PASSWORD
docker compose up -d --build
./scripts/verify_all.sh   # 9-step full-stack verification

Dashboard at http://localhost:3000 · API at http://localhost:3001 · Grafana at http://localhost:3002 · public verification page at /v/<asset-id>.

📜 2 minutes — issue and verify a certification bundle

With the backend running (QTRUST_API_KEY set):

# Issue a policy-gated, Ed25519-signed assurance bundle (operator key)
curl -sS -X POST http://localhost:3001/v1/certify \
  -H "x-api-key: $QTRUST_API_KEY" -H 'content-type: application/json' \
  -d '{"org":"0x1111111111111111111111111111111111111111","policy":"default"}' \
  > bundle.json

# Verify offline with either implementation — exit 0 means all checks passed
cd backend && npm run certify:verify -- ../bundle.json
cd .. && pip install -e ./sdk && python -m qtrust.bundle bundle.json

CERTIFIED bundles verify without trusting the issuer’s database: the evidence records travel with the bundle and are committed through a Merkle root and an Ed25519 proof. Expiry, tampering and policy refusals are first-class outcomes.

🧩 Per-component development setup
```bash # Contracts (Foundry — 211 tests incl. invariant + fuzz + attack) cd contracts && forge test # Planner (PyTorch Geometric) cd planner && python -m qtrust_planner.train python -m qtrust_planner.predict /tmp/bank_cbom.json # SDK pip install -e ./sdk && python -c "from qtrust import QTrustClient; print('OK')" # Backend (Fastify 5) cd backend && npm install && npm run build # Frontend (Next.js 16) cd frontend && npm install && npm run dev ```
🐍 Use the Python SDK
```python from qtrust import QTrustClient, CBOM, CBOMEntry, RiskScoringEngine client = QTrustClient(rpc_url="https://sepolia.base.org") # Verify an on-chain CBOM registration exists, active, org_did = client.verify_asset("0x...") # Score a finding locally engine = RiskScoringEngine() score = engine.calculate({"algorithm": "RSA-2048", "hndl_exposure_score": 0.5}) print(score.risk_level, score.overall_risk_score) ```

⛓ On-Chain Layer (Base L2)

Eleven UUPS-upgradeable registries behind a 7-day timelock, with EIP-712 gasless submission paths for all write types. Design decisions are recorded as ADRs.

📋 The 11 registries
| Contract | Purpose | |---|---| | `AssetRegistry` | CBOM hash registration & verification | | `VendorRegistry` | PQC-readiness attestations | | `MigrationRegistry` | Migration step recording | | `AuditRegistry` | Third-party audit attestations | | `EvidenceRegistry` | Evidence ledger root anchoring | | `ComplianceAttestation` | Compliance score attestation | | `TrustAnchorRegistry` | Issuer accreditation | | `RevocationAnchor` | Merkle-root revocation | | `PolicyCommitment` | Versioned policy hashes | | `SchemaRegistry` | Schema registration | | `QTrustGovernance` | Timelock-controlled admin | Key ADRs: [ADR-0002 — EIP-712 gasless relay](/q-trust/docs/adr/0002-eip712-gasless-relay-all-writes.html) · [ADR-0003 — UUPS + timelock](/q-trust/docs/adr/0003-uups-timelock-governance.html) · [ADR-0001 — Base L2 selection](/q-trust/docs/adr/0001-base-l2-selection.html)

🧠 GPU-Accelerated Analytics (optional)

On CUDA hardware (QTRUST_GPU_ENABLED=true), Q-Trust unlocks six GPU features:

# Feature Hardware
1 100K-graph BF16 GNN training A100-class
2 Timing side-channel analysis of PQC implementations (liboqs traces) A100-class
3 Shor quantum-threat estimation & simulation A100-class
4 RL migration agent training (vectorized PPO, 4K×64 env rollouts) A100-class
5 GPU-batch risk scoring for enterprise scans any CUDA
6 CBOM anomaly detection any CUDA

Exposed via REST (/v1/gpu/*) and surfaced in the dashboard’s Side Channel tab. Methodology & checkpoints: docs/GPU_FEATURES.md.


🧩 Ecosystem & Packages

Q-Trust ships as an installable repo plus (planned) packages. The Python SDK and the inspector CLI are packaged and CI-ready for PyPI trusted publishing, but are not yet published — verified 404 on the PyPI API as of 2026-09-03, so the badges above say “pending publication” until they are. Install from source today; the backend and planner services run as containers, and the full protocol lives on the docs site. Take the piece you need:

🐍 qtrust-sdk — the Python client: on-chain CBOM registration, gasless attestations, risk & compliance engines, W3C VCs + DIDs

# Not yet on PyPI — install from source (publish tracked in publish-pypi.yml)
git clone https://github.com/humoge7502/q-trust && cd q-trust
pip install -e ./sdk
from qtrust import QTrustClient, CBOM, CBOMEntry

client = QTrustClient(
    private_key="0x...",
    rpc_url="https://sepolia.base.org",
    asset_registry_address="0x...",
)

cbom = CBOM(
    org_did="did:ethr:0x...",
    generated_at=1700000000,
    scanner_version="1.1.0",
    assets=[CBOMEntry(asset_type="tls_cert", algorithm="RSA-2048", location="example.com:443")],
)
asset_id, cid = client.register_cbom(cbom)   # → on-chain attestation + IPFS CID

🔎 qtrust-inspector — the crypto-inspector CLI: all 10 scanner modules, one command

# Not yet on PyPI — install from source
git clone https://github.com/humoge7502/q-trust && cd q-trust/inspector
pip install -e .
crypto-inspector scan example.com --risk --compliance nist,cnsa
Package What it does PyPI Docs
qtrust-sdk Python client — CBOM registration, EIP-712 gasless signing, risk & compliance engines, W3C VCs + DIDs pending publication sdk/README.md
qtrust-inspector crypto-inspector CLI — 10 scanner modules → risk report, CycloneDX 1.7 CBOM, SARIF 2.1 pending publication inspector/README.md
Docker images Fastify API + relayer and GNN planner microservices — ghcr.io/humoge7502/qtrust-backend · qtrust-planner GHCR — built by publish-docker.yml on vX tags docker-compose.yml
Docs site Whitepaper, ADRs, deployment guides, runbooks, performance methodology — humoge7502.github.io/q-trust

📦 PyPI releases flow through publish-pypi.yml (trusted publishing) · GHCR images through publish-docker.yml on vX tags.

🚧 Docs v2 — a VitePress site is staged in docs-v2/, migration-ready.


🗺 Roadmap

gantt
    title Q-Trust Roadmap (dates indicative)
    dateFormat YYYY-MM
    axisFormat %b %Y

    section Landed
    11 registries + 211 tests        :done, 2025-11, 2026-02
    v2.0 scanner (10 modules)        :done, 2026-02, 2026-05
    GNN planner (synthetic τ 0.975)    :done, 2026-03, 2026-06
    7 CI pipelines + docs site       :done, 2026-05, 2026-07

    section In flight
    Base Sepolia deployment          :active, 2026-08, 2026-10
    External security audit          :2026-10, 2026-12

    section Next
    Multi-chain anchoring            :2026-12, 2027-03
    ZK compliance proofs             :2027-01, 2027-06
    Enterprise pilot expansion       :2027-03, 2027-09
Status Milestone
✅ v2.0 — 10-module scanner, 7 compliance frameworks, CycloneDX 1.7 + SARIF 2.1
✅ GNN planner (synthetic τ 0.975; real-estate optimum E-09) + RL migration agent
✅ Bank pilot end-to-end demo (pilot/)
🔄 Base Sepolia deployment + public verification page
🔄 Independent security audit
⬜ Multi-chain anchoring beyond Base
⬜ ZK compliance proofs (private attestations)

🧪 Reality Check

Read this before trusting the stack with anything real:

Found a security issue? Follow the responsible-disclosure policy — SLA: critical 48 h / high 72 h.

💬 Maintainer’s note: this repo runs pqc-scan.yml on itself every Monday — the protocol eats its own cooking.


📚 Documentation

Full docs site → humoge7502.github.io/q-trust
Doc What it covers
Whitepaper Protocol specification and threat model
Architecture System design, data flow, trust model
ADRs All 7 architecture decision records
Deployment guides Base Sepolia, multi-chain, go-live checklist
Runbooks Incident response, backup & restore
Performance k6 load tests, GPU latencies
Case study example.com — TLS → CBOM → on-chain → verify
Bank pilot End-to-end PQC migration demo

🚧 VitePress v2 site — staged in docs-v2/, migration-ready (brand-dark, Mermaid-native).


🏭 ML Factory — World’s Best Labeled Dataset for Migration Decisions

Stop thinking “How do I train my GNN on more data?” → Start thinking “How do I build the world’s best labeled dataset?”

Q-Trust v3.0 implements the full 64-section ML strategy (README_FACTORY.md, qtrust/):

                         Q-TRUST ML
   DISCOVERY ML          RISK ML              GRAPH ML
   └─ crypto detection  ├─ exposure          ├─ blast radius
                        ├─ HNDL              └─ prioritization
                        └─ business impact
                 MIGRATION INTELLIGENCE → CP-SAT/RL → DIGITAL TWIN

Factory pipeline qtrust/ + qtrust_bench/ + dvc.yaml:

Run factory:

dvc repro
python scripts/train_factory.py --phase all
python -m qtrust.evaluation.run_all --splits qtrust_data/splits --out qtrust_bench/evaluation/report.json

Competitive edge vs SandboxAQ/IBM/PQShield: Q-Trust is the only platform with host-disjoint real TLS CBOMs (277 hosts, 42 CBOMs), source-disjoint code corpus (17k files incl. blockchain contracts, 13+ langs), F1 0.9205 clean code detector (0 % train/eval path overlap), doctrine-labeled ranking (the expert pairwise-label loop is the open roadmap item, not a shipped claim), LayerNorm GNN τ 0.97 on the synthetic-scale suite (real-estate LOO τ-b 0.7263 — a tie with the doctrine heuristic), side-channel detector on real liboqs traces, and closed-loop twin feeding outcomes back to training (§48). Dataset > architecture.

See qtrust/README.md and docs/STRATEGIC_FACTORY.md for full 64-point roadmap.


🤝 Contributing

PRs are welcome — read CONTRIBUTING.md for dev setup, pre-commit hooks and PR conventions.

CI runs on every push & PR:

Pipeline Checks
ci.yml Foundry unit/invariant/fuzz/attack · pytest · vitest · Playwright · Hypothesis
security.yml npm audit · pip-audit · secret scanning
halmos.yml EVM symbolic execution (blocking)
pqc-scan.yml Weekly post-quantum self-scan of this repo
publish-*.yml Docker (GHCR) · PyPI (qtrust-sdk, qtrust-inspector)
docs.yml MkDocs Material → GitHub Pages

Good first issues: good first issue · Discussions: Q&A


🌟 Community

Maintainer: @humoge7502 · contributions welcome via CONTRIBUTING.md.

📝 Essays: Why we published a benchmark we tied — our evaluation philosophy.


📜 License

MIT — see LICENSE. © Q-Trust Contributors.


Q-Trust orbit badge Q-Trust — trust, proven post-quantum. Back to top Built with ❤️ and an unreasonable love for cryptographic inventory.