Home/Documentation

NIRVQ Documentation

The official documentation for the NIRVQ v4.1 specification and the Phase 1 reference implementation — how the system works end to end, how the codebase is built, and the exact evidence status of every claim.

EDITION v4.1 · ENVELOPE 0x0400 BACKEND liboqs 0.16.0 RUN 10 2,509 PASSED · 6 FAILED · M-1 PASS DECISIONS 18/18 RULED · 0 OPEN CLEAN-ROOM RUN 3 COMPLETE — NOT GREEN GATES CLAIMED PASSED NONE

What NIRVQ is

NIRVQ is a post-quantum sealing system for data at rest. It protects an object so that opening it requires all of its required key components — not any one of them — and so that the object can survive the loss, rotation, or compromise of a single cryptographic family.

A single sealed object — a ciphertext — is bound to up to three independent secrets:

  • Slot 1 — ML-KEM-768 (FIPS 203, standardised). A lattice-based key encapsulation mechanism.
  • Slot 2 — HQC-192 / HQC-3 (code-based, FIPS 207 pending). A second, cryptographically diverse family.
  • Slot 3 — Threshold anchor secret S_3. A secret held by a threshold key service, never by a single custodian.

The combiner derives the key that protects the object from all required slots together. This is called AND-survival: for the VAULT profile, learning any one or two slots is not enough to open the object. If one family is later weakened, the object does not automatically fall — the other families still stand.

NIRVQ is not a blockchain, consensus protocol, or signing system; not a wallet or a live signing path; not a transport encryption protocol (use TLS / Noise for data in motion); and not a general-purpose database encryption product. It protects material at rest: archives, backups, seed material, custody records, documents, and any blob whose confidentiality must survive decades and a change in cryptographic assumptions.

NIRVQ — System Architecture

Phase 1 reference implementation  ·  v0.1.0-phase1-reference  ·  liboqs 0.16.0  ·  Python 3.12

Clients

CLI

nirvq serve · 8 commands

HTTP API

9 endpoints · loopback-only

Demos

Seed archive · third-party verify

Envelope

NVQ4 envelope  ·  v0x0400  —  CORE · VAULT · VAULT-FEDERAL Single error ERR-OPEN-FAILED  ·  re-wrap / burn lifecycle

Combiner — three components, one key

ML-KEM-768

ciphertext 1,088 B

ss_1 · 32 B

HQC-3

ciphertext 8,978 B · sk 4,602 B

ss_2 · 32 B · HQC-192

Anchor secret

threshold-shared

S_3 · 32 B
HKDF-SHA-384 “NIRVQ-COMB-v1” → combined key

Services

Key service

Shamir threshold · epochs · EpochStore

quarantine · decap budget

Passport

Merkle log · threshold verify

verify limbs L1–L8

Beacon

Rounds · staleness

24 h bound · successor

Governance

Constitution · curators

K4 · tribunal · burn · exit

ABSOLUTE — one-time-pad layer

Depot · Shamir pads · Wegman–Carter authentication · ledger · caps Pads are consumed once — a crash or a truncated envelope must never reuse one. Separate experimental service; its counts are never mixed with VAULT.

Foundation

liboqs 0.16.0 real KEMs  ·  Python 3.12  ·  Node KAT verifier 40/40 CI workflow  ·  SECURITY.md  ·  SBOM (CycloneDX)

github.com/nirvqHQ/nirvq-system  ·  docs/NIRVQ-PROPOSAL.pdf  ·  Phase 1 reference — not a production system

Figure — the NIRVQ system at a glance. Clients seal data through the NVQ4 envelope and the three-component combiner (ML-KEM-768, HQC-192, threshold anchor), backed by the key service, Passport, beacon, and governance — with ABSOLUTE as a separate experimental layer on the liboqs 0.16.0 foundation. Each part is covered in its own docs page, in reading order below.

Where to start

If you are…Start here
Evaluating NIRVQThis overview → Combiner & Envelope → Evidence & status
Integrating NIRVQGetting started (below) → Profiles & API / CLI
Operating NIRVQKey Service & Lifecycle → Passport, Beacon & Governance
Auditing NIRVQCombiner & Envelope → Codebase, Build & Tests → Evidence & status

