Nostr Flash — Ephemeral Photography Protocol

Nostr Flash Protocol

published

This NIP defines two event kinds for a privacy-first ephemeral photography application on Nostr.

Kind 7033 — Flash Post

Regular (non-replaceable) event representing an ephemeral photography post.

Tags

Tag Description
imeta Full NIP-94 image metadata (url, m, x, dim, etc.) — public posts only
url Direct image URL (fallback if no imeta) — public posts only
dim Image dimensions in WxH format (e.g. 1920x1080)
lifetime Survival timer in seconds (e.g. 3600 = 1 hour)
alt Accessibility caption (≤280 chars)
t Hashtag for categorisation (zero or more)
encrypted Set to nip44 for private posts
p Hex pubkey of the intended recipient (private posts only)

Content

Public posts: human-readable caption string.

Private posts: NIP-44 ciphertext. When decrypted, the plaintext is a JSON object:

{
  "caption": "optional caption string",
  "image": {
    "keyHex": "<64-char hex AES-256 key>",
    "ivHex":  "<24-char hex 12-byte GCM IV>",
    "url":    "https://blossom.example/encrypted-blob.enc"
  }
}

The file at image.url is a raw AES-256-GCM ciphertext blob (Content-Type: application/octet-stream). The Blossom server never holds the plaintext image. Decryption is done entirely in the client using crypto.subtle.

Private Post Encryption Flow

  1. Strip EXIF from raw image → clean WebP blob.
  2. Generate a random 256-bit AES-GCM key and 96-bit IV with crypto.subtle.generateKey.
  3. Encrypt the image bytes → opaque ciphertext blob.
  4. Upload the ciphertext blob to Blossom (application/octet-stream).
  5. Encode the key, IV and Blossom URL in JSON.
  6. NIP-44 encrypt that JSON payload to the recipient's pubkey.
  7. Publish the kind 7033 event with ["encrypted","nip44"] and ["p", recipientHex] tags. No imeta or url tag is included.

Private Post Decryption Flow

  1. Detect ["encrypted","nip44"] tag and check that ["p"] is the reader's pubkey (or the reader is the author).
  2. NIP-44 decrypt event.content → JSON.
  3. Fetch the encrypted blob from image.url.
  4. AES-256-GCM decrypt using image.keyHex and image.ivHex.
  5. URL.createObjectURL the resulting blob and display.

Kind 7034 — Flash Boost

Regular (non-replaceable) reaction event that extends the survival timer of a flash post.

Tags

Tag Description
e Hex event ID of the flash post being boosted
p Hex pubkey of the flash post author
extension Number of seconds added to the post's survival timer
rating Optional quality score (1–5)

Content

Optional free-text comment (may be empty string).

Expiration Logic

expiresAt  = (event.created_at + parseInt(lifetime) + Σ extension) * 1000  // ms
isExpired  = Date.now() > expiresAt

lifetime comes from the flash post's lifetime tag. extension values are summed across all kind-7034 boost events referencing the post via #e.

Expired posts are hidden from the active feed and shown in the read-only Archive.

Privacy Guarantees

Property Public post Private post
Image on Blossom Plaintext AES-256-GCM ciphertext
Caption on relay Plaintext NIP-44 ciphertext
Image URL on relay In imeta tag Inside NIP-44 ciphertext only
EXIF metadata Stripped before upload Stripped before upload
Viewer Anyone Author + named recipient

Discussion

Connect a key to comment.