# Algorithm & Protocol Specification — Municipal Cryptographic Resilience & Epistemic Commit Firewall (v2)

**Status:** Pre-outreach engineering specification & red-team remediation notes  
**Date:** November 30, 2026  
**Authors / Collaborators:** Christopher Vivian Duguay (`A Technique` / Sweetbrier — Belnap Epistemic Firewall, Fine-Grained `#OV` Anti-Sybil PoW, IT-Channel & X-Road Sidecar architecture); Roanoke hardware collaborator (3×3 `νMOS` Capacitive Coupled-Tile Physical Tamper Cell)  
**Target Review Audiences:** Stephen A. Weis (`saweis.net` / Anthropic Secure Frameworks), Cryptography Incident Review Group (`cirg.org`), Roanoke Valley Broadband Authority (`RVBA`) dark-fiber stakeholders, and NIIS / X-Road interoperability architects.

---

## 0. Threat-Model Separation (The "No-Conflation" Table)

A core rule of this architecture is **never conflating cryptographic threat models**. Standard production integrity (SHA-256 / X-Road PKI), conditional in-`P` fine-grained anti-Sybil friction (`#OV`), unconditional information-theoretic dark-fiber transport (`OTP + Wegman–Carter + Shamir`), and exploratory physical-layer tamper sensing occupy distinct layers with distinct assumptions:

| Layer | Mechanism | Exact Assumption | Survives Practical `P = NP` (*Algorithmica*)? | Operational Role |
|---|---|---|---|---|
| **Layer 0: Epistemic & Scope Firewall** (`obb_epistemic_lattice`) | Belnap $B_4$ lattice, LLM source clamp, Zero-PII floor, 1-Click atomic rollback | Deterministic policy logic (non-cryptographic; receipt binding uses SHA-256 in standard mode or Wegman–Carter MAC in IT mode) | **Yes** (policy invariants are structural, not cryptographic) | Stops AI agents from self-certifying guesses, clobbering locked fields, or pushing unverified/PII payloads onto the wire |
| **Layer 1: Production Federated Interop** (NIIS X-Road REST Sidecar) | Real NIIS X-Road Security Server (`X.509` / `PKCS#11` HSM / `ASiC-E` / `RFC-3161` TSA + NIIS NIST-PQC migration path) | Classical / Post-Quantum computational hardness (RSA/ECDSA or ML-KEM/ML-DSA + SHA-256) | **No** (PKI, PQC, and SHA-256 preimage/collision break under practical `P = NP`) | Production cross-organization interoperability today; Layer 0 sits as a REST sidecar in front of the Security Server |
| **Layer 2: Fine-Grained `#OV` Anti-Sybil Speed Bump** (Shield 1) | Ball–Rosen–Sabin–Vasudevan (STOC 2017 / CRYPTO 2018) `#OV` polynomial evaluation over $\mathbb{F}_{2^{127}-1}$ with $d \ge 2\lceil\log_2 n\rceil$ | **Conditional** in-`P` fine-grained `#OV` time lower bound ($\Omega(n^{2-o(1)})$). *Note: `P = NP` refutes SETH; `#OV` survives only if OVC / `#OV` stays hard in `P`* | **Conditional** (polynomial anti-Sybil gap only; survives OWF/hash collapse if `#OV` stays quadratic) | Zero-CAPTCHA, zero-PII public-form rate limiting (replaces Google reCAPTCHA) |
| **Layer 3: Information-Theoretic Dark-Fiber Channel** (Shield 3) | In-person pre-shared hardware-TRNG SSDs + Vernam OTP + Wegman–Carter polynomial MAC over $\mathbb{F}_{2^{127}-1}$ + Shamir $t$-of-$n$ / IT-VSS | **Zero computational assumptions** (physical custody of pre-shared drives + dark-fiber endpoints + crash-safe monotonic burn) | **Yes (Unconditional)** | Extreme-resilience backbone for fixed-topology regional municipal dark-fiber rings (e.g., 5–20 RVBA anchor institutions) |
| **Layer 4: Physical-Layer Tamper Cell** (Shield 2 — Exploratory) | Lumped-element `3×3` `νMOS` floating-gate charge-sharing cell + multi-tile pairwise-order PUF array | Physical probe/decapsulation capacitance perturbation | **Yes** (physical layer, independent of complexity class) | Pre-silicon / pre-PCB hardware research prototype (Roanoke collaborator); open engineering questions below |

