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

CommandWhat it doesNetwork
init [--project <name>]Write .draftstamp in this folder, naming its projectno
stamp [<folder> | <file>] [-m <label>]Stamp a folder (this one by default) or a single filecalendars
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 Bitcoinexplorers
share <path>... [--zip <file>]Files or folders from a stamp, each with its own .otsone upgrade attempt
export [<stamp>]The complete record as one zipno

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.

Sharing

Paths are as they appear inside the stamp (as log and find show them):

draftstamp share chapters/chapter3.tex                   # one file and its .ots
draftstamp share chapters/                               # every file in a folder, folders kept
draftstamp share chapters/ main.tex --zip for-reviewer.zip   # one zip with a README

If the stamp is still pending, share tries to upgrade it first, so the proof reaches Bitcoin when it can. A folder has no single .ots: a .ots proves one file, so a folder is shared as one proof per file, all leading to the same stamp.

export is different: it writes the complete record (every file, the receipt and the stamp's proof). Give it only to someone who should see everything.

Verifying without DraftStamp

You haveRunIt proves
A shared file and its .otsots verify -f file file.otsThis exact file existed by the block's date
An exportots verify -f on each file in files/Every file, each on its own
A full bundleThe steps in the core spec, then ots verify -dThe 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

  1. 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).
  2. 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; upgrade fetches the path to the block.
  3. Keep. The files, receipt and proof go into the vault together.
  4. 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 .ots whose 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.