THEPROTOCOL

ENCLAVE

#27 of 27Frontier · a future case10/11 primitives live in production
Data Clean Rooms and Data Marketplaces

Data owners sell answers instead of copies: each question paid once, run inside the owner’s walls, signed on the way out and kept on the ledger.

Open the live chamber in the app
The animated flow, the attack replays and the deep architecture run there; this page is the reference text.

Who this serves

The problem

Data sharing still runs on copies. To answer a researcher’s question, an owner ships an extract under a sharing agreement, and from then on nobody can show who asked what, what each answer was worth, or where the file went next; ending the agreement means asking every recipient to delete, and taking their word for it. Clean rooms keep the rows inside, but the licence, the budget and the record of questions still live in contracts and invoices beside them, reconciled by hand.

The system

ENCLAVE is a market for questions. Three data owners run their own frames: the Lindhaven transit authority with four years of door-sensor passenger counts from 1,140 buses and trams, a consortium of 212 retail stores with footfall, and a regional logistics firm with delivery timings. Each exposes query services that run inside its own enclave, one service per approved template, each with its own identity and price, and only aggregates ever leave. At 09:40 on a Wednesday, study-desk, the agent of Dr Nadia Halvorsen’s mobility institute, buys a batch of 120 aggregate queries against the transit counts at 15 units a query: boardings by stop and hour on nine corridors. Every query rides its own single-use payment token; query-LHV-2 verifies it, runs the question against 2.3 billion rows it never lets out, and signs the aggregate it returns. Each token settles exactly once, and every unit it moves is conserved and independently audited.

The desk is a licence seat on the authority’s own frame, and its grant is the authority’s to set and to reduce. It works through a capability token cut from that grant: the three templates the licence names and 18,000 units of query budget, debited atomically. Each template is its own service, so the templates the token may run are the only counterparties it may pay. For the partner lab that builds the corridor model, the desk derives a narrower token: one template, 2,400 units, an earlier expiry. A capability token can only narrow, and whatever the desk issues conveys no more than its grant allows at the moment of use. When the partner reaches for a template the licence never named, the ask is refused before a unit moves.

Every question lands on the append-only ledger beside its price and the signature over its answer, so an audit is a query, not an investigation. The authority lists every question a licence ever asked in one read; the institute shows a reviewer which signed aggregate stands behind each figure in its paper. An answer that query-LHV-2 did not sign never reaches the ledger, and a question nobody paid for is never answered.

The cast and their ceilings

AgentRoleCeiling
study-deskThe institute’s licence seat: buys the batch, derives partner tokensIts grant is the authority’s to set and to reduce. Every token it cuts conveys no more than that grant allows at the moment of use.
partner-labRuns one template for the corridor modelHolds nothing of its own: a token derived from the desk’s, one template, 2,400 units. Cannot widen any of them.
query-LHV-2Answers one template inside the enclave, signs every aggregateCollects per query and signs what it returns. Holds no budget and grants nothing.
data steward (human)Sets and reduces the grant behind each licence seatActs on grants, not on queries. Reducing one empties every token the seat issued, on the next request.

The flow, step by step

  1. The authority’s data steward sets the grant behind the institute’s licence seat, and holds the right to reduce it.
  2. 09:40. study-desk asks for 120 aggregate queries under its token: three templates, 18,000 units of budget.
  3. For the partner lab it derives a narrower token: one template, 2,400 units. It cannot derive a wider one.
  4. Each query gets its own single-use payment token, 15 units, checked against the templates and the budget first.
  5. Inside the enclave the question meets 2.3 billion rows. The rows stay; only the aggregate comes out.
  6. query-LHV-2 signs the aggregate it returns, and the payment token settles exactly once.
  7. Question, price and signature land on the ledger, append-only.
  8. An audit is a query, not an investigation: every question the licence ever asked, in one read.

Each need, mapped to a live primitive

The needThe protocol primitiveStatus
Each question paid onceA2A payment authorization: one single-use apt_ token per query, exactly-once settlementLIVE
Templates and budget as boundsIRONKEY L4 capability caveats: counterparty allowlist, atomic budget debitLIVE
A partner gets less, never moreDerived capability tokens: a subset of the parent on templates, budget and expiryLIVE
A reduced grant, with no chaseIssuer clamp: reducing an issuer empties every token it issuedLIVE
One identity per query serviceSPIFFE identity per workload and agent, short-lived certificatesLIVE
Answers signed on the way outSigned attestations from identified parties, append-onlyLIVE
Retries that never pay twiceIdempotency keys, two-layer dedup (cache + ledger unique)LIVE
An audit that is a queryImmutable event ledger, replayable, forensically searchableLIVE
Seats funded from homeCross-registry transfer and FX pools across sovereign framesLIVE
Every unit accounted forDelta = 0 supply invariant, independently auditedLIVE
Proof a cell met its minimum group sizeZK attestation over a new circuit, not yet writtenDESIGNED

The attack this chamber refuses: The template nobody licensed

The attack. The partner asks for finer data, and the desk derives it a copy of its authority with a fourth template added: stop-to-stop flows in 15-minute windows, which the licence never named.