---

## 1. Algorithm Note 1 — Shield 1: Fine-Grained `#OV` Anti-Sybil PoW (`obb_fine_grained_pow`)

### 1.1 Literature Lineage & Exact Mathematical Definition
Anchored to:
* Ball, Rosen, Sabin, and Vasudevan, **"Average-Case Fine-Grained Hardness"** (*STOC 2017*), and
* Ball, Rosen, Sabin, and Vasudevan, **"Proofs of Work from Worst-Case Assumptions"** (*CRYPTO 2018*).

Let $p = 2^{127} - 1$ (127-bit Mersenne prime, $\mathbb{F}_p$). Given two matrices $U, V \in \mathbb{F}_p^{n \times d}$, define the counting Orthogonal Vectors polynomial:
$$p_{\text{OV}}(U, V) \;=\; \sum_{i=1}^{n} \sum_{j=1}^{n} \prod_{\ell=1}^{d} \bigl(1 - U_{i,\ell} V_{j,\ell}\bigr) \pmod{p}$$

### 1.2 Critical v1 Vulnerability Fixed: The $O(2^d n)$ Monomial-Factorization Cheat
In v1, the Python default used $d = 4$ (and the browser demo hardcoded $d = 3$). **At constant $d$, `#OV` is NOT quadratic.** Expanding the inner product over all subsets $S \subseteq \{1, \dots, d\}$ gives the exact algebraic identity:
$$p_{\text{OV}}(U, V) \;=\; \sum_{S \subseteq [d]} (-1)^{|S|} \left( \sum_{i=1}^{n} \prod_{\ell \in S} U_{i,\ell} \right) \left( \sum_{j=1}^{n} \prod_{\ell \in S} V_{j,\ell} \right) \pmod{p}$$
Using Gray-code incremental subset products, an attacker evaluates $p_{\text{OV}}(U, V)$ in **$O(2^d \cdot n)$ linear time** instead of $\Theta(d n^2)$:
* At $d = 3$, $2^3 = 8$ terms $\implies$ trivial $8n$ linear-time bypass.
* At $d = 4, n = 10{,}000$, $16n$ beats $d n^2$ by **~2,500×**.

**Mandatory v2 Parameter Rule:**
1. Enforce **$d \ge 2 \lceil \log_2 n \rceil$** (and strictly $2^d \ge n^2$) in production issuers so that monomial expansion $O(2^d n)$ is asymptotically and concretely slower than direct $O(d n^2)$ evaluation.
2. Also account for **Abboud–Williams–Yu (SODA 2015)** polynomial-method algorithms when $d = c \log n$ (running in $n^{2 - 1/O(\log c)}$): selecting $d \ge \max(16,\; 2\lceil\log_2 n\rceil)$ (e.g., $n = 256, d = 18$; $n = 512, d = 22$; $n = 1024, d = 24$) keeps both monomial expansion ($2^{22} \approx 4.2\text{M} \gg 512^2$) and polynomial-method constant factors outside practical reach while keeping verifier cost tiny ($2d + 1 = 45$ Lagrange points = microseconds).
3. **Browser UI rule:** Any interactive demo slider running small $(n, d)$ for 10 ms responsiveness must display an explicit warning badge that production anti-Sybil enforcement requires $d \ge 2\lceil\log_2 n\rceil$, and should include a live side-by-side demonstration of the $O(2^d n)$ cheat at $d = 3$ vs. its failure at $d = 18$!

