Metadata-Version: 2.5
Name: grantstamp
Version: 0.6.2
Summary: Open ownership registry and check protocol for AI agents: owners publish fingerprints and policies, agents check before they touch a file.
Project-URL: Homepage, https://grantstamp.io
Project-URL: Documentation, https://grantstamp.io/docs/
Project-URL: Source, https://github.com/grantstamp/grantstamp
Project-URL: Issues, https://github.com/grantstamp/grantstamp/issues
Author: Grantstamp contributors
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: ai-agents,copyright,fingerprinting,licensing,mcp,ownership,provenance,registry
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Requires-Dist: asn1crypto>=1.5
Requires-Dist: cryptography>=42
Requires-Dist: httpx>=0.27
Requires-Dist: mcp>=1.2
Requires-Dist: mscerts>=2024.1
Requires-Dist: numpy>=1.24
Provides-Extra: all
Requires-Dist: pillow>=10; extra == 'all'
Provides-Extra: dev
Requires-Dist: markdown>=3.5; extra == 'dev'
Requires-Dist: pillow>=10; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: segno>=1.5; extra == 'dev'
Provides-Extra: images
Requires-Dist: pillow>=10; extra == 'images'
Provides-Extra: mcp
Description-Content-Type: text/markdown

# Grantstamp

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.24640292.svg)](https://doi.org/10.5281/zenodo.24640292)

**AI tools ask the owner first.**

AI coding tools can now take a program apart and rebuild it in hours. The people who made it have no way to tell those tools "this is mine, and this is what I allow." So the tools help everyone, or refuse everyone, the owner's own developers included.

Grantstamp™ is an open registry for that moment. Owners publish a signed stamp of their software or game build, never the build itself, with their rules for AI. Before an AI tool decompiles, ports or changes a file, it checks the stamp. It learns who owns the file and what the owner allows, with a receipt the registry signs. The owner gets an alert.

Nobody should be in charge of who owns everything. So the record is public, owners sign their own claims, witnesses cosign the log and mirrors copy it. Anyone can check all of it.

<!-- mcp-name: io.github.grantstamp/grantstamp -->

> **Status: a working prototype, before 1.0.** It works end to end and is tested, but it is not hardened for heavy traffic, and interfaces may change. Today the project runs every witness and mirror itself. What runs today: [grantstamp.io/status](https://grantstamp.io/status.html). Where it is going: [ROADMAP.md](ROADMAP.md).

[Website](https://grantstamp.io) | [Documentation](https://grantstamp.io/docs/) | [Search stamps](https://grantstamp.io/stamps.html) | Public registry: `https://registry.grantstamp.io`

## Start here

| You are | Start with |
| --- | --- |
| Someone whose software AI tools might use | [Stamp your first build](docs/owners.md) |
| Building an AI tool or agent | [Make your tool ask first](docs/agents.md) |
| Checking the record | [Verify a stamp yourself](docs/verification.md) |
| Able to run a small node | [Run a mirror or a witness](docs/join.md) |
| A developer | [Contributing](CONTRIBUTING.md) |
| Curious about the thinking | [Why it exists](docs/01-problem.md), [Design decisions](docs/02-solutions.md), [How the project is run](GOVERNANCE.md) |

## Try it

```bash
pip install grantstamp                       # the client: command line, MCP server, agent hook (Apache-2.0)
grantstamp check path/to/file --use port     # who owns this file, and may an AI tool port it?
```

To see the whole story on your own machine in about ten seconds, also install the registry and run the demo:

```bash
pip install grantstamp-server                # only to run a registry (AGPL-3.0)
python examples/demo.py
```

## How it works

```mermaid
sequenceDiagram
    participant O as Owner (CLI, local)
    participant R as Grantstamp registry
    participant A as AI agent (MCP / hook / API)
    O->>O: fingerprint build locally (hashes only)
    O->>R: register stamp: fingerprints + policy (signed)
    A->>A: fingerprint the user's file locally
    A->>R: POST /v1/check {digests, use: "port", licence tokens?}
    R-->>A: owner, policy decision, band, guidance, signed receipt
    R-->>O: alert (match, probing, case, notice, decision) via webhook
```

1. **The owner fingerprints a build on their own machine.** Only fingerprints and a few file details leave it. The fingerprints cannot be turned back into the files.
2. **The owner signs a stamp with their rules** for each use: analyze, decompile, modify, port, extract, redistribute or train. The stamp goes into a public log.
3. **An AI tool with the check asks before it acts**, through the MCP server, the Claude Code hook, the command line or the HTTP API. It gets the owner, the owner's rule for that use, a confidence band and a signed receipt. On a strong match, the owner gets an alert.

Owners stamp a build like this. The full guide is [Stamp your first build](docs/owners.md).

```bash
grantstamp keygen                                   # your key: ~/.grantstamp/owner.key (back it up)
grantstamp owner create --name "Starfall Studio" --public-contact legal@starfall.example --accept-terms
grantstamp owner sign-in                            # one-time sign-in, needed before you can stamp
grantstamp register ./build --title "Starfall Courier" --version 0.9.4 --preset standard
```

AI tools connect through the MCP server (`grantstamp-mcp`), the Claude Code hook (`grantstamp-hook`) or `POST /v1/check`. See [Make your tool ask first](docs/agents.md) and [integrations/](integrations/).

## Who you have to trust

By design, no single party. Today the project runs every part, so for now you also trust the project.

- Owners sign their own stamps, so the registry cannot forge one.
- The registry puts stamps in order in one public log and signs it.
- Witnesses cosign the log only when it extends what they saw, so the registry cannot rewrite history once a witness is run by someone else.
- Mirrors serve copies from any web host. Every reader checks them, so a mirror cannot change, hide or add anything without being caught. It can only go silent or lag behind.
- Every hour while the log grows, its newest cosigned checkpoint is anchored in Bitcoin, which nobody here controls.
- Cases are decided by arbiters who sign each decision with their own key. The side that lost can appeal once.
- Owners can leave: each stamp can move to another registry with proof of when it was first logged.
- `grantstamp audit stamp_...` checks the log, the daily copies and the owner's signature, and fails if anything is off. With `--from <mirror>` it also checks the witnesses' cosignatures, and `--anchors` checks the Bitcoin anchors.

Today the project runs the registry, two witnesses and two mirrors. All of them are its own. The software takes more witnesses and mirrors, run by anyone. To run one, see [Run a mirror or a witness](docs/join.md).

## Benchmark (prototype scale)

Detection results are in [bench/RESULTS.md](bench/RESULTS.md) (`python bench/run_bench.py`). Speed and storage are in [bench/LOAD.md](bench/LOAD.md) (`python bench/load_bench.py`).

- **Detection.** A toy game was recompiled with gcc and clang at -O0 to -O3 with LTO, stripped, byte-patched, given half-rewritten strings, ported as a folder, or turned into synthetic decompiler output. Every variant matched **high** or **exact**.
- **Cross-matches.** 400 Linux system executables were checked against 60 others registered under 60 owners. There were **0 medium-or-higher matches across different source packages**. All 21 medium or high matches were programs from the same source package, which really do share code.
- **Speed and size.** We registered 3,000 real executables on PostgreSQL, on one 2-CPU machine. A check took 12 ms at the median and 66 ms at the 95th percentile. Each registered executable costs about 76 KB of database.

## Documentation

The documentation is published, by version, at [grantstamp.io/docs](https://grantstamp.io/docs/). The sources are in [docs/](docs/). Among them:

| | |
| --- | --- |
| [Why it exists](docs/01-problem.md) | What happened, why speed matters, where today's safeguards fail |
| [Design decisions](docs/02-solutions.md) | Each original idea, what breaks, and what holds |
| [Who can stamp, and conflicts](docs/accountability.md) | Being on record, first come first served, cases |
| [Architecture](docs/03-architecture.md) | The parts, what runs today, and how a check flows |
| [Threat model](docs/threat-model.md) | Attacks, and what stops them |
| [Protocol](spec/grantstamp-protocol-v0.2.md) and [attestation](spec/attestation.md) | The wire format, and what owners attest |
| [Run a registry](docs/05-integrations.md) | Every service a registry needs, step by step |
| [How the project is run](GOVERNANCE.md) and [roadmap](ROADMAP.md) | Who decides what, and where it is going |

## What Grantstamp is not

It is not DRM and not a court. It does not stop leaks, make anything uncrackable or decide what is legal. It puts the owner's signed claim and rules in front of a cooperating AI tool at the moment it is about to act, and tells the owner fast.

## Citing

Each release is archived on Zenodo with a DOI (badge above). Citation details are in [CITATION.cff](CITATION.cff), which GitHub's "Cite this repository" button uses.

## License

The client library, CLI, MCP server, agent hook and website are Apache-2.0 ([LICENSE](LICENSE)). The registry server in [server/](server/) (`grantstamp-server`) is AGPL-3.0-only ([server/LICENSE](server/LICENSE)). Anyone who runs a modified copy for others must share their changes.

Copyright 2026 The Grantstamp Authors. "Grantstamp" and the Grantstamp seal are trademarks of the project owner. Neither licence grants trademark rights. See [TRADEMARK.md](TRADEMARK.md).

## Support my work

I build Grantstamp on my own, alongside my studies. Your donation helps me keep studying and keep making useful things for everyone online. Grantstamp stays free either way.

| Bitcoin | Ethereum |
| --- | --- |
| <img src="src/grantstamp/site/assets/gift-bitcoin.svg" width="120" alt="QR code for the Bitcoin address"> | <img src="src/grantstamp/site/assets/gift-ethereum.svg" width="120" alt="QR code for the Ethereum address"> |
| `bc1qnkgc43jrvkkryreg0lwc67cvtmh2hqsjngygdn` | `0xdC232BcBE2D353B4FC9520B267f43B51471aD7F8` |
