Expand description
Files sent with a jekt over the cloud relay
(docs/specs/SPEC_JEKT_FILE_TRANSFER_2026_10_05.md §4.4).
Sending: each file is encrypted (AES-256-GCM, a fresh key per file and
send), uploaded to a URL the relay issues (POST /reactive/blob), and
named in a cloud manifest with its key and blob id. The key is sealed to
the install that runs the target when its lease offers a key
(jekt_seal, spec §7), and travels as plain base64 to an older one. The
jekt’s msgid is rebound to that manifest, so srv’s WAN signature covers
keys and blob ids too. Receiving: after the claim, each blob is downloaded
through a URL the relay issues to the target alone
(GET /reactive/blob/:id), decrypted and checked against its hash, then
stored like any received file.
Constants§
- B64 🔒
- OVERHEAD 🔒
- Bytes a blob adds to its file: the nonce in front, the GCM tag behind.
- TRANSFER_
TIMEOUT 🔒 - An upload or download may take this long; the relay’s URLs live 300 s.
Functions§
- fetch 🔒
- On the receiving side, after the claim: check a cloud manifest, then
fetch, decrypt and store each file, setting
req.filesforjekt_files::prepareto list.Errwhen the relay couldn’t be reached, so the caller releases the claim for a retry; a file that is gone, tampered with or undecryptable is left out and listed as missing. - file_
key 🔒 - The key
f’s blob opens with, usingagent_id’s WAN key on this install for a sealed one.Errsays why not. - open 🔒
- Decrypt a blob
sealmade;Noneif the key, nonce or tag don’t match. - open_
key 🔒 - A plain key decoded, or a sealed one opened with the WAN keypair
wan_keygives (asked for only then). - recipient 🔒
- The key to seal
target’s files to, from its lease’s offer, checked against the agent’s record in the account’s key directory.Errsays why not, after the target’s name: a holder that offers a key gets sealed keys or nothing, never plain ones. - relay 🔒
- Send
reqand its files through the relay:Ok(Some(answer))once the relay queued it,Ok(None)when this instance has no relay or the relay didn’t take it (the caller holds or refuses),Errwith why the files can’t go that way at all. - seal 🔒
- Encrypt
plainunder a fresh key: the blob (nonce, ciphertext, tag) and the key. - store_
fetched 🔒 - Put a fetched file’s bytes in the store: derived on the way in when the sender is proven, else placed as they came.
- takes_
cloud_ 🔒files - Whether the target’s lease holder can fetch files from the relay: only a
live holder that says so.
Errsays why not, after the target’s name. - upload 🔒
- Encrypt and upload each file, sealing its key to
seal_towhen there is one; the request to relay, its files named by the cloud manifest and its msgid bound to it.