### 1.3 Verification Protocol & Schwartz–Zippel Soundness
For an epoch base instance $(U^*, V^*)$ with precomputed $y^* = p_{\text{OV}}(U^*, V^*)$:
1. Apply a $p_{\text{OV}}$-preserving automorphism $(\tilde{U}, \tilde{V}) = \mathcal{A}(U^*, V^*)$: independent row permutations $\pi_U, \pi_V \in S_n$, shared column permutation $\pi_c \in S_d$, and reciprocal diagonal scaling $\alpha_\ell \in \mathbb{F}_p^*$ on $\tilde{U}$ and $\alpha_\ell^{-1}$ on $\tilde{V}$. Since $\tilde{U}_{i,\ell}\tilde{V}_{j,\ell} = U^*_{\pi_U(i),\pi_c(\ell)} V^*_{\pi_V(j),\pi_c(\ell)}$, we have $p_{\text{OV}}(\tilde{U}, \tilde{V}) \equiv y^* \pmod p$.
2. Sample uniform blinding directions $R_U, R_V \xleftarrow{\$} \mathbb{F}_p^{n \times d}$ and secret evaluation point $r^* \xleftarrow{\$} \mathbb{F}_p \setminus \{1, \dots, 2d+1\}$.
3. Publish $U_0 = \tilde{U} - r^* R_U$, $V_0 = \tilde{V} - r^* R_V$, along with $(R_U, R_V)$.
4. Client evaluates $y_k = p_{\text{OV}}(U_0 + k R_U,\, V_0 + k R_V)$ for $k = 1, \dots, 2d+1$ ($\Theta(d^2 n^2)$ work).
5. Server checks $\text{Lagrange}(\{(k, y_k)\}_{k=1}^{2d+1},\, r^*) \stackrel{?}{=} y^*$ in $O(d^2)$ field ops (or $O(d)$ with precomputed barycentric weights for fixed $k \in \{1,\dots,2d+1\}$).
6. **Soundness:** Since $\deg_t p_{\text{OV}}(U_0 + t R_U, V_0 + t R_V) \le 2d$, any forged curve $\tilde{g} \neq g$ of degree $\le 2d$ matches $g(r^*)$ with probability:
$$\Pr[\text{forge}] \;\le\; \frac{2d}{p - (2d + 1)}$$
At $d = 20$: $\le 40 / (2^{127} - 42) \approx 2.35 \times 10^{-37}$.

### 1.4 Operational Hardening & Honest Tradeoffs (v2 Fixes)
* **Fix Unauthenticated Epoch-Rotation DoS:** In v1, calling `issue_challenge()` 64 times without solving forced `_rotate_epoch()` (triggering server-side $O(d n^2)$ work on demand) and grew `_pending` / `_burned_ids` without bound.
  * *v2 Fix:* Decouple epoch rotation from unauthenticated `issue_challenge()` calls — rotate only on a **wall-clock / verified-solution schedule** (background precompute thread), cap `_pending` with strict TTL eviction (e.g., 120 s) and bounded LRU size, and rate-limit per-IP issuance.
* **Challenge Bandwidth Honesty:** Sending explicit $(U_0, R_U, V_0, R_V)$ costs $4 n d \times 16\text{ B}$ ($\approx 655\text{ KB}$ at $n=512, d=20$). State cleanly: *Algorithmica mode* pays this bandwidth to avoid all OWF assumptions; *standard mode* compresses $(R_U, R_V)$ to a 32-byte XOF seed (cutting payload in half immediately, or full seed-derived challenges per CRYPTO 2018).
* **Exact Complexity Honesty under `P = NP`:** Explicitly state that **`P = NP` refutes SETH**. Shield 1 survives `P = NP` **only conditionally** on the weaker in-`P` fine-grained `#OV` conjecture ($\Omega(n^{2-o(1)})$ even if NP $\subseteq$ P), and yields **polynomial** anti-Sybil asymmetry (speed bump), not cryptographic secrecy.
* **Open Question for CIRG (Ryan Williams / Justin Thaler / Dan Boneh):** Across $K$ challenges within one epoch sharing $y^*$ under row/col permutation + reciprocal diagonal scaling, a single challenge hides $(\tilde{U}, r^*)$ perfectly via the uniform blinding matrix $(R_U, R_V)$. Across multiple challenges in the same epoch, does the pencil equivalence under the monomial automorphism group expose any sub-$O(n^2)$ algebraic invariant (e.g., via rank/cross-ratios) that allows recovering $r_1^*, r_2^*$ without solving `#OV` — or should production strictly eliminate epoch reuse via **planted / batch-verified** instances per CRYPTO 2018?

