ZI² Books ZI² Books

The ZI² format

A sealed edition is a file you keep. Here is exactly what is inside it, so you can open it in any browser today and in any program you care to write tomorrow.

Layout of a .zi2 file

BytesFieldMeaning
0 to 3ZI2 then 0x01Marker and format version
4 to 1916 bytesRandom salt for the key derivation
20 to 3112 bytesRandom nonce for AES-256-GCM
32 to endciphertext and tagAES-256-GCM output: the compressed book plus a 16-byte integrity tag

The key

The key is PBKDF2-HMAC-SHA256 over your unlock phrase with the salt, 200,000 rounds, 32 bytes. Nothing else is needed: no server, no account, no activation. The phrase sits on your license page.

What decrypts

Gzip, then one JSON document: the book's title, subtitle, author, edition, rights line, the cover as an image data URL, and the chapters as plain HTML with figures embedded as data URLs.

{
  "title": "...", "subtitle": "...", "author": "...",
  "edition": "...", "rights": "...",
  "cover": "data:image/png;base64,...",
  "chapters": [{"title": "...", "html": "..."}]
}

The promise

Because the layout is published, a sealed edition never depends on this site staying up. The browser reader here is one implementation; your license page keeps the file, the phrase and a fingerprint you can verify at any time.

Open the reader Verify