Service Architecture

How the entropy reservoir, health gating, cryptography layer, and audit pipeline are wired. Every draw is observable. Every response is reproducible.

The Paradigm Shift

Legacy CSPRNG

  • Silent entropy source — the application trusts it
  • No way to verify "where the random came from"
  • No replay procedure for audit
  • Fallback indistinguishable from a normal draw
  • Vendor lock-in: tied to OS or hardware module

QSG

  • Hardware-derived entropy, source disclosed per draw
  • Auditable provenance, cryptographically chained events
  • Persistent compliance archive (R2 JSONL) — retention under configuration
  • Explicit fallback object on every response
  • Edge API — swap regions or vendors without client change

6-Layer Quantum Assurance Pyramid

Six layers back every draw. Three feed the API today (L2, L5, L6). Three remain on the internal calibration loop (L1, L3, L4).

6

Post-Quantum Crypto PRIVATE BETA · API-FEEDING

X25519 + ML-KEM-1024 hybrid key establishment. FIPS 203 Category 5. AEAD via AES-256-GCM with 96-bit nonces. Private-beta service pending independent interoperability validation. ML-DSA-65 signing available when client provides a public key.

5

NIST Health Gating SHIPPED · API-FEEDING

SP 800-90B Repetition Count Test (RCT) and Adaptive Proportion Test (APT) on every draw against a 1024-byte sample window. rct_passed / apt_passed boolean fields in the response.

4

Diagnostic Tomography ROADMAP · INTERNAL

State-tomography snapshots from the calibration loop. Used to characterize backend fidelity and validate admission thresholds. Not yet surfaced in the API.

3

Quantum Channel ROADMAP · INTERNAL

State-transport fidelity tracking per channel on the calibration loop. Not yet surfaced in the API.

2

Entropy Source SHIPPED · API-FEEDING

Hardware-derived entropy with a disclosed source_class per draw. Per-batch entropy_score admission threshold: ≥ 0.99. source_class enum in every response.

1

Geometry & Topology ROADMAP · INTERNAL

Engineered gate connectivity and backend-specific correlation metrics. Informs the hardware procurement cycle. Not yet surfaced in the API.

API Contract

Every authenticated draw returns the same shape. Fields are stable across versions; additions are versioned.

POST/v1/entropy

Request body

{
  "format": "hex",
  "length": 32
}
200/v1/entropy response

Response body (real shape, abbreviated)

{
  "success": true,
  "request_id": "req-example",
  "timestamp": "2026-09-08T12:00:00.000Z",
  "issued_at": "2026-09-08T12:00:00.000Z",
  "purpose": "vrf-seed",
  "data": {
    "format": "hex",
    "length": 32,
    "size_bytes": 32,
    "entropy": "…",
    "encoding": "hex"
  },
  "provenance": {
    "source_class": "hardware-derived",
    "source_id": "qsg_pool_20260908_001",
    "backend_class": "hardware-batch-reservoir",
    "entropy_score": 0.99875,
    "conditioning": "von-neumann",
    "unique_states": 8192,
    "job_epoch": "2026-09-08",
    "health_check": {
      "rct_passed": true,
      "apt_passed": true,
      "timestamp": "2026-09-08T12:00:00.000Z"
    },
    "tier": "builder",
    "purpose": "vrf-seed"
  },
  "fallback": {
    "is_fallback": false,
    "reason": null,
    "original_source": null
  },
  "audit": {
    "reservoir_remaining_bits": 41915136
  },
  "tier": "builder",
  "rate_limit": {
    "remaining": 59,
    "reset_at": 1789923180000
  },
  "billing": {
    "tier": "builder",
    "units": 1,
    "weight": 1,
    "charged_units": 1,
    "unit_definition": "1 unit = 1 entropy request (length ≤ 64 bytes); larger requests charged at higher weight"
  }
}

Field reference

Reservoir Pipeline

Five sequential stages from raw hardware output to signed API response. Each stage gates the next; failure at any stage is observable.

  1. 1. Hardware Batch Reservoir

    Raw measurement output with a disclosed source_class per draw. Each batch is tagged with a source_id (e.g. qsg_pool_20260908_001), job_epoch, and entropy_score. Pool byte-age cap: 14 days.

  2. 2. Admission Governance

    entropy_score ≥ 0.99 required for admission. Min unique states per batch: 8,192. Below threshold → batch is rejected, never admitted to reservoir.

  3. 3. Continuous Health Testing

    SP 800-90B RCT and APT run on a rolling 1024-byte sample window. Failed tests force fallback regardless of entropy_score.

  4. 4. Reservoir

    Admitted bytes buffer in the edge layer. Pool threshold: ≥ 1 MB (MIN_POOL_THRESHOLD = 1024 * 1024). Consumption cap: 90% per draw (MAX_BATCH_CONSUMPTION = 0.90).

  5. 5. Edge API Gateway

    Authenticated draw returns entropy bytes + provenance record. KV (90-day operational) + R2 (compliance archive planned) audit chain attached.

Three Sequential Fallback Checks

Fallback is explicit and customer-visible. The fallback.is_fallback field is true only when one of these checks fails — never silently.

  1. Check 1: Pool size

    Reservoir must hold at least 1 MB plus the requested draw. Failure → reason: "pool_unavailable".

  2. Check 2: Admission

    entropy_score of the candidate batch must be ≥ 0.99. Failure → reason: "entropy_score_below_threshold".

  3. Check 3: Health tests

    RCT and APT must both pass on a 1024-byte sample. Failure of either → reason: "health_tests_failed:RCT,APT" (or whichever test failed).

If any check fails, the response is still issued — with bytes from the documented CSPRNG fallback path and the nested fallback object populated. The original requested source and the failure reason are both preserved in fallback.reason and fallback.original_source.

Dual-Layer Audit

Every draw produces two records: an operational telemetry record and a compliance archive. Both share the same request_id.

Operational Layer

Edge KV Store · 90-day rolling TTL

  • High-speed read/write for telemetry
  • Rate-limit counters per API key
  • Metering hooks for billing
  • Immediate gateway observability
  • Designed for the operational dashboard

Persistent Layer

Object Storage Archive · Retention under configuration

  • Cryptographic compliance handoff
  • Full-batch provenance and signatures
  • Deep historical forensics
  • Region-pinned for data-residency
  • Replay-ready for regulator review

From Physics to REST

End-to-end latency budget for a normal draw at the edge.

StageComponentTypical
1TLS + auth verification (edge network)5–10 ms
2Pool byte extraction (edge-backed)<1 ms
3NIST RCT/APT on 1024-byte sample2–5 ms
4HKDF derivation + provenance assembly<1 ms
5Provenance record construction1–3 ms
6Operational write (KV)2–8 ms
7Response serialization + edge return<1 ms
TotalEdge P50<20 ms
TotalEdge P95Unspecified

Deployment Posture

The service runs on a global edge network. No infrastructure to manage; no warm-up; no provisioned capacity.

Edge Runtime

Distributed compute at 300+ global POPs. Sub-50ms P95 latency.

  • Per-request cold start <5 ms
  • No provisioned concurrency
  • Auto-scaling to global traffic spikes

Edge KV Store

Operational audit record. 90-day TTL.

  • Reads <10 ms P95 globally
  • Eventually consistent writes
  • Per-API-key rate counters

Object Storage Archive

Persistent audit log. Retention under configuration.

  • Zero-egress object storage
  • Append-only JSONL streams
  • Region-pinned for data-residency

Take it for a test draw

Access is reviewed; keys start at Builder. Same response shape, same audit chain.