---

## 2. Algorithm Note 2 — Shield 3: Information-Theoretic Dark-Fiber Channel (`obb_info_theoretic_channel`)

### 2.1 Why Municipal Dark Fiber Makes Pre-Shared OTP Practical
Pre-shared One-Time Pads fail on the open dynamic internet because of $O(N^2)$ ad-hoc key distribution. They **succeed** on **fixed-topology regional municipal dark-fiber rings**, such as the **Roanoke Valley Broadband Authority (RVBA)** (100–120+ miles of open-access municipal dark fiber connecting City of Roanoke, Roanoke County, City of Salem, Botetourt County, and anchor civic institutions):
* For $N = 10$ fixed civic anchor hubs, there are $N(N-1) = 90$ directional point-to-point channels.
* A single **$1\text{ TB}$ hardware-TRNG directional pad** exchanged at an annual/quarterly in-person ceremony lasts:
$$\frac{10^{12}\text{ bytes}}{500\text{ msgs/day} \times (512\text{ B payload} + 32\text{ B MAC key}) \times 365.25\text{ days/yr}} \;=\; 10{,}065.6\text{ years}$$
* **Zero computational hardness assumptions** on confidentiality or bilateral integrity — survives quantum computers, GPU-accelerated GNFS, and an unbounded / `P = NP` adversary unconditionally.

### 2.2 Exact Encrypt-then-MAC Construction over $\mathbb{F}_{2^{127}-1}$
1. **Directional Pads:** Every ordered pair $(A \to B)$ and $(B \to A)$ owns an independent pad ID (`pad_id`) so peers never race on offsets.
2. **Separate OTP & MAC-Key Sub-Tapes (v2 hardening):** Partition each directional pad into two strictly disjoint address spaces — `[0, M_otp)` for Vernam XOR encryption and `[M_otp, M_total)` for Wegman–Carter keys — eliminating any possibility of offset-overlap confusion between ciphertext and MAC slices.
3. **Encrypt-then-MAC:**
   * Sender draws `otp_key` of length $|P|$ from OTP tape at sequential offset `otp_offset`, computes $C = P \oplus K_{\text{otp}}$.
   * Sender draws strictly uniform $(r, s) \in \mathbb{F}_p^* \times \mathbb{F}_p$ ($r \neq 0$, $p = 2^{127}-1$) via rejection sampling from the MAC-key tape (consuming 32 B with probability $1 - 2^{-126}$; strictly capped at `mac_pad_len <= 64` B).
   * Construct canonical authenticated byte string:
     $$A \;=\; \text{UTF8}\bigl(\text{canonical\_json}(\text{header})\bigr) \,\|\, \texttt{0x00} \,\|\, C$$
     where `header` binds `pad_id, sender_id, receiver_id, service_code, lane, seq_no, otp_offset, otp_len, mac_pad_offset, mac_pad_len`.
   * **Injective block encoding:** Split $A$ into 15-byte big-endian chunks $c_1, \dots, c_m$; set $b_j = (2^{120} \mid \text{int}(c_j)) \in [2^{120}, 2^{121}) \subset \mathbb{F}_p$; append trailing length block $b_{m+1} = |A| \bmod p < 2^{120}$. (Sentinel bit $2^{120}$ guarantees injectivity even for trailing `\x00` bytes and empty strings.)
   * **Tag computation (Horner):**
     $$T \;=\; \left(\sum_{j=1}^{k} b_j r^j + s\right) \bmod p, \qquad k = m + 1 = \left\lceil \frac{|A|}{15} \right\rceil + 1$$
   * **Unconditional Single-Attempt Forgery Bound:** Even against an unbounded adversary who sees one valid authenticated message $(A, T)$:
     $$\Pr[\text{forge}] \;\le\; \frac{k}{p - 1}$$
     (For a 600 B authenticated envelope: $k = 41$, $\Pr[\text{forge}] \le 2.41 \times 10^{-37}$.)

