Skip to content

Kind 20: Picture ​

Overview ​

Picture events (kind 20) are designed for image-centric content in Nostr. These events cater to clients resembling platforms like Instagram or Flickr, where images take center stage in the user experience. Picture events can contain single or multiple images, descriptive text, and rich metadata.

Specification ​

PropertyValue
Kind Number20
Event RangeRegular
Defined inNIP-68

Content Format ​

The content field contains a description of the post or images. It serves as a caption or explanatory text for the images being shared.

Schema ​

json
"content": "A beautiful sunset at the beach during my recent trip to Costa Rica."

Tags ​

Tag NameDescriptionFormatRequired
titleShort title for the post["title", "Costa Rica Sunset"]Yes
imetaImage metadata["imeta", "url https://example.com/image.jpg", "m image/jpeg", ...]Yes (at least one)
xSHA-256 hash of images["x", "<sha256>"]Recommended
pTagged users["p", "<pubkey-hex>", "<relay-url>"]No
tHashtags["t", "sunset"]No
locationNamed location["location", "San José, Costa Rica"]No
gGeohash location["g", "<geohash>"]No
content-warningWarning for sensitive content["content-warning", "nudity"]Conditionally
mMedia type["m", "image/jpeg"]Recommended
LLanguage code for text in images["L", "en"]No
lLanguage of image text["l", "en", "ISO-639-1"]No

Image Metadata (imeta) ​

The imeta tag can contain several attributes:

  • url: URL to the image (required)
  • m: MIME type (recommended)
  • blurhash: BlurHash for previewing (recommended)
  • dim: Dimensions in format "widthxheight" (recommended)
  • alt: Alt text for accessibility (recommended)
  • x: SHA-256 hash for verification (recommended)
  • fallback: Alternative image URLs (optional)
  • annotate-user: Tag users in specific locations (optional)

Client Behavior ​

Clients should:

  1. Display images as the primary content, with text as secondary
  2. Support multiple image galleries when multiple imeta tags are present
  3. Use blurhashes for loading previews when available
  4. Display content warnings appropriately when present
  5. Support linking to tagged users, both in the post and in image annotations
  6. Verify image integrity using the provided hash when available
  7. Make proper use of fallback URLs when the primary URL is unavailable

Relay Behavior ​

Relays should:

  1. Store these events like other regular events
  2. Support queries by kind 20, by hashtags, and by image hashes

Use Cases ​

  • Photo sharing
  • Image-focused galleries
  • Travel photography
  • Art showcases
  • Multi-image posts
  • Visual stories with captions

Example ​

json
{
  "id": "4376c65d2f232afbe9b882a35baa4f6fe8667c4e684749af565f981833ed6a65",
  "pubkey": "79dff8f82963424e0bb02708a22e44b4980893e3a4be0fa3cb60a43b946764e3",
  "created_at": 1671217411,
  "kind": 20,
  "content": "Beautiful sunset at the beach in Costa Rica. The colors were absolutely stunning!",
  "tags": [
    ["title", "Costa Rica Sunset"],
    [
      "imeta",
      "url https://nostr.build/i/sunset.jpg",
      "m image/jpeg",
      "blurhash eVF$^OI:${M{o#*0-nNFxakD-?xVM}WEWB%iNKxvR-oetmo#R-aen$",
      "dim 3024x4032",
      "alt A scenic photo of sunset over the coast of Costa Rica",
      "x 5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36",
      "fallback https://noscheck.me/sunset.jpg"
    ],
    [
      "imeta",
      "url https://nostr.build/i/beach.jpg",
      "m image/jpeg",
      "blurhash eGF$^OI:${M{o#*0-nNFxakD-?xVM}WEWB%iNKxvR-oetmo#R-aen$",
      "dim 3024x4032",
      "alt Beach view at sunset in Costa Rica",
      "x 6d83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36",
      "fallback https://nostrcheck.me/beach.jpg",
      "annotate-user f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca:156:230"
    ],
    ["p", "f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca"],
    ["t", "sunset"],
    ["t", "travel"],
    ["t", "costarica"],
    ["location", "Santa Teresa, Costa Rica"],
    ["g", "9fu6pv"],
    ["m", "image/jpeg"]
  ],
  "sig": "908a15e46fb4d8675bab026fc230a0e3542bfade63da02d542fb78b2a8513fcd0092619a2c8c1221e581946e0191f2af505dfdf8657a414dbca329186f009262"
}

Supported Media Types ​

The following media types are accepted in Picture events:

  • image/apng: Animated Portable Network Graphics (APNG)
  • image/avif: AV1 Image File Format (AVIF)
  • image/gif: Graphics Interchange Format (GIF)
  • image/jpeg: Joint Photographic Expert Group image (JPEG)
  • image/png: Portable Network Graphics (PNG)
  • image/webp: Web Picture format (WEBP)

References ​

Notes ​

  • Picture events are part of a broader media ecosystem in Nostr, with kind 21 and 22 events serving video content.
  • The annotate-user feature enables tagging users at specific coordinates in an image, similar to photo tagging in social media.
  • While the imeta tag contains image URLs, the images themselves are not stored on the Nostr network but on external services.
  • Using hashes and multiple fallback URLs increases the resilience of image availability.