Skip to content

Latest commit

 

History

History
100 lines (83 loc) · 5 KB

send.md

File metadata and controls

100 lines (83 loc) · 5 KB

Deadbolt Send

One-time links that hand files, secrets, or vault items to someone who doesn't use Deadbolt. Built in crates/send (protocol and crypto, native and WebAssembly), crates/send-web (browser wrapper), crates/cli/src/daemon/send.rs, crates/cli/src/send.rs, crates/cli/src/receive.rs, and site/r.html (site/src/receive/).

Model

  • Browser or CLI recipient: opening https://deadbolt.pw/r#<ticket> or running deadbolt receive fetches the share directly from the sender's daemon over iroh (deadbolt/send/1) via the n0 relay named in the fragment and decrypts it locally. Nothing is stored on any server.
  • The fragment is the key (SendTicket, unpadded base64url after #): version(1) || sender_endpoint_id(32) || access_secret(32) || content_key(32) || relay_len(1) || relay_url || addr_count(1) || addrs. Browsers never send URL fragments in HTTP requests; direct LAN addresses are included only when no relay is present.
  • Ephemeral send endpoint: the daemon serves sends from a separate per-run random iroh endpoint key (unlinkable to the vault's device key) and holds only sealed bytes plus access_secret — never content_key. Active sends keep serving while the vault is locked and end when the daemon stops.
  • Bundle & STREAM sealing (<= 32 MiB): Bundle { title?, note?, entries: [Entry | Group] } sealed with 64 KiB chunked XChaCha20-Poly1305 (BLAKE3 derive_key("deadbolt send 2026-11 bundle", content_key)), binding the 10-byte cleartext policy header (version || flags || expires_unix) as chunk 0's AAD.
  • Store-backed Send (crates/remote, not wired into CLI yet): uploads the same sealed bundle create-only to <vault>/s/<derived_name> on an S3/R2 remote and embeds a SigV4 presigned GET URL (<= 7 days, capped at header expiry) in the link for multi-open offline delivery.

Protocol (deadbolt/send/1)

receiver -> sender   PROOF  HMAC-SHA256(secret, "receiver-proof" || 0 || transcript)
sender -> receiver   STATUS 0 ok | 1 expired | 2 used | 3 revoked
                     then, if ok: len (u64 BE) || sealed bundle
receiver -> sender   ACK    1
transcript = "deadbolt/send/1" || sender id || receiver id || TLS exporter("EXPORTER-deadbolt-send-v1")

access_secret is proved in constant time and bound to the TLS connection so it cannot be replayed.

Policy

  • Single-use by default (--opens N, up to 100); 1-hour default TTL (--ttl, up to 7 days).
  • An open is counted once the full sealed bundle is written to the stream (an interrupted transfer releases the reservation; concurrent openers of a single-use share see used).
  • revoke stops new opens immediately; finished shares remain visible in send ls until 24 hours past expiry or daemon exit.

Threat model

  • Possession of the link grants access: single-use defaults and deadbolt send show pickup timestamps make interception visible.
  • Link scanners: /r connects only after the user clicks Receive, so automated previews do not burn single-use links.
  • Receive page hygiene: reads and strips location.hash via history.replaceState, sets Referrer-Policy: no-referrer, blocks framing and third-party origins via CSP, and runs zero analytics.
  • Relay visibility: sees endpoint IDs, timestamps, and byte counts — never plaintext, filenames, access_secret, or content_key.

CLI

deadbolt send [PATH|-]... [--item NAME|ID [--field NAME]]... [--title T] [--note N]
              [--sensitive] [--opens N] [--ttl 1h] [--qr] [--yes] [--json] [--wait]
deadbolt send ls [--json] | show <id> [--json] | revoke <id>
deadbolt receive <LINK|#FRAGMENT> [--output DIR] [--force] [--json]
  • Positional arguments are always existing filesystem paths (./ls for a file named ls); - reads stdin; no arguments prompts for a hidden secret.
  • --item requires an exact item name or ID (suggesting close matches on miss, never guessing); --field selects one field of the preceding --item.
  • Interactive runs preview entries, opens, and TTL and ask Create link? [y/N] (--yes skips confirmation; --json requires --yes). --wait exits 0 on pickup, 4 on expiry, 5 on revoke.
  • deadbolt receive prints a single short UTF-8 value to stdout, multiple values as name<TAB>value, or writes files safely under --output (refusing path traversal or overwrites without --force).
  • Daemon control commands (crates/proto/src/daemon/command.rs, DAEMON_PROTOCOL_VERSION = 38 in crates/proto/src/lib.rs): send-create, send-list, send-show, send-revoke, send-wait.

Building the receive page

site/scripts/wasm.sh compiles crates/send-web for wasm32-unknown-unknown and runs wasm-bindgen --target web into the generated site/src/receive/wasm output bundled by Vite (iroh with default-features = false, tls-ring, and wasm_js randomness).

Later

  • Persisting sealed shares across daemon restarts; CLI wiring for store-backed S3/R2 Send; sending and receiving directly inside Deadbolt.app.