### 2.3 Critical v1 Vulnerabilities Fixed in v2
1. **Fix 1-Packet Pre-MAC Pad-Burn DoS (`receive_envelope`):**
   * *v1 Bug:* `receive_envelope()` called `pad.consume_at(env.mac_pad_offset, env.mac_pad_len)` **before** verifying the MAC, with **no upper bound on `mac_pad_len`** and **no window check on offsets**. One unauthenticated forged packet with `mac_pad_len = 1_000_000_000` permanently wiped the receiver's entire pad!
   * *v2 Fix:*
     1. Enforce hard protocol bounds **before** reading the pad: `32 <= env.mac_pad_len <= 64` (multiple of 16), `0 < env.otp_len <= MAX_MSG_BYTES` (e.g., 64 KiB), and both offsets strictly within a narrow sliding window `[recv_cursor, recv_cursor + WINDOW_BYTES]` of their respective tapes.
     2. **Peek-then-Burn / Bounded Retry Budget:** Read `(r, s)` without zeroizing first; verify `WegmanCarterMac.verify_tag(...)` in constant time.
        * On **PASS:** Atomically burn both `mac_slice` and `otp_slice` (never reusable again) and advance cursor.
        * On **FAIL:** Increment a per-slot failure counter; permanently quarantine/burn that 32-byte MAC slice only after $q_{\max} = 3$ bad attempts (and fire a physical-link tamper alert!). Security degrades by at most $3\times$ ($\le 3k / (p-1) \approx 7 \times 10^{-37}$) while completely neutralizing single-packet pad-wipe and naive offset-desync DoS.
2. **Crash-Safe Write-Ahead Burn-Before-Send (WABBS):**
   * *v1 Bug:* `_cursor` and `_consumed_intervals` lived only in RAM — a reboot resets cursor to `0` $\implies$ catastrophic two-time pad (leaks $P_1 \oplus P_2$ and recovers Wegman–Carter $r$ algebraically).
   * *v2 Spec:* Sender must commit `[cursor, cursor + N)` to a durable local WAL / raw superblock + overwrite consumed pad sectors + `fsync()` **before** putting a single ciphertext byte on the wire. On reboot after crash, skip past any reserved-but-unconfirmed range (losing 1 KB out of 1 TB is negligible; reusing 1 byte is fatal).
3. **Active-Cheater Detection for `ShamirQuorum`:**
   * *v1 Bug:* `reconstruct_secret()` blindly used `shares[:threshold_t]` and discarded extra shares; a single corrupted share silently yielded garbage bytes.
   * *v2 Fix:* When `len(shares) > threshold_t`, interpolate from the first $t$ shares **and verify every remaining share** evaluates identically on the reconstructed degree-$(t-1)$ polynomial — raising `QuorumCorruptionError` on any inconsistency (Reed–Solomon error detection). For active Byzantine resilience even at exact quorum size $t$, document **Information-Theoretic Verifiable Secret Sharing (Rabin–Ben-Or 1989)** using pairwise Wegman–Carter check vectors.
4. **Honest Non-Repudiation Boundary (Symmetric MAC vs. IT-Signatures):**
   * Explicitly state: Wegman–Carter MAC guarantees **bilateral authenticity** between two endpoints, **not third-party non-repudiation** (since the receiver also holds $(r, s)$ and could forge a message from the sender to an external auditor).
   * If a civic deployment requires third-party legal non-repudiation in *Algorithmica*, the upgrade path is **Unconditionally Secure Signatures (USS)** (Chaum–Roijakkers 1990; Hanaoka–Shikata–Zheng–Imai 2000) using correlated polynomial evaluation keys across a quorum of witness anchors.

