upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/68.md
blob: 8a8784842be8dc190c303e3456fd9e3837597797 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
NIP-68
======

Picture-first feeds
-------------------

`draft` `optional`

This NIP defines event kind `20` for picture-first clients. Images must be self-contained. They are hosted externally and referenced using `imeta` tags

Unlike a `kind 1` event with a pircture attached, Picture events are meant to contain all additional metadata concerning the subject media and to be surfaced in picture-specific clients rather than general micro-blogging clients. The thought is for events of this kind to be referenced in a Instagram/Flickr/Snapshat/9gag like nostr client where the picture itself is at the center of the experience.

## Picture Events

Picture events contain a `title` tag and description in the `.content`. 

They may contain multiple images to be displayed as a single post.

```jsonc
{
  "id": <32-bytes lowercase hex-encoded SHA-256 of the the serialized event data>,
  "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>,
  "created_at": <Unix timestamp in seconds>,
  "kind": 20,
  "content": "<description of post>",
  "tags": [
    ["title", "<short title of post>"],

    // Picture Data
    [
      "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"
    ],
    [
      "imeta",
      "url https://nostr.build/i/my-image2.jpg",
      "m image/jpeg",
      "blurhash eVF$^OI:${M{o#*0-nNFxakD-?xVM}WEWB%iNKxvR-oetmo#R-aen$",
      "dim 3024x4032",
      "alt Another scenic photo overlooking the coast of Costa Rica",
      "x <sha256 hash as specified in NIP 94>",
      "fallback https://nostrcheck.me/alt2.jpg",
      "fallback https://void.cat/alt2.jpg",

      "annotate-user <32-bytes hex of a pubkey>:<posX>:<posY>" // Tag users in specific locations in the picture
    ],

    ["content-warning", "<reason>"], // if NSFW

    // Tagged users
    ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>"],
    ["p", "<32-bytes hex of a pubkey>", "<optional recommended relay URL>"],

    // Specify the media type for filters to allow clients to filter by supported kinds
    ["m", "image/jpeg"]

    // Hashtags
    ["t", "<tag>"],
    ["t", "<tag>"],

    // location
    ["location", "<location>"], // city name, state, country
    ["g", "<geohash>"],

    // When text is written in the image, add the tag to represent the language
    ["L", "ISO-639-1"],
    ["l", "en", "ISO-639-1"]
  ]
}
```

The `imeta` tag `annotate-user` places a user link in the specific position in the image.

Only the following media types are accepted: 
- `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)

Picture events might be used with [NIP-71](71.md)'s kind `34236` to display short vertical videos in the same feed.