Skip to main content

Module drop

Module drop 

Source
Expand description

Web-upload guest drops — contract skeleton (SSoT: Web Upload).

A guest with an upload link seals each asset under a fresh random key K, encapsulates K to the link’s Drop Key, and uploads the sealed bytes to the provisioning user’s staging inbox. Nothing becomes a library asset until one of that user’s trusted clients adopts the drop — decapsulating K, rewrapping it under the album AMK (asset-keywrap/v1, KeyMode::Wrapped), and signing an ordinary create manifest. The guest is never a signer; drops never flow through verify_asset.

This module owns the client-side halves: link issuance, drop sealing (compiled to WASM for capsule-web), and adoption. The server halves (drop store, inbox, atomic inbox→album promotion) live in the server’s drop module.

Structs§

AdoptedDrop
What adopting a drop produced: the asset it became, and the index tier a push publishes.
DropDescriptor
The unsigned descriptor a guest uploads beside the sealed ciphertext. Deliberately not an AssetManifest: no signatures, no album_id, no provenance link. Its integrity is established only when a trusted client decapsulates K and the STREAM tags verify.
DropId
Identifies a pending drop in the provisioning user’s inbox.
LinkCaps
Per-link caps, enforced server-side at the no-key layer on every drop-session creation (Web Upload — Security Contract).
PassphraseVerifier
An Argon2id abuse-gate verifier for a passphrase-protected upload link. Unlike a share-link passphrase (which wraps a read secret the client unwraps locally), this gates a write, so the server must verify possession: the link record stores the salt + Argon2id-derived verifier, and the guest proves possession at drop-session creation. The passphrase itself is never transmitted or stored, and this adds no confidentiality — the guest already encrypts every asset (SSoT: Web Upload Security Contract — Optional passphrase).
PendingDrop
A drop awaiting review in the provisioning user’s inbox.
SealedDrop
A sealed drop ready for upload: the descriptor plus the STREAM ciphertext.
UploadLink
A provisioned upload link: the server-held record plus the fragment-delivered public half. The opaque_id follows the share-link rule (random ≥128-bit, never structured); drop_pubkey travels only in the URL fragment and never reaches the server.
UploadLinkId
Identifies a provisioned upload link for revocation.

Enums§

DropError
Failure surfaced by the drop lifecycle.

Constants§

OPAQUE_ID_LEN
Length of an upload-link opaque URL-path id: a full 128 bits of CSPRNG entropy — never a structured/UUIDv7 id (identical rule to a share link, whose embedded v7 timestamp would cut real entropy to ~62 bits). SSoT: Web Upload Security Contract.

Traits§

DropAdopter
Reviews and adopts pending drops on a trusted (native) client — decapsulate K, rewrap under the destination album’s AMK, author the sidecar, sign the create manifest with key_mode = wrapped, and submit the atomic inbox→album promotion.
UploadLinkIssuer
Issues and revokes upload links on a trusted (native) client — the seam lifecycle::Workspace will implement. Provisioning mints the Drop Key, wraps its private half under the master key + OGK escrow, and registers the link record.

Functions§

generate_opaque_id
Draw a fresh opaque upload-link URL-path id: a full 128 bits of CSPRNG entropy, not a structured or sequential identifier. Mirrors the share-link opaque-id discipline exactly (SSoT: Web Upload Security Contract — the URL is .../u/{opaque-id}#{drop_pubkey}).
open_drop_key
Recover the guest-chosen asset key K from a drop’s kem_ct using the Drop Key’s private half — the first step of adoption. Splits the X-Wing ciphertext from the AEAD-wrapped key, decapsulates the shared secret, and opens the wrap. A truncated kem_ct, a foreign/tampered ciphertext, or a wrong Drop Key all fail closed (DropError::Crypto).
seal_drop
Seal plaintext for a guest drop: draw a fresh random K, STREAM-encrypt under it, and encapsulate K to drop_pubkey (the link’s KEM public half, from the URL fragment). Runs in the browser (WASM) and on native clients alike — it is the only path compiled to wasm32-unknown-unknown.
seal_drop_derand
The deterministic core of seal_drop: every randomized value is supplied explicitly.