---

## 3. Algorithm Note 3 — Shield 2: Physical-Layer Capacitive Tamper Cell (`obb_coupled_tile_sim` — Exploratory)

### 3.1 Honest Model Boundary
`obb_coupled_tile_sim.py` is a **Lumped-Element Capacitive/Inductive Model (Pre-Silicon / Pre-PCB Simulation)** — **not** a 3D electromagnetic field solver or tapeout-verified silicon PUF.
* **Mechanism (Roanoke hardware collaborator):** 8 outer perimeter conductors capacitively couple (`νMOS` floating-gate voltage divider) to a central sensing node; an invasive microprobe ($\Delta C_{\text{probe}}$) or passivation decapsulation ($\Delta \varepsilon_r$) shifts the capacitive divider ratio:
$$V_{\text{cap}} \;=\; \frac{C_{\text{active}}}{C_{\text{active}} + C_{\text{inactive}} + C_{\text{gnd}} + \Delta C_{\text{probe}}} V_{DD}$$
* **Energy-Conservation Sanity Check:** Step-driven RC charge transfer strictly satisfies $E_{\text{center}} / E_{\text{driver}} < 0.50$.

### 3.2 Two Essential Physics & Entropy Corrections (v2)
1. **True Min-Entropy of Pairwise Comparisons = $\le 9.17\text{ bits/tile}$ (Not 12 Bits):**
   * Comparing 4 cardinal edges pairwise produces $\binom{4}{2} = 6$ bits, **but** transitivity restricts valid outputs to $4! = 24$ total orderings ($\log_2 24 \approx 4.585\text{ bits}$). The same holds for the 4 corners ($\approx 4.585\text{ bits}$).
   * Therefore one `3×3` tile yields **at most $\log_2(24^2) \approx 9.17\text{ bits}$ of pairwise-order entropy** (576 valid rankings — NOT 4,096).
   * *v2 Design Rule:* Treat `3×3` explicitly as a **unit cell**; a hardware root requires tiling an array of **$M \ge 16$ independent unit cells** ($\sim 146\text{ bits}$ raw ordering entropy) coupled with fuzzy-extractor helper data / BCH syndrome coding.
2. **Realistic Noise & Environmental Drift Budget (Beyond `kT/C` Thermal Floor):**
   * v1 derived a `10σ = 0.800 mV` tamper tolerance solely from $v_{\text{rms}} = \sqrt{k_B T / C_{\text{tot}}}$ averaged over 64 samples.
   * In physical hardware, four effects dominate `kT/C` by **10–50×**:
     1. **28nm CMOS comparator offset mismatch** ($\sim 5\text{--}20\text{ mV}$ pre-trim),
     2. **Floating-node reset switch charge injection, clock feedthrough, and subthreshold/gate leakage** (the divider formula requires discharging the center node between cycles),
     3. **$V_{DD}$ supply ripple and $1/f$ flicker noise**, and
     4. **FR-4 PCB temperature & humidity $\varepsilon_r$ drift** ($2\text{--}5\%+$ ambient shift, far above `0.8 mV`).
   * *v2 Architectural Recommendation:* Move from an **absolute mV enrollment threshold** to **ratiometric differential sensing** (comparing an exposed surface-layer tamper tile against an adjacent buried/shielded reference tile on the same substrate), which cancels common-mode $V_{DD}$, temperature, and ambient humidity drift to first order!

### 3.3 Open Hardware Questions for Eran Tromer (CIRG) & Lab Validation
1. On a low-cost FR-4 PCB test coupon (4-layer board with buried reference tile vs. top-layer guard tile), what minimum invasive probe $\Delta C_{\text{probe}}$ remains reliably separable above seasonal humidity/temperature $\varepsilon_r$ drift under ratiometric differential readout?
2. For an invasive attacker using a low-capacitance active FET probe ($< 50\text{ fF}$) or focused-ion-beam (FIB) backside thinning on silicon, does a floating-node reset-and-sample capacitive mesh offer meaningful detection advantage over standard active serpentine tamper meshes?
3. What minimal fuzzy-extractor / helper-data scheme best handles bit-flips near equal-capacitance edge pairs without leaking PUF entropy?

