Grantstamp attestation protocol#

Version 1 (draft for Grantstamp 0.3). Licensed CC BY 4.0.

This document says what an owner attests when they register a stamp, what evidence each kind of attestation gives, and how an agent reproduces it. It complements the protocol specification, which defines the wire format.

1. Who attests, and who answers for it#

The owner produces every attestation on their own machine, with their own tools. The registry does not receive the content, does not run any model, and does not judge whether a claim is true.

It checks that the attestation is well formed, that it was signed by the owner's key, that the owner is accountable (an identity on record and a public contact), and that it does not conflict with an earlier stamp. Then it publishes it.

The owner answers for the claim. A person who relies on a stamp answers for how they use it.

2. What is attested: three kinds of evidence#

A stamp can carry any mix of the three. The registry reports which kind produced a match.

Kind What the owner attests Exact or generic Survives
Exact "This exact file is mine": the SHA-256 of each file exact for this content nothing. Any change breaks it.
Generic "Content resembling this is mine": features from the built-in layers (chunks, strings, symbols, code k-grams, image hash) generic for all content patching, recompiling, re-encoding, embedding
Procedural "What my procedure extracts from this content is mine": features from a recipe the owner chose or wrote exact for the parts the owner names, generic for the rest whatever the owner's procedure ignores

Exact evidence cannot be wrong and cannot be stretched. Generic evidence is the protocol's own method and the fallback for owners who define nothing. Procedural evidence lets an owner say what identifies their content in their own terms: the spoken lines of a script, the rows of a dataset, the sentences of a book.

3. Procedural evidence: recipes#

A recipe is the owner's written procedure for turning a file into a set of items. Each item is hashed to one 64-bit feature.

Four standard recipes ship with the protocol: lines, sentences, word-shingles and json-pairs. An owner uses them as they are, or copies one and changes it.

How an owner writes one#

grantstamp recipe list                      # the standard procedures
grantstamp recipe show lines > mine.json    # start from one
grantstamp recipe test mine.json FILE       # see exactly which items it would fingerprint
grantstamp register FOLDER --title "..." --recipe mine.json

An owner may use any tool to draft a recipe, including a language model of their own choosing. The model never sees the registry and the registry never sees the model: the model only helps write a JSON file, grantstamp recipe test shows what that file extracts, and the owner decides whether that is what identifies their work.

A useful request to a model is: "Here is a sample of my content and the list of allowed steps. Write a recipe whose items are the parts that would still be present if someone reformatted, excerpted or converted this content, and explain each step."

How an agent reproduces it#

Before checking a file, an agent fetches GET /v1/recipes (the recipes used by live stamps, most used first, cached for an hour), validates each one itself, runs those whose applies rule covers the file, and sends the resulting features with the rest of the fingerprint.

The reference client, the MCP server and the hook do this automatically. An agent that skips this step still gets exact and generic matches.

4. Publisher signatures#

A signed Windows executable carries the code-signing certificate of its publisher, issued by a certificate authority that vetted the organisation. The protocol draws two separate facts from such certificates and keeps them apart.

Who published a file. When an owner registers, the client attaches the signature of each signed executable. The registry verifies it itself (the signature, the certificate chain up to a root that Microsoft trusts, and that the certificate is for code signing) and records the publisher's name with the file. A client cannot invent a publisher.

The stamp page shows "Files signed by", and warns when that publisher is not a name the stamp's owner is accountable under. Anyone who holds a file holds its signature, so this fact says nothing about the person who registered it.

At check time the agent's client reads the signature of the file in front of it. If the file is signed by a publisher who is not the owner of the matching stamp, the answer says so.

Who holds the signing key. An owner can prove they are the publisher:

grantstamp owner publisher                       # writes a challenge, valid for 24 hours
# sign the challenge with the code-signing certificate, text included
grantstamp owner publisher --signed grantstamp-challenge.txt.p7

The registry accepts the signature only if the certificate is valid today, chains to a trusted root, is a code-signing certificate, and the signed text is the challenge issued to that owner.

It then records the identity level publisher: the organisation named in the certificate and the authority that issued it. This is the strongest identity level, and the only one that identifies an organisation.

Revocation. The registry reads the issuing authority's certificate revocation list, and accepts it only if the authority signed it and it is still current. A revoked certificate cannot be used to become a publisher.

A file signed with a certificate that was later revoked still names its publisher, and the stamp page says the certificate has since been revoked. If the list cannot be fetched, the result is recorded as not checked. It is never assumed good.

Not checked in this version: signed timestamps. A file's certificate chain is judged at a time when its certificate was valid, so files signed years ago still read. Only Windows PE signatures are read. The design leaves room for other signature formats (macOS, Android, package signing): each would add a reader that produces the same two facts.

5. What the registry reports#

For every match the registry returns the band (exact, high, medium, low), the kind of evidence behind it and, for procedural evidence, the digest of the recipe that matched. An agent can fetch that recipe at GET /v1/recipes/{digest} and tell the user what the owner says it captures.

6. Limits of this version#

Source of this page on GitHub. Documentation for Grantstamp 0.4, licensed CC BY 4.0.