Status labels used everywhere

  • Demonstrated (local limb) — implemented and tested locally on real KEMs in the reference build. Not independently witnessed.
  • Specified — defined normatively in the v4.1 specification, with tests or design in place, but not yet demonstrated to the gate standard.
  • Absent — specified as a target, not yet implemented.
  • Simulated boundary — implemented with an in-memory or local substitute for a production boundary (for example, no physical HSM). Never presented as production evidence.

No NIRVQ gate — G-1, G-COMB, M-LC-1, G-2, G-3, G-LC, G-EB, or G-ABS-5 — is claimed passed anywhere in this documentation. Where a feature is experimental, it says so.

Design principles

  1. AND, not OR. Security composes by conjunction for the high-assurance profiles. A combiner that falls if any component falls is not used for VAULT.
  2. Diversity is not proof. Using two different families does not by itself prove the combination is secure. The three-component combiner generalises the two-component construction in NIST SP 800-227 §4.6 and is subject to independent review under gate G-COMB.
  3. One error. Every opening failure returns exactly ERR-OPEN-FAILED. No per-slot, per-policy, or per-tag error leaks to a caller, a log, or an API.
  4. Living objects. A sealed object is not frozen to the keys that created it. Its header can be re-wrapped to a new epoch without re-encrypting its body — then the old epoch can be burned, after every successor is verified.
  5. Verifiable history. Every object carries a Passport stub in its authenticated header, and the full system maintains a hash-chained Passport and transparency log so a third party can verify an object's history from public keys and the log alone.
  6. Honest status. Every claim is labelled Demonstrated, Specified, or Absent, per evidence category. Test counts are never summed across categories.

Getting started — requirements

  • Python 3.12 (reference implementation)
  • liboqs 0.16.0 with liboqs-python 0.16.0.2 — real ML-KEM-768 + HQC-3
  • cryptography==51.0.1, pytest==9.2.0 (pinned in requirements.txt)
  • cmake ≥ 3.28 and gcc ≥ 13 if building liboqs from the verified release tarball
Never install system-wide

The host Python is PEP 668 externally managed. Always work inside the project virtual environment. Never use --break-system-packages.

Install (reference build)

cd ~/workspace/nirvq-build python3.12 -m venv .venv .venv/bin/pip install -r requirements.txt bash scripts/build_liboqs.sh # verifies + builds liboqs 0.16.0 into .venv/oqs (~20 min)

scripts/build_liboqs.sh verifies the official release tarball before building (SHA-256 162d5b51…01eae). The KEM module refuses to import oqs unless the prebuilt library is present, so the wrapper's auto-install path can never trigger accidentally. If real KEMs are unavailable, the build fails fast with RealKemsUnavailable — it never silently falls back. A clearly labelled TEST KEM backend exists for deterministic unit work only and must be selected explicitly.

Your first seal and open

from nirvq.keyservice import EpochStore, KeyService from nirvq.kem import RealKemBackend from nirvq.envelope import seal, open_envelope backend = RealKemBackend() # real ML-KEM-768 + HQC-3 via liboqs store = EpochStore(backend) store.create_epoch(1) ks = KeyService(store) blob = seal(ks, profile="VAULT", body=b"hello, post-quantum world", epoch_id=1) # blob is the NVQ4 wire bytes — store it anywhere (file, object store, database) plaintext = open_envelope(ks, blob) # requires all VAULT slots assert plaintext == b"hello, post-quantum world"

Any failure — tampered header, wrong epoch, burned epoch, bad tag, truncated bytes — raises the single opening error:

from nirvq.errors import OpenFailed try: open_envelope(ks, tampered_blob) except OpenFailed: pass # the only outcome a caller ever sees: ERR-OPEN-FAILED

Run the tests

cd ~/workspace/nirvq-build .venv/bin/python -m pytest tests/ -q

Expect a long run on the real backend: HQC-3 in liboqs 0.16.0 is reference-only (≈96 ms encapsulate / ≈131 ms decapsulate per operation). Report results per evidence category — never as one summed total. See Codebase, Build & Tests.

