diff options
| author | fiatjaf <fiatjaf@gmail.com> | 2024-02-01 20:59:37 -0300 |
|---|---|---|
| committer | fiatjaf <fiatjaf@gmail.com> | 2024-02-01 20:59:37 -0300 |
| commit | 5196ac196a9e19cfbb9c6cd16d8081dd137e3572 (patch) | |
| tree | cb2bcf62e085df61091be54af8a1227b7152cbd3 /92.md | |
| parent | 5e14fd7f0851779cda2adbb8fd8bac4547570b15 (diff) | |
move `imeta` to NIP-92, add `imeta` tag to README.
Diffstat (limited to '92.md')
| -rw-r--r-- | 92.md | 43 |
1 files changed, 43 insertions, 0 deletions
| @@ -0,0 +1,43 @@ | |||
| 1 | NIP-92 | ||
| 2 | ====== | ||
| 3 | |||
| 4 | Media Attachments | ||
| 5 | ----------------- | ||
| 6 | |||
| 7 | 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. | ||
| 8 | |||
| 9 | `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. | ||
| 10 | |||
| 11 | The `imeta` tag is variadic, and each entry is a space-delimited key/value pair. | ||
| 12 | Each `imeta` tag MUST have a `url`, and at least one other field. `imeta` may include | ||
| 13 | any field specified by [NIP 94](./94.md). There SHOULD be only one `imeta` tag per url. | ||
| 14 | |||
| 15 | ## Example | ||
| 16 | |||
| 17 | ```json | ||
| 18 | { | ||
| 19 | "content": "More image metadata tests don’t mind me https://nostr.build/i/my-image.jpg", | ||
| 20 | "kind": 1, | ||
| 21 | "tags": [ | ||
| 22 | [ | ||
| 23 | "imeta", | ||
| 24 | "url https://nostr.build/i/my-image.jpg", | ||
| 25 | "m image/jpeg", | ||
| 26 | "blurhash eVF$^OI:${M{o#*0-nNFxakD-?xVM}WEWB%iNKxvR-oetmo#R-aen$", | ||
| 27 | "dim 3024x4032", | ||
| 28 | "alt A scenic photo overlooking the coast of Costa Rica", | ||
| 29 | "x <sha256 hash as specified in NIP 94>", | ||
| 30 | "fallback https://nostrcheck.me/alt1.jpg" | ||
| 31 | "fallback https://void.cat/alt1.jpg" | ||
| 32 | ] | ||
| 33 | ] | ||
| 34 | } | ||
| 35 | ``` | ||
| 36 | |||
| 37 | ## Recommended client behavior | ||
| 38 | |||
| 39 | When uploading files during a new post, clients MAY include this metadata | ||
| 40 | after the file is uploaded and included in the post. | ||
| 41 | |||
| 42 | When pasting urls during post composition, the client MAY download the file | ||
| 43 | and add this metadata before the post is sent. | ||