Docs
DraftStamp is a command-line tool, draftstamp. It timestamps folders or files in Bitcoin through OpenTimestamps, keeps the exact files with their proof in a local vault, and shares any file with a standard .ots proof. See Install to get it.
Getting started
Name your project once, in its folder:
cd ~/papers/riemann-draft draftstamp init
Stamp whenever a draft matters. Stamps are deliberate: before sending something out, after a milestone.
draftstamp stamp -m "first full draft"
A new stamp is pending: the OpenTimestamps calendars have it, and Bitcoin confirms it, usually within a few hours. Then complete the proof:
draftstamp upgrade
See your stamps, and re-check one against Bitcoin:
draftstamp log draftstamp verify
Commands
| Command | What it does | Network |
|---|---|---|
init [--project <name>] | Write .draftstamp in this folder, naming its project | no |
stamp [<folder> | <file>] [-m <label>] | Stamp a folder (this one by default) or a single file | calendars |
upgrade [<stamp>] | Complete pending proofs once Bitcoin confirms them (all pending stamps if none is given) | calendars, explorers |
log [--project <name> | --all] | List stamps, newest first (this folder's project by default) | no |
find <file> | Which stamps contain this file's exact bytes? | no |
check [<stamp>] | Is the stored record intact? | no |
verify [<stamp>] | Check, then confirm the date with Bitcoin | explorers |
share <path>... [--zip <file>] | Files or folders from a stamp, each with its own .ots | one upgrade attempt |
export [<stamp>] | The complete record as one zip | no |
A <stamp> is a full id, a unique prefix, or its 6-character ending (e72b05). Left out, it means the newest stamp of the current folder's project. Every command takes --vault <dir>. check and verify exit with code 3 if anything does not match.
Verifying without DraftStamp
| You have | Run | It proves |
|---|---|---|
A shared file and its .ots | ots verify -f file file.ots | This exact file existed by the block's date |
| An export | ots verify -f on each file in files/ | Every file, each on its own |
| A full bundle | The steps in the core spec, then ots verify -d | The complete set: exactly these files |
ots verify checks the Bitcoin block against a local Bitcoin node. Without one, run ots --no-bitcoin -v verify …: it prints the block height and merkle root to compare with any block explorer. Install the client with pipx install opentimestamps-client.
The vault
Stamps live in ~/.dsvault (or --vault, or $DRAFTSTAMP_VAULT), one folder per stamp:
~/.dsvault/20261121T140312Z-e72b05/ ├── snapshot.zip the exact files, as they were ├── receipt.json paths, sizes, hashes and salts └── proof.ots the OpenTimestamps proof
Nothing is ever overwritten, except that a pending proof is replaced by its upgraded version. Back up the vault: a proof is only useful next to the exact files and receipt.
Settings and ignores
.draftstamp (written by draftstamp init) names a folder's project, so you don't pass --project each time. It is never stamped.
# .draftstamp project = "riemann-draft"
.draftstampignore leaves out build outputs with gitignore-like patterns. It is stamped, so the record shows what was excluded.
# .draftstampignore *.aux *.log build/ figures/raw/*
.git, .DS_Store and similar are always skipped.
What is revealed, and to whom
- The OpenTimestamps servers see one random-looking 32-byte value per stamp: not your files, their names, or how many there are.
- Someone you share a file with learns that file's contents and its path inside the stamp, and from the shape of its proof, its position and roughly how many files the stamp had. The other files' names and contents stay hidden: their hashes in the proof are salted.
- The receipt lists every file's name and salt. It stays in your vault unless you
export. - DraftStamp itself collects nothing: no telemetry, no update checks. It contacts only the OpenTimestamps aggregators and calendars, and two block explorers (blockstream.info and mempool.space) when checking a block.
How it works
- Commit. Each file becomes a leaf,
SHA256(0x00 ‖ salt ‖ len(path) ‖ path ‖ SHA256(file)), with a fresh random 16-byte salt. The leaves form an RFC 6962 Merkle tree, whose root is wrapped into a commitment:SHA256(0x02 ‖ "draftstamp:v1" ‖ root). - Timestamp. The commitment, plus a random nonce, goes to the public OpenTimestamps aggregators (at least two must accept it). They batch it with everyone else's into Bitcoin;
upgradefetches the path to the block. - Keep. The files, receipt and proof go into the vault together.
- Share. A file's path through the tree is written as standard OpenTimestamps operations (prepend, append, sha256), followed by the stamp's proof: an ordinary
.otswhose digest is the file's own SHA-256.
The formats are specified in spec/, with test vectors from an independent Python implementation. More answers in the FAQ.