---

## 4. Algorithm Note 4 — Layer 0 (Belnap Epistemic Firewall) & Real NIIS X-Road Sidecar

### 4.1 Belnap Four-Valued Lattice ($B_4$) & Source Clamping
Following Belnap (1977) and Fitting (1991), every claim carries an epistemic truth state in $\mathcal{P}(\{T, F\})$:
* `UNKNOWN` ($\emptyset / 0$): staged, unconfirmed, or LLM-synthesized draft.
* `VERIFIED` ($\{T\} / +1$): human-attested or deterministic measurement committed to verified state.
* `FALSIFIED` ($\{F\} / -1$): failed conservation/accounting invariant or Node 0 PII violation.
* `CONTRADICTORY` ($\{T, F\} / \top$): conflicting verified observations on the same subject.

**Invariants:**
1. **Belnap Knowledge Join ($\vee_k = \cup$):** Merging two observations takes their set union in $\mathcal{P}(\{T, F\})$. A conflicting read on an already-verified subject transitions deterministically to $\top$ (`quarantined_conflicts`) rather than silently overwriting last-write-wins.
2. **LLM Source Clamp:** Any claim with `source_kind == LLM_SYNTHESIS` attempting `proposed_truth == VERIFIED` is deterministically clamped to `UNKNOWN` (`staged_unconfirmed`) with an audit flag; only `HUMAN_ATTESTED` or `DETERMINISTIC_MEASUREMENT` can promote a claim to `VERIFIED`.
3. **Node 0 Zero-PII Floor:** Deterministic rejection of forbidden PII fields/patterns (SSN, phone, raw email, street address, HMIS client IDs) before any state commit or inter-organization wire egress.

### 4.2 Retiring the v1 Symmetric-HMAC X-Road Mock → Real NIIS X-Road REST Sidecar
* **Critical v1 Bug:** In `obb_xroad_bridge.py` v1, `HsmSigningToken` used **symmetric `HMAC-SHA256`** and copied every member's secret `_key_bytes` directly into `XRoadCentralDirectory._verifiers`. That **breaks X-Road's defining security guarantee (non-repudiation)**: the Central Directory or any verifier could forge legally binding messages on behalf of any member.
* **v2 Architecture (Two Clean Layers for NIIS):**
  1. **Production Integration — `X-Road Epistemic Sidecar`:** Do **not** rewrite NIIS's MIT-licensed Security Server (`PKCS#11` HSM, `X.509`/`mTLS`, `ASiC-E` signed containers, `RFC-3161` TSA). Instead, run Layer 0 as a **zero-dependency HTTP REST policy proxy** directly in front of an authentic NIIS Security Server:
     * Inspects/preserves genuine NIIS headers (`X-Road-Client`, `X-Road-Service`, `X-Road-Id`, `X-Road-UserId`).
     * Enforces Zero-PII + Belnap $B_4$ + LLM Source Clamp on AI-generated payloads *before* the Security Server signs and timestamps them — because X-Road proves *who* sent a message, not whether an AI agent hallucinated `confirmed=1` or leaked resident PII inside a validly signed REST call.
     * Tags staged drafts explicitly (`X-Sweetbrier-Epistemic: UNKNOWN`) vs. verified commits (`VERIFIED`) and maintains local 1-Click atomic rollback snapshots.
  2. **Exploratory Research Track — Algorithmica Dark-Fiber Profile:** Present Shield 3 (OTP + Wegman–Carter over municipal dark fiber like RVBA) as an **optional extreme-resilience transport tier** orthogonal to NIIS’s standard PQC migration (`ML-KEM` / `ML-DSA`), explicitly acknowledging the symmetric-MAC vs. IT-signature non-repudiation tradeoff.
