A sovereign trust-rail kernel · by Kar

QuorumVeil

The safety envelope around a private sum. Many parties want a combined total without anyone seeing anyone else's number. QuorumVeil is the part that cannot be allowed to leak: it structurally refuses to combine fewer than a quorum of shares, and refuses any share not tagged as masked. Those two refusals are proven by a mutation gate — not promised in a comment. (What the tag does and does not guarantee is in the honest limits.)

witness mutation gate · 27/27 killed unit tests + parity on every push pure kernel · every refusal is data, not prose bundled masking is a demo, not crypto — read the limits
What it is Honest limits Start here Try it How it works Blueprint For buyers Cost case Adoption White paper

What it is, in plain words

Suppose several hospitals want the total number of cases across all of them, but none will hand its own count to the others. Or a group of companies wants an industry salary average without any firm revealing its payroll. Or federated phones want to sum a model update without any one phone's update being readable. The shape is always the same: combine many private vectors into one aggregate, and reveal only the aggregate.

The dangerous moments in that flow are two. First, the aggregate might be computed from too few contributors — a sum of one or two people is barely private at all, so there must be a floor. Second, a raw, un-masked vector might slip into the pile — and a single raw vector is the whole attack: it is the private data. Glue code gets both of these wrong constantly.

QuorumVeil is the envelope that enforces both. Each contributor's vector is combined with a pairwise-cancelling mask — for every pair of contributors, one gets +r and the other −r, so across everyone the masks sum to exactly zero and vanish from the total, while each masked share on its own is offset. The unveil step then enforces the two refusals: it rejects any share not tagged as masked, and it refuses to produce a sum at all below a quorum of 3 live shares (counting shares, not verified-distinct contributors — see limits). Every refusal comes back as structured data, never a warning string you could forget to check. The code a mutation gate proves is the code running under your clicks.

Honest limits — read this before you trust it

The masking and the noise in this kernel are a deterministic demonstration, not cryptography. The mask values are drawn from a tiny linear congruential generator modulo 101, seeded by the caller. That is there so the mutation gate can run the exact same numbers every time — reproducibility for the proof — and it is the opposite of what a real deployment needs. Anyone who knows the seed can recompute the masks, and the mask range is small. Do not use the bundled generator to protect real secrets.

What is real, and what this product is. Two things here are genuine, provable, and the point:

  • The cancellation is exact arithmetic. Pairwise masks sum to zero by construction, so the aggregate is the true sum (plus whatever noise you add) — not an approximation. The live demo shows the masked shares scrambled and the recovered sum landing exactly on the true total.
  • The two safety invariants are enforced and gated. "Never unveil below the quorum count" and "never combine a share the caller did not tag as masked" are properties of the code, proven by a 27/27 mutation gate. These are the glue-code mistakes that leak data.

Two honest bounds on exactly what those invariants check. (1) The no-raw-release gate tests that each share is tagged masked:true — it trusts your pipeline actually ran maskShare; it cannot tell a genuinely-masked vector from a raw one a caller mislabels. (An honest pipeline masks; a lying caller is an upstream trust problem this gate does not catch — and note the demo generator produces an all-zero mask at the LCG fixed-point seed 92, which would leave that share effectively unmasked.) (2) The quorum counts shares — array entries — not verified-distinct contributors: three shares from one party clear a quorum of three. De-duplicating and authenticating contributors is the caller's job, upstream.

So the honest sale is this: QuorumVeil is the provable policy envelope you wrap around a production secure-aggregation or MPC library. Swap the toy generator for your field-size cryptographic masks and your calibrated differential-privacy noise; keep the quorum floor and the masked-tag gate, the parts that are easy to get wrong and proven correct here — and add your own contributor authentication and real masking upstream. It is the referee, not the vault.

Start here — how to use it

On this page (no install)

  1. Scroll to Try it.
  2. Give each contributor a short vector of numbers (their private data).
  3. Watch the masked shares come out scrambled, and the unveiled sum land exactly on the true total — the masks cancelled.
  4. Try the presets: drop below 3 contributors, or slip a raw share in, and watch the unveil refuse.

In your own system

import { makeMasks, maskShare, unveil } from './kernel.mjs';

const vecs = [[10,2],[7,5],[3,9]];           // 3 private vectors
const { masks } = makeMasks(vecs.length, 2, 42);
const shares = vecs.map((v,i)=> maskShare(v, masks[i]).share);

