Skip to content

Latest commit

 

History

History
74 lines (59 loc) · 2.54 KB

92.md

File metadata and controls

74 lines (59 loc) · 2.54 KB

NIP-92

Media Attachments

Media attachments (images, videos, and other files) may be added to events by including a URL in the event content, along with a matching imeta tag.

imeta ("inline metadata") tags add information about media URLs in the event's content. Each imeta tag SHOULD match a URL in the event content. Clients may replace imeta URLs with rich previews.

The imeta tag is variadic, and each entry is a space-delimited key/value pair. Each imeta tag MUST have a url, and at least one other field. imeta may include any field specified by NIP 94. There SHOULD be only one imeta tag per URL.

Example

{
  "content": "More image metadata tests don’t mind me https://nostr.build/i/my-image.jpg",
  "kind": 1,
  "tags": [
    [
      "imeta",
      "url https://nostr.build/i/my-image.jpg",
      "m image/jpeg",
      "blurhash eVF$^OI:${M{o#*0-nNFxakD-?xVM}WEWB%iNKxvR-oetmo#R-aen$",
      "dim 3024x4032",
      "alt A scenic photo overlooking the coast of Costa Rica",
      "x <sha256 hash as specified in NIP 94>",
      "fallback https://nostrcheck.me/alt1.jpg",
      "fallback https://void.cat/alt1.jpg"
    ]
  ]
}

URL Preview Cards

iog ("inline open graph") tags add Open Graph information to help Clients assemble preview cards without having to ping the url for more information. Each iog tag SHOULD match a URL in the event content.

Since Open Graph tags include a thumb image for the URL, NIP 94 labels can be added to the iog to provide more information about that thumbnail.

{
  "content": "Url preview cards metadata tests https://nostr.org",
  "kind": 1,
  "tags": [
    [
      "iog",
      "url https://nostr.org",
      "type website",
      "title Notes and Other Stuff Transmitted by Relays",
      "description Come join us on Nostr, a new protocol for more than socializing",
      "image https://nostr.org/assets/images/home/social-nostr.png"

      // these are associated with https://nostr.org/assets/images/home/social-nostr.png
      "m image/png",
      "blurhash L22?E{q;MacoswtDbWaJL#cppbi1",
      "dim 1200x630",
      "x <sha256 hash as specified in NIP 94>"
    ]
  ]
}

Recommended client behavior

When uploading files during a new post, clients MAY include this metadata after the file is uploaded and included in the post.

When pasting URLs during post composition, the client MAY download the file and add this metadata before the post is sent.

The client MAY ignore imeta tags that do not match the URL in the event content.