Core concepts

  • Object — the unit NIRVQ protects: an arbitrary byte string plus a fresh random 32-byte object_id assigned at birth. The object_id never changes, including across re-wraps.
  • Envelope — the sealed form of an object: the NVQ4 wire bytes. It never contains encapsulation keys (ek_1 / ek_2) — keys are resolved by epoch ID from the key service. An envelope carrying an ek is non-conforming.
  • Slot — one input to the combiner. Slot 1 = ML-KEM-768 shared secret; Slot 2 = HQC-192 shared secret; Slot 3 = anchor secret S_3. Slot 4 is an annex position outside the tag/KDF (skipped by length on open, never trusted). Slot 5 is vacant.
  • AND set — the slots a profile requires. VAULT requires {1,2,3}; VAULT-FEDERAL requires {1,3}; CORE requires {1}. Sealing aborts if any AND-set key is unavailable — NIRVQ never seals a reduced-slot envelope.
  • Epoch — a numbered generation of key material. Re-wrap moves an object to a newer epoch; burn destroys an old epoch's decapsulation material after all its objects have verified successors.
  • DEK / KEK / K_TAG — a fresh random 256-bit DEK per object encrypts the body and is never derived from the combiner; the combiner-derived KEK wraps the DEK, and K_TAG keys the envelope tag.
  • Passport — the per-object history record. A 32-byte stub derived from the object_id sits inside every envelope's authenticated header.

The full documentation map

Fourteen pages, in reading order. Each page is self-contained; the sidebar on every docs page carries the same map.

PageWhat it covers
Overview & Getting StartedWhat NIRVQ is, status labels, design principles, install, your first seal and open
Combiner & EnvelopeNIRVQ-COMB-v1 derivation, IKM layout, the NVQ4 wire format, the 8 sealing steps, opening without short-circuiting
Key Service & LifecycleEpochs, threshold custody, the decapsulation budget, header-only re-wrap, successor verification, the no-burn rule
Passport, Beacon & GovernancePassport chains and the transparency log, Survival Vector, beacon and Fallback Covenant, constitution and curator voting, the immune feed, the security model, ABSOLUTE
ABSOLUTE — One-Time-Pad ServiceThe separate experimental one-time-pad service: Wegman–Carter authentication, pad ledger, depot simulation, the 1 GiB pilot cap
FO Validity CheckerThe FO re-encryption check that makes the decapsulation budget operable on real KEMs — both limbs have landed and are wired at the production call sites (fix wave, Dec 6, 2026)
ACSP DetectionThe Anchor Compromise-Simulation Programme: four detection limbs, six scenarios — S1/S2 fail, S3–S6 pass, the gate does not pass and is carried as accepted residual R-ACSP-1 (canary p = 0.05 decided)
Threat Model & SecuritySix adversary classes, twelve attack analyses with residual status, T-COMB-15 in full, and what is explicitly out of scope
Codebase, Build & TestsModule layout, build and run, the T-COMB battery, KAT vectors, the five evidence categories, measured performance, consolidated limitations
Profiles & API / CLIChoosing CORE, VAULT-FEDERAL, or VAULT; the Python API; the full-system CLI; third-party verification; the preservation worked flow
Operations RunbookRoles, standing duties, the epoch-rotation and backup procedures, and the four incident runbooks
Design Decisions & Open ItemsThe D-01–D-20 decision register, the defects the process found and fixed, and every open item — all 15 items in the decision wave now ruled (0 open), including F3 MANDATE and THR-1 = M22 (Sep 2029)
Evidence, FAQ & GlossaryThe gate ledger, maturity levels, version history, the short FAQ, and the glossary
Use Cases — Banks, AI & Web3Who NIRVQ is for: banks and financial institutions (wedge 6/6), AI companies (narrow 6/6-shaped escrow case only), blockchain and web3 (Digital Asset Preservation, Target) — applicability, not customers

Prefer questions to chapters? The Questions & Answers page covers the same ground as 29 plain-language answers, with a filter. Prefer the whole documentation as one file? It is also maintained as a GitBook-ready Markdown source for hosting as a standalone docs site.