Unpacked Data Format

Individual files for the index, locks or snapshots are encrypted and authenticated like Data and Tree Blobs, so the outer structure is IV || Ciphertext || MAC again. In repository format version 1 the plaintext always consists of a JSON document which must either be an object or an array.

Repository format version 2 adds support for compression. The plaintext now starts with a header to indicate the encoding version to distinguish it from plain JSON and to allow for further evolution of the storage format: encoding_version || data The encoding_version field is encoded as one byte. For backwards compatibility the encoding versions ‘[’ (0x5b) and ‘{’ (0x7b) are used to mark that the whole plaintext (including the encoding version byte) should treated as JSON document.

For new data the encoding version is currently always 2. For that version data contains a JSON document compressed using the zstandard compression algorithm.

Last change: 2024-11-04, commit: 9c3225c