Why it fails. A derived token is checked against the token it comes from at the moment it is cut: templates a subset, budget no larger than what remains, expiry no later. The fourth template is not in the parent, so the derivation fails there, and a payment to any template a token does not name is refused at the gate before a payment token exists. A token can narrow what its issuer holds; it cannot add a template.

Rail S03 · Capability attenuation. A capability token conveys its caveats intersected with the issuer’s current authority, nothing more.

What actually happens. No wider token exists, no payment token is issued, and no question reaches the enclave. There is nothing to unwind.

The attack this chamber refuses: The grant reduced mid-study

The attack. Six weeks in, the authority and the institute dispute whether a published chart stayed inside the licence. The steward reduces the desk’s grant while the dispute is resolved. The partner lab, which nobody told, sends its next query.

Why it fails. The partner’s token was cut by the desk, and a capability token conveys its caveats intersected with its issuer’s authority as that authority stands at the moment of each request. The desk no longer holds the authority to buy, so every token it ever issued conveys none from the next request on. Nobody hunts for the partner’s token, and no revocation list is published or consulted.

Rail S04 · Issuer clamp. Reducing an issuer’s authority instantly empties every token it ever issued.

What actually happens. The partner’s query is refused at the gate before a payment token exists. Every question answered before the dispute stays on the ledger, and nothing needs to be unwound.

Deep architecture

ENCLAVE deployed: the transit authority’s frame holds the licence seats, the grants behind them, the query payments and the question ledger; the institute funds its seat from its own frame, in its own currency; the passenger counts sit below in the enclave, read only by the query agent that runs beside them, and only aggregates come up. The trace replays the 09:40 batch, from the grant to the question ledger.

The deployment, traced

  1. The authority’s data steward sets the grant behind the institute’s licence seat, and keeps the right to reduce it.
  2. At home, Dr Halvorsen sets the study’s query budget on the institute’s own frame.
  3. The study treasury funds the seat in the institute’s own currency.
  4. It converts through the FX pool between the two frames.
  5. And lands on the seat, on the authority’s frame, exactly once.
  6. 09:40. The desk asks for 120 aggregate queries under its token: three templates, 18,000 units of budget.
  7. For the partner lab it derives a narrower token: one template, 2,400 units. A capability token can only narrow.
  8. Each query gets its own single-use payment token, 15 units, once its template and the budget are checked.
  9. The paid question goes down to query-LHV-2, inside the enclave.
  10. It meets 2.3 billion rows that never leave. Cells under twenty boardings are suppressed, by the authority’s own rule.
  11. The query agent signs the aggregate it returns, and the payment settles exactly once.
  12. Question, price and signature land on the ledger, append-only. An audit is a query, not an investigation.

Adoption, phase by phase

Discover: One sharing agreement, re-read as templates.

Pilot: One template, one licensee, pilot prices.

Production: The authority’s own frame; extracts retired.

Federation: Owners bring their own frames.

Sizing

LevelWhatContainers
L1Researchers and analysts join with accounts and agents on a hosted registry0 of theirs
L2An owner runs its query agents against a hosted seatagents only
L3Each owner on its own frame, buyers’ frames federateda full frame each

One question, payment token to signed answer

sequenceDiagram
  participant Desk as study-desk (licence seat)
  participant Gate as licence gate
  participant Pay as query payments
  participant Q as query-LHV-2 (enclave)
  participant ES as question ledger
  Desk->>Gate: query 37 of 120, under the study token
  Gate->>Pay: template and budget checked: single-use token, 15 units
  Desk->>Q: the question and the payment token
  Q->>Pay: verify the token
  Q-->>Desk: aggregate, signed
  Q->>ES: attestation: the question and a signature over the answer
  Desk->>Pay: settle on delivery
  Pay-->>Q: paid, exactly once
  Pay-->>ES: payment settled, append-only
  Note over Gate: a template the token does not name is refused before any payment token exists
  Note over ES: an audit is a query, not an investigation

Topology, as declared

flowchart LR
  ST(["data steward<br/>the grant"]) -->|"grant, reducible"| G{"licence gate<br/>templates, budget,<br/>issuer authority"}
  D["study-desk<br/>licence seat"] -->|"120 queries"| G
  D -.->|"narrower token"| PL["partner-lab<br/>one template"]
  G -->|"single-use token"| P["query payment<br/>exactly once"]
  E[("transit enclave<br/>rows stay inside")] -.->|"aggregates only"| Q["query-LHV-2"]
  Q -->|"answer, signed"| P
  P --> L[("question ledger<br/>asked, priced, signed")]
  L -->|"an audit is a query"| R["reviewer"]

Standing it up

Runs beside what you already have

A full sovereign frame is nine containers and boots in about two minutes, on anything from a Raspberry Pi to a rack. That is cheap enough to run the whole system in parallel with the legacy stack: the old system keeps running, real work mirrors onto the rails, and you compare ledgers until the evidence settles the argument. Nothing is ripped out.

Planned: a public proxy library. Free, ready-made connectors for the systems above and whatever else a merge needs, so the bridge is an import, not an integration project.

What this does not claim