A writing record anyone can read.
A .typed file is a document and the keystrokes that made it, in plain text. This page is the whole specification of version 1, and it is open: read it, implement it, and build on it without asking us.
What is open
The file layout, the event types, the hash chain and the checking rules below are free for anyone to use, in any language, in commercial or personal work, with no fee and no permission. Verityped’s editor is one writer of these files and the Verify page is one reader, and neither has any special standing: a file made elsewhere that follows this page checks the same way here.
Paid plans add things around the format, such as sessions our server witnesses live and certificates built on them. Those are not part of version 1 and are not described here.
Layout
A file is UTF-8 text with Unix line endings, in three parts.
TYPED/1
On paying attention
A thought does not usually arrive all at once.
~~~~ typing history follows. Change anything in this file and the check will show where. ~~~~
{"format":"TYPED/1","author":"Ada","created":"2026-11-19T09:12:04.000Z","saved":"2026-11-19T09:58:41.000Z","ev":[...],"chain":"9f2c...","cp":["4be1...", ...]}
The first line is the format name and version. After a blank line comes the document as readable text: the title, a blank line, then the body, with headings, lists and quotes in Markdown style. The line of tildes marks the end of the text, and the last line of the file is one JSON object holding the history. A reader finds the history by taking the last non-empty line, so the text above it can be shown to people without parsing anything.
The readable text is a convenience. The history is the record, and the text should equal what the history produces when replayed from nothing.
The history object
| Key | Meaning |
|---|---|
format | The string TYPED/1 |
author | The name the writer gave, or Anonymous |
created | When the document began, as an ISO 8601 UTC time |
saved | When this file was written |
ev | The list of events, oldest first |
chain | The final hash of the chain, in lowercase hex |
cp | The checkpoint hashes, one for every 200 events |
Events
Every event is a JSON array. The first item is a letter for the kind and the second is the number of milliseconds since the event before it, which is 0 for the first event.
| Event | Meaning |
|---|---|
["t", ms, pos, del, ins, how] | Text changed. At position pos, del characters were removed and the string ins was put in their place. how is t for typed, u for undo or redo, m for text moved within the document, or c for a cut. |
["f", ms, pos, del, ins] | Formatting changed. It edits the text the same way as t, but only formatting characters may differ before and after. |
["n", ms, title] | The title changed. It carries the whole new title, not a difference. |
["a", ms, 0 or 1] | The writer left the tab (0) or came back (1). On a return, ms is the time spent away. |
["r", ms, n] | A paste or drop of n characters was refused |
["g", ms, tool, level] | A writing assistant such as Grammarly was noticed in the browser. level is seen or field. |
["x", ms, "restored", n] | Part of a damaged history was recovered and n later events were dropped |
A position counts UTF-16 code units, as JavaScript strings do, in the document’s working text. That text is the body with one marker character in front of each line that is not plain, and a pair of markers around bold or italic spans, all taken from the Unicode private use area:
| Character | Meaning |
|---|---|
U+E000, U+E001 | Bold starts, bold ends |
U+E002, U+E003 | Italic starts, italic ends |
U+E010, U+E011 | Line is a heading, line is a subheading |
U+E012, U+E013 | Line is a bullet, line is a numbered item |
U+E015, U+E016 | Line is a quote |
Replaying means starting from an empty string and applying each t and f event, then writing the result as the readable text, with the markers turned into Markdown.
What counts as typing
Version 1 treats an insertion of more than 24 visible characters in one t event as something typing does not do, and the editor refuses to record one, logging an r event instead. A reader should flag any such event it finds in a file. A move or an undo may be longer only when the text was already in the document or had been removed from it earlier. Events of a kind the reader does not know should be flagged as well. None of these checks produce a score. A reader shows the passages that need a look, and the person looking decides.
The hash chain
The chain makes the history tamper-evident. It uses SHA-256 over UTF-8 text and writes each hash as 64 lowercase hex characters.
- The first hash is the hash of
format,authorandcreatedjoined with a vertical bar, such asTYPED/1|Ada|2026-11-19T09:12:04.000Z. - Each event then gives a new hash: the hash of the previous hash followed directly by the event as compact JSON, with no spaces.
- The last hash is stored as
chain. The hash after every 200th event is also stored, in order, incp.
If anyone changes, removes or reorders an event, every hash after it changes, so the stored chain no longer matches. The checkpoints say where: the first one that differs points to the block of 200 events containing the change. That is also how a damaged file can be partly restored, by keeping the history up to the last good checkpoint.
A checker in a few lines
This Node program reads a file and tells you whether the chain is intact. It uses nothing but the standard library.
import { readFileSync } from "node:fs";
import { createHash } from "node:crypto";
const sha = (s) => createHash("sha256").update(s, "utf8").digest("hex");
const text = readFileSync(process.argv[2], "utf8");
const line = text.split("\n").filter(Boolean).pop();
const doc = JSON.parse(line);
let h = sha([doc.format, doc.author, doc.created].join("|"));
const checkpoints = [];
doc.ev.forEach((e, i) => {
h = sha(h + JSON.stringify(e));
if ((i + 1) % 200 === 0) checkpoints.push(h);
});
const ok = h === doc.chain && checkpoints.join() === doc.cp.join();
console.log(ok ? "chain intact" : "chain does not match", doc.ev.length, "events");
Writers have to produce the event text exactly as JSON.stringify does, because that exact text is what gets hashed. A reader should hash the events as it parsed them and re-serialize them the same way.
What a passing check shows
An intact chain with no flagged passages shows that the history is in order, that nothing in it arrived faster than typing, and that nobody has changed it since it was written. It does not show where the file came from. Someone patient could build a believable history on their own computer, and nothing in version 1 can tell words typed from another screen apart from words composed in place. A file can say that it is honest. It cannot prove who was at the keyboard.
Versions and changes
The first line names the version. Changes that break reading will get a new number, and TYPED/1 files will stay readable. If you build something on the format and need something it lacks, tell us, and we will think about it in the open.