From 5196ac196a9e19cfbb9c6cd16d8081dd137e3572 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 1 Feb 2024 20:59:37 -0300 Subject: move `imeta` to NIP-92, add `imeta` tag to README. --- 29.md | 43 ------------------------------------------- 92.md | 43 +++++++++++++++++++++++++++++++++++++++++++ README.md | 3 ++- 3 files changed, 45 insertions(+), 44 deletions(-) delete mode 100644 29.md create mode 100644 92.md diff --git a/29.md b/29.md deleted file mode 100644 index 2a22233..0000000 --- a/29.md +++ /dev/null @@ -1,43 +0,0 @@ -NIP-29 -====== - -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](./94.md). There SHOULD be only one `imeta` tag per url. - -## Example - -```json -{ - "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 ", - "fallback https://nostrcheck.me/alt1.jpg" - "fallback https://void.cat/alt1.jpg" - ] - ] -} -``` - -## 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. diff --git a/92.md b/92.md new file mode 100644 index 0000000..81d4610 --- /dev/null +++ b/92.md @@ -0,0 +1,43 @@ +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](./94.md). There SHOULD be only one `imeta` tag per url. + +## Example + +```json +{ + "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 ", + "fallback https://nostrcheck.me/alt1.jpg" + "fallback https://void.cat/alt1.jpg" + ] + ] +} +``` + +## 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. diff --git a/README.md b/README.md index 28d016b..438f517 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,6 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos - [NIP-26: Delegated Event Signing](26.md) - [NIP-27: Text Note References](27.md) - [NIP-28: Public Chat](28.md) -- [NIP-29: Media Attachments](29.md) - [NIP-30: Custom Emoji](30.md) - [NIP-31: Dealing with Unknown Events](31.md) - [NIP-32: Labeling](32.md) @@ -74,6 +73,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos - [NIP-84: Highlights](84.md) - [NIP-89: Recommended Application Handlers](89.md) - [NIP-90: Data Vending Machines](90.md) +- [NIP-92: Media Attachments](92.md) - [NIP-94: File Metadata](94.md) - [NIP-96: HTTP File Storage Integration](96.md) - [NIP-98: HTTP Auth](98.md) @@ -218,6 +218,7 @@ Please update these lists when proposing NIPs introducing new event kinds. | `expiration` | unix timestamp (string) | -- | [40](40.md) | | `goal` | event id (hex) | relay URL | [75](75.md) | | `image` | image URL | dimensions in pixels | [23](23.md), [58](58.md) | +| `imeta` | inline metadata | -- | [92](92.md) | | `lnurl` | `bech32` encoded `lnurl` | -- | [57](57.md) | | `location` | location string | -- | [52](52.md), [99](99.md) | | `name` | badge name | -- | [58](58.md) | -- cgit v1.2.3