const r = unveil(shares, 7, 0);              // seed, noiseScale
// r.ok === true, r.sum deep-equals [20,16] (the true column sums)
// unveil(shares.slice(0,2), 7, 0).why === 'below-quorum'

One file, zero dependencies. The invariants travel with the code. Replace the masking/noise internals with production crypto; keep the gate.

Try it — the live kernel

This panel calls the exact makeMasks, maskShare and unveil functions the witness gate proves. Nothing is sent anywhere. Each contributor's vector is two whole numbers.

Presets: 3 contributors · unveils exactly with DP-style noise below quorum · refused raw share slipped in · refused
—

What left each contributor (masked shares)

—

The unveiled aggregate

true column sums (for comparison)—
unveiled sum—
live contributors vs quorum—

What the kernel returned

—

—

How it works — traced from a real run

Take the 3 contributors preset: vectors [10,2], [7,5], [3,9], seed 42, noise 0. The true column sums are [20,16]. Here is what the kernel does — the masked shares below are the actual numbers from the live run.

1 · private vectors A = [10, 2] B = [ 7, 5] C = [ 3, 9] 2 · pairwise masks (sum to 0) +mA +mB +mC mA + mB + mC = [0,0] each pair: +r to one, −r to other 3 · masked shares leave scrambled, per contributor none reveals its vector a raw share here → REFUSED 4 · quorum live = 3 3 ≥ 3 ✓ below 3 → REFUSED sum of masked shares = sum of raw vectors → sum: [20, 16] — masks cancelled, exact the two refusals it pins • a share not tagged masked → {ok:false, why:'unmasked-share'} (no sum computed) • fewer than 3 live → why:'below-quorum'

