Sealed objects and envelopes
Every path is encrypted, at every tier. The tiers differ in who gets the key. What isn't encrypted is the shape around the content: names, sizes, history and who was granted what.
A sealed object
Sealing a file version draws a fresh 32-byte content key and a 12-byte nonce, and encrypts the bytes with AES-256-GCM. The result carries the nonce, the ciphertext, the tier and the grant markers, and never the key. Keys are kept apart from objects, in your keyring, so storing or syncing an object can't leak one. Internal content is compressed with zstd before encryption when that makes it smaller. Restricted and embargoed content is never compressed.
Where each key goes
| Tier | How the key travels |
|---|---|
| Internal | In every sync bundle a relay carries, so anyone who can pull from a relay reads it, the relay included. |
| Published | As Internal, plus a world-readable marker on the object. |
| Restricted | Only as a grant sealed to one recipient's public key. |
| Embargoed | Only as a timed grant the relay withholds until the reveal time. |
Envelopes
- Key envelope. A grant wraps the content key to the recipient: an X25519 key derived from their ed25519 identity key, and ChaCha20-Poly1305. It is 80 bytes, and only the recipient can open it.
- Push envelope. Every push and grant deposit is wrapped as
[0x01][public key][signature][payload]. It is signed, not encrypted. It proves who sent the payload and hides nothing. - Custody at rest. With a passphrase set, your identity key is encrypted and each keyring entry becomes a key envelope sealed to your own key. Without one, both sit unencrypted in
.loot/: the identity key with owner-only permissions on Unix, the keyring readable by anything that can read the folder.
What the shape discloses
Anyone holding a copy of the history (a relay, a forge, any collaborator) can read all of this, at every tier:
| Visible | Detail |
|---|---|
| Path names | Every path in every change, Restricted and Embargoed ones included. |
| Tiers | Each path's tier, an embargo's reveal time, and whether an object is published. |
| Sizes | Ciphertext is the payload plus 16 bytes. For Restricted and Embargoed content that is the exact plaintext size; for Internal, the compressed size. |
| Edits | Which paths changed in which change: an untouched path keeps its object address, and an edited one gets a new address. |
| Counts | How many paths each change holds, how many are sealed, how many objects exist. |
| History | Messages, author public keys, parents, change ids, the signed when timestamp, and recorded renames. |
| Grants | On a host: grantor and recipient public keys, which object, and any reveal or expiry time. Never the key. |
| Timing | A host sees when each push and grant deposit arrives. |
Holder names don't travel: before an object or tree leaves your machine, its Restricted holder list is stripped. But .lootattributes is an ordinary file, Internal unless a rule says otherwise, so its patterns and every restricted= name in it are readable by anyone who reads Internal content, a relay included. You can restrict the file itself. Then writers without its key don't receive the policy.
What doesn't leak: the plaintext of any tier whose key a reader lacks, and whether two files match, since the same bytes sealed twice get different addresses (see the content-addressed store). If a filename is itself the secret, sealing the bytes doesn't hide it.
What a host can read covers the same ground from the host's side, and the trust matrix gives the answer reader by reader.