Expand description
The offline asset lifecycle — the integration layer that ties the cryptographic data plane to the on-disk client library, and the substrate the CLI showcase drives.
A Workspace holds an unlocked [Account], the per-album key material + its
ReferenceAuthority, and the signed device directory. Each operation produces the
design’s real artifacts and self-checks them through verify_asset:
import_asset— derive the file key, STREAM-encrypt to get the content hash, build + sign the create manifest, append the provenance chain, write the signed [SidecarV1], and gate onverify_asset == Accept.tag_add/set_caption— CRDT edits emitting ametadata-updateprovenance record.soft_delete/restore/purge—delete(with a signed retention window) andtrash-restorelifecycle records, and the hard delete, each judged by the signedretention_until.export_backup/import_backup— the portable artifact round-trip; the client stores plaintext, so ciphertext is regenerated deterministically from the manifest’s recorded nonce prefix.adopt_remote_head/adopt_remote_original/adopt_remote_history— hold an asset another device wrote, from a verified sync entry (and, for an asset first seen past its create, its fetched earlier records): its chain, sidecar, sealed metadata blob and original undermedia/, indexed, so the verbs above work on it as on an import.
Clients store plaintext locally (original + signed sidecar + provenance chain);
encryption produces the artifacts that cross a boundary. Offline epoch rotation is supported
(rotate_epoch); the MLS membership ceremony (Welcome,
add/remove) remains deferred (see SLICES.md).
Re-exports§
pub use crate::account::HardwareSignerBinding;
Structs§
- Adopted
Album Keys - What
Workspace::adopt_album_key_escrowsdid. - Album
KeyEscrow Plan - What
Workspace::plan_album_key_escrowsdecided, per album, in album id order. - Album
Keys - One album’s key material across one or more epochs.
- Asset
State - In-memory state for one managed asset.
- Derivative
Blob - One derivative blob of an asset bundle: the ciphertext plus the content address its
signed [
DerivativeManifest] committed to. - Enrollee
Keys - What the enrollee (the new device B) advertises: the public halves of the device keys it generated, which A cross-signs into the directory.
- Feed
Drain - A sync that drained the feed to its head: the evidence a retention sweep needs before it judges a deadline (Peering — Sync).
- Hardware
DekBinding - A request to bind this workspace’s device encryption key to a per-platform secure element: the P-256 key-agreement element itself plus the alias its key is held under.
- Initiator
Keys - What the initiator (the enrolled device A) advertises: the account it is adding to, the identity key the directory it will send verifies under, and its own device signing key.
- Original
Changed - The plaintext on disk is no longer the file an
OriginalCiphertextwas verified from. - Original
Ciphertext - The original’s ciphertext as a source, not a buffer: the plaintext’s path on disk, the per-file key and the nonce prefix the signed manifest recorded.
- Peer
Export - The assets a peer’s delta artifact is cut from (
Workspace::peer_export). - Purge
Outcome - What a
purgedid. - Remote
Asset Facts - The verified facts one remote entry contributes to the receiving catalog.
- Remote
Entry - One remote feed entry, exactly as a sync feed delivers it: opaque bytes plus the album the entry claims and the head the receiving catalog already holds. Borrowed rather than owned so a caller hands over buffers it already has without a copy.
- Remote
Head - A
RemoteEntrywhose original ciphertext is named by its SHA-256 rather than carried: what a caller holds when the original is too large to keep in memory — a restore that streams it to disk, say. - Reseal
Outcome - What one re-seal did.
- Sidecar
Enrichment - Out-of-band metadata a third-party source adapter folded for one media file, in the shape the signed sidecar stores it.
- Signed
Import - What one signed import produced: the asset’s id plus whether derivatives could be generated for it.
- Signed
Import Options - Options for a signed import driven by the import executor. Defaults (
Copymode, no stack, no exporter metadata) reproduce the standaloneWorkspace::import_assetbehaviour. - Stack
Placement - The index projection of an asset’s stack membership: the two
assetscolumns (stack_id,is_stack_hidden) that keep a non-primary member out of the timeline. - Streamed
Import - A streamed import: everything the streaming window needs
about one just-imported asset to drive its upload → verify → release step, without exposing
workspace internals. Produced by
Workspace::import_asset_streaming, which commits on the signed path with source release deferred to the server-side verify-before-destroy gate, since in streaming mode the local bytes are the only copy until the server durably holds them. - Trash
Entry - One asset in the trash, as its latest signed
deleterecord describes it. - Unanchored
Sidecar - One sidecar file under
media/that no provenance chain anchors — an asset the workspace cannot see. - Upload
Bundle - Everything needed to push one managed asset: its identity, the re-derived original
ciphertext, the exact sealed metadata blob, any derivative blobs, and the manifest-envelope
projection fields the server validates. Carries no
Workspaceinternals and no album key material — the AMK never leaves the workspace. The one secret it holds is the original’s per-file key, privately insideOriginalCiphertext, which can open that one file and nothing else. - Workspace
- An offline Capsule workspace over a client library directory.
Enums§
- Adoption
- What adopting one applied entry did to the assets this workspace holds
(
Workspace::adopt_remote_head,Workspace::adopt_remote_original). - Derivative
Status - Whether an imported asset got thumbnail/preview derivatives — and if not, why
- Enrollment
Payload - One message relayed between the two devices.
- Enrollment
Payload Error - Why a relayed payload could not be encoded or decoded.
- Lifecycle
Error - Errors from lifecycle operations.
- Quarantine
Reason - Why an entry was quarantined: surfaced to the user, never silently dropped.
- Remote
Original - How
Workspace::open_remote_original(P=Vec<u8>) orWorkspace::open_remote_original_from(P= the caller’s writer) resolved. - Reseal
Refusal - Why
Workspace::reseal_createrefused an asset. Each is a state in which writing a new genesis record would be wrong or impossible; none of them writes anything. - Sync
Apply Outcome - How applying one remote entry resolved. These three are the verdicts the client validation duties permit — there is no fourth, “ignored” case.
- Unanchored
Shape - The shape of a
{uuid}.cborundermedia/that no.provenance.cboranchors.
Constants§
- ENROLLMENT_
NONCE_ LEN - The length of each side’s per-ceremony nonce. Device keys are static — the initiator’s are already published — so without fresh randomness on both sides a man in the middle could predict one side’s input and grind the code offline.
- ENROLLMENT_
PAYLOAD_ VERSION - The payload format version this build writes and the only one it reads.
- MAX_
ENROLLMENT_ PAYLOAD_ CHARS - The longest encoded payload this build writes or reads, in characters — the relay’s own per-payload ceiling, so a payload this side accepts is one the relay would have carried.
- OPAQUE_
CONTENT_ TYPE - The
content_typeof a blob the server is not told the kind of. - WIRE_
ORIGINAL_ CONTENT_ TYPES - The original media types the upload protocol’s closed
content_typeenum names for this protocol version (server-side validation, invariant 5). Every other blob — and every original whose type is not here — declaresOPAQUE_CONTENT_TYPE, which the enum also names.
Functions§
- enrollment_
safety_ code - The safety code both devices display, over the initiator’s and the enrollee’s advertised keys as each side received them.
- hash_
ciphertext_ from - The SHA-256 and length of the original ciphertext
ciphertextyields, read one STREAM chunk at a time: theRemoteHead::original_ciphertext_hashfor an original that is on disk rather than in memory, computed in memory bounded by one chunk whatever the original’s size. - unanchored_
sidecars - The sidecars under the library at
rootthat no provenance chain anchors — the setWorkspace::openreports throughWorkspace::unanchored_sidecars, found without a passphrase or any key material. - wire_
content_ type - The
content_typean original of media typecontent_typedeclares on the wire: itself when the protocol’s closed enum names it,OPAQUE_CONTENT_TYPEotherwise.