kton
worked examples

Record how data was made, and who vouched for it, so anyone can check.

kton turns each step of an analysis, and each statement about it, into a small, signed, content-addressed record. From those records you get lineage, reproduction, and review that a reader can verify themselves, with no central server and no need to trust whoever produced them.

What problem it solves

When results move between people, scripts, and tools, you lose track of where a file came from, whether it can be reproduced, and who reviewed or approved it. A shared database "solves" this only if everyone trusts that one system. kton takes the opposite route: every step becomes a portable record, identified by the hash of its content, signed by whoever made it, and copyable between tools. Independent people and programs converge on one lineage graph that each of them can re-check by re-hashing and re-running. Think of it as git for data provenance and sign-offs, across tools.

The three names, concretely

So what is a "record"?

Two kinds, both are just a small signed file identified by the hash of its content:

One term you will meet in every example: a registry is just a directory. A registry is the store where plankton files its records; you point at it with PLANKTON_DIR=<dir> (and NEKTON_DIR for the nekton claim store the same way), and a different folder is a different, independent registry. Registries federate by being read together: point a query at several with --source and they converge on one lineage by content hash, with nothing copied and no shared folder (plankton mirror then copies records into one store only as an optimization, for offline or single-store reads). (A registry is a store, not an execution environment like a container or an OS, that is a separate thing plankton can record on its own.)

The examples

Each one both creates records and uses them, and renders the resulting graph in the viewer. Start at 01.

01

Hello foton

The smallest create + use: record one computation as a signed foton, then show it, verify its signature, and ask "who produced this file?" by output hash.

02

Federation

Two independent registries that never share a folder converge on one lineage by content hash - read together with --source, nothing copied. mirror comes last, as an optimization. A stranger who knows neither party gets the same graph.

03

Reproduce

Record a computation, re-derive its output, and prove it matches: identical bytes give L0 reproduction; a tampered re-run gives none.

04

Claim (nekton)

plankton records a reproducible foton; nekton records a signed opinion about it. The claim's subject is the foton's id, so the two layers join by hash.

05

Review as its own sub-nekton

A review is its own registry, seeded from a public parent and handed over whole. It carries its enrolled reviewers in its own signed chain, so completeness is mechanical: a reviewer who rejects - or one who is enrolled but never delivers - blocks release. You cannot strip a reject to get a clean review; you get an incomplete one, fail-closed. The verdict is a reproducible plankton foton over the review.

06

Export as RDF

The plankton lineage and the nekton claims export to RDF that merges at the same hash IRIs, so a reasoner sees provenance and attestation as one graph.

07

Identity

A key is an identity: give a model its own key and trace which claims came from which model. Then bind a key to a named principal with a separate signed claim, verifiable, not just asserted.

08

Sign with your GitHub identity (Sigstore)

The strongest identity tier - authority-backed, defined in example 07 - made real: sign a kton record with your GitHub identity via Sigstore keyless (Fulcio certificate + Rekor transparency log), verifiable with no long-lived key and no trust in you. Hands-on and interactive, so no live graph.

09

Environment: from "I ran it" to a qualified stack

The whole arc: run locally, pin the exact docker image (carried, opaque), then define a spectrum - the test suite of an R package at exact versions, one foton per test - and verify the image reproduces every test. COVERED qualification vs CARRIED digest, made concrete.

10

Tool spectrum: run it, see what reproduces

A spectrum defines a tool by its reference outputs. This one really runs an R package's test suite twice, in two environments, and the graph shows per test whether the runs are byte-identical (an L0 edge) or agree only after a normalizer strips a volatile line (an L1 edge), then binds the environment to the spectrum with qualifies-as. Nothing fabricated.

11

Review template + SPARQL completeness

The classical way to author a claim: a template. Three reviewers each approve a foton (approve/reject reusing schema.org, a comment as a file), nothing overwritten. The template is registered as a federated record, and a SPARQL query over the exported RDF tests that the review is complete - every required reviewer approved, no rejects. It is first-class when that check runs as a foton: the nekton (the signed reviews) in, the verdict out, recorded in the graph.

12

Capstone: a regulated popPK submission, zero trust

Everything at once. A CRO builds a popPK model, a sponsor reviews and submits it, and the agency re-verifies the whole thing - reproduction, a qualified environment, a signed model tree, typed sign-offs with evidence - across three registries with no shared server. It ends with a single SPARQL release gate that decides whether the submission may be accepted - which the agency records as a verdict-foton (its inputs the exact evidence, its output the decision). Real R throughout.

13

Verified by a tool that isn't kton

A kton record is an in-toto Statement in a DSSE envelope - the language of SLSA, sigstore, and in-toto - so any DSSE-aware tool reads it. Here a twenty-line verifier using only standard crypto (no kton code) checks a foton's signature and rejects a tampered one. "Verify it yourself" means with any tool, not only ours.

14

Fetch: getting the bytes back

plankton stores no bytes, only hashes - so "verify by re-hashing" needs the bytes from somewhere. A signed dcat:downloadURL says where; kton fetch dereferences it and checks sha256 == hash before trusting a byte. A forged mirror is rejected on arrival: the hash is the authority, the URI only a hint.

15

Evidence from outside kton

Records arrive carrying proof in vocabularies kton does not speak: a Sigstore bundle, a Rekor entry, an RFC 3161 timestamp, an eIDAS signature. attach binds that evidence to a record's content address and material hands it back — and the kernel never says whether it is any good, because which issuers count is your trust policy, not a fact about bytes. A verifier that is not kton does that half. Watch the id: an outside attestation commits to the envelope payload, and a foton id is not its payload hash.

16

Has this been computed already?

The action key covers inputs and protocol — and deliberately not the output, which is the thing you were going to compute. So a cache HIT means “somebody asked the same question”, never “here is the answer”: two signers can hit one key and disagree about the result. plankton reuse says so on every hit, and refuses a foton whose protocol ref contradicts its own descriptor.

17

↻N — and how to inflate it

How many independent signers produced this exact output? Two honest labs converge on one foton carrying two signatures — agreement is a co-signature, not a second document. Then an attacker relabels a keyid she does not hold, three times, and ↻4 appears out of nothing. Nothing is detected and nothing is blocked; --trust-keys simply asks the other question, and it collapses back to ↻2.

Red team — adversarial engagement (its own repo)

The hardest test of “trust no one”: an adversarial security engagement against kton, documented in kton itself — each attack is a foton, each finding a signed claim, and the regression suite a spectrum. Two dozen attacks (co-signature drop, normalizer forge, federation withholding, four-eyes graph-poll, viewer XSS …) with the fixes that closed them.

Lensed papers

A paper read through its records. The figures are the same images the analysis wrote; the lens looks each one up by output hash and shows what produced it, who signed it, and whether anyone else got the same bytes. Nothing in the text is taken on trust.

Bill length and bill depth in Pygoscelis

A field-station write-up on the Palmer penguins, with four registries behind it: the station that measured, the ethics review that re-derived the anonymisation, an independent reviewer who re-ran a figure, and the reader who reads all four together.

Multi-foton output

The smaller case, and the more awkward one: one figure that two parties produced independently. The lens shows both producers on the same image instead of picking one.

What kton does not guarantee

The point of a substrate that says "trust no one" is that it is honest about the few things it cannot settle with a hash, a signature, or a chain. What they can settle - lineage, reproduction, who signed what, that a sealed chain was not silently edited or a committed link dropped - is mechanical. What they cannot is named here, surfaced rather than hidden:

The full argument - honesty, completeness, freshness, finality, and graded verification, each with its boundary - is in the protocol's Trust chapter.