Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Documents

A document is a map from string keys to blobs. It is the only mutable thing in The Wired; a blob’s bytes never change, so all change is a document’s keys pointing at different blobs. Writing to a key appends a signed entry naming the blob that key now holds, and a reader of the key sees the most recent entry.

A document is identified by a keypair generated when it is created. The public half is its ID, and the secret half is the right to write to it.

Capabilities

Access to a document is determined by which key you hold.

  • Holding a document’s ID lets you read it and sync it.
  • Holding its secret lets you write to it.

Sharing access means sharing a key. A document is private when its ID was never given out. There is no permission list for a host to misread, leak, or ignore, and no way to grant access it was never given.

Revoking access means rotating: create a new document, move the content, and stop publishing the old ID. Anyone who already read the old contents keeps them, but sees nothing further.

Verification

Every entry is signed by the document’s key and by the key of the device that wrote it. Device keys are bound to a DID, tracing an entry to the person who wrote it.

You can verify data without trusting whoever handed it to you. A store relaying a document cannot alter an entry, insert one, or attribute it to a different author; the worst it can do is withhold the newest version or refuse to respond.

Collaborative Editing

Concurrent writes to a document merge. Each entry carries its author and a timestamp; concurrent writes to different keys all survive, and concurrent writes to the same key settle on the latest. The rule is deterministic, so every peer converges on the same result regardless of arrival order, and editing offline never requires resolving a conflict on reconnect.

An HSD scene is a document with every object and property as a key, so two people moving different objects write different keys and both edits survive.

Format

An entry is (document, author, key) → (hash, size, timestamp), signed by both the document’s key and the author’s device key. The hash addresses the entry’s content in the blob layer; the timestamp orders concurrent writes to the same key.