The mutation gate attacks exactly these edges: it flips the < QUORUM guard, deletes the masked !== true check, breaks the pair loop so masks stop cancelling — and each of the 27 rewrites is caught by a test. "27/27 killed" means no mutant among the 27 the tool tried survives — a hard bar on the tests, not a proof the invariants are complete (see the limits for what they do and don't check).

The blueprint — organ by organ

OrganFileWhat it does
The kernelkernel.mjsThree pure functions: makeMasks (pairwise-cancelling masks), maskShare (tag + offset a vector), unveil (refuse raw, refuse below quorum, sum, add noise). No I/O. Every refusal is structured data.
The contractkernel.test.mjsTests pinning: masks sum to zero, the recovered sum equals the true sum, below-quorum is refused, a raw share is refused, congruent seeds are deterministic.
The gatewitness.mjsMutates the kernel 27 ways and demands every mutant die under the tests. A survivor means a blind spot in the proof. Re-run on every push.
The proof.github/workflows/gate.ymlCI re-runs tests + gate on GitHub's own runner. Green there proves the gated code is the code shipped and that the tests kill the 27 mutations tried — not that every claim on this page holds.
This pageindex.htmlInlines the kernel byte-for-byte, so the logic you audit in CI is the logic running under your clicks. A parity test fails CI if the two drift.

The masking generator (an LCG mod 101) is deliberately replaceable. It exists so the gate re-runs identical numbers. The invariants — quorum floor, no-raw-release, refuse-as-data — are the asset, and they do not depend on the generator you plug in.

For buyers — what QuorumVeil does for your programme

If you are building private aggregation — federated analytics, a cross-organisation benchmark, a privacy-preserving survey — the cryptography is the part you buy or audit carefully. The part that quietly leaks is the envelope: the code deciding how few contributors is too few, and making sure a raw value never reaches the sum. QuorumVeil is that envelope, proven.

For the Head of Privacy / DPO

A minimum-contributor floor and a no-raw-release rule are exactly the controls a privacy impact assessment asks for. Here they are properties of the code a mutation gate proves, not clauses in a runbook someone has to remember. The honest limits are stated on the tin.

For the CISO / Security

The two highest-risk glue-code failure modes — too-small cohorts and combining an untagged (raw) share — are gated and re-proven in public CI. The gate checks the quorum count and the masked tag; real masking, differential-privacy calibration and contributor authentication are yours to supply upstream (see the limits). The kernel is a short pure function you can read and audit, with no hidden network path.

For the Data / ML lead

Drop the envelope around your real secure-aggregation or MPC library. The cancellation arithmetic is exact, so your aggregate is not degraded; you choose the masking field and the DP budget. Integer-clean and deterministic under test, so your CI is reproducible.

For the Partnerships lead

Cross-company data collaborations stall on "what stops them seeing our raw numbers?". A quorum floor plus a proven no-raw-release gate, self-hostable with nothing sent to a vendor, is a concrete answer you can put in front of a partner's lawyers.

Security & compliance, answered straight

QuestionAnswer
Is the bundled masking cryptographically secure?No — and the page says so loudly. It is a deterministic demo generator for reproducible proofs. Swap in production crypto. What is proven is the quorum floor and the no-raw-release gate.
Where does our data go?Nowhere. The kernel runs in the page. No network call in the whole file — read it, or run it offline.
Can we self-host?One static HTML file and one .mjs. Host on your intranet, or import the kernel into your service. No licence server, no phone-home.
How do we know the invariants hold?Unit tests plus a 27/27 mutation gate, re-run in public CI. The below-quorum and raw-share refusals are each pinned by a test the gate proves is doing its job.
What's the licence?MIT. Authored by Kar for AI Native Solutions; licence holder Simon Gant.

The cost case — computed here, change the inputs

The envelope is not the expensive part to build — it is the expensive part to get wrong. But there is also plain engineering time saved: a proven, self-hosted quorum-and-no-leak gate you drop in, versus writing, reviewing and privacy-signing-off your own. Put your numbers in; the figure is computed live on this page.




Days removed
—
One-off saving
—
Cost of QuorumVeil
£0

Illustrative, one-off rather than per-month: this is glue you build once. The default £520/day loaded rate is a mid-range UK figure for a senior engineer (≈£65k–£85k base, grossed up ~1.3× for employer NI, pension and overhead, over ~220 working days; source: ONS ASHE 2024 median gross pay, programming/software occupations, loaded). The real saving is avoiding the data-breach cost of a gate built wrong — not modelled here because it should never be treated as a line item you can trade away.

Adoption — how you roll it out

1 · Try (today)

Open this page, run a small cohort through Try it, and watch the refusals fire below quorum and on a raw share. No sign-up, nothing installed.

2 · Wrap (a sprint)

Put the envelope around your production secure-aggregation / MPC library. Keep unveil's quorum floor and no-raw-release gate; replace the demo masking and noise with your real crypto and DP budget.

3 · Prove (ongoing)

Keep the witness gate in your own CI. Every change must still kill 27/27, so the two invariants cannot silently regress as your code evolves.

White paper — the short version

The problem. Private aggregation protocols are judged on their cryptography, but they leak in their plumbing: a cohort assembled below a safe minimum, or a single raw contribution that reaches the aggregate. These are policy invariants, usually enforced by hand-written glue that no one proves.

The claim. The two invariants — a minimum quorum of contributors, and never releasing a raw share — should be properties of a small pure function, provable and reproducible. QuorumVeil enforces both in unveil: it rejects any share not tagged masked, refuses to sum below a quorum, and returns every refusal as structured data rather than a warning. The masking arithmetic is pairwise-cancelling, so the aggregate is exact.

Why a mutation gate, not just tests. Passing tests prove the code works on the cases you thought of. A mutation gate proves the tests work: it rewrites the kernel 27 ways — flipping the quorum comparison, deleting the masked-tag check, breaking the pair loop — and demands the tests catch every one. 27/27 killed means the tests catch those 27 rewrites — a hard bar, not a proof the invariants are complete or that every claim here holds.

What it is not — stated plainly. The bundled mask generator and noise are a deterministic demonstration for reproducible proofs, not cryptography: the generator is a tiny LCG mod 101 and the noise is not calibrated differential privacy. Do not protect real secrets with the bundled internals. QuorumVeil is the envelope — the quorum floor and the no-raw-release gate — proven correct, to be wrapped around a production cryptographic aggregation you supply. It is the referee for the policy, not the vault for the secret.

Risks, answered

"Someone uses the demo masking in production."Stated loudly on the page and in the kernel; swap in real crypto, keep the gate.
"Quorum of 3 is too low for us."It is one constant; raise it to your cohort policy and re-run the gate.
"A contributor sends a malformed share."Refused as data — non-finite, dim-mismatch, and untagged all return {ok:false, why}.
"The code could change silently."CI re-runs the gate + parity; a regressed invariant fails 27/27.