upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--19.md15
-rw-r--r--23.md64
-rw-r--r--33.md18
-rw-r--r--README.md3
4 files changed, 93 insertions, 7 deletions
diff --git a/19.md b/19.md
index e63ca00..ab3b578 100644
--- a/19.md
+++ b/19.md
@@ -35,6 +35,7 @@ These are the possible bech32 prefixes with `TLV`:
35 - `nprofile`: a nostr profile 35 - `nprofile`: a nostr profile
36 - `nevent`: a nostr event 36 - `nevent`: a nostr event
37 - `nrelay`: a nostr relay 37 - `nrelay`: a nostr relay
38 - `naddr`: a nostr parameterized replaceable event coordinate (NIP-33)
38 39
39These possible standardized `TLV` types are indicated here: 40These possible standardized `TLV` types are indicated here:
40 41
@@ -42,11 +43,17 @@ These possible standardized `TLV` types are indicated here:
42 - depends on the bech32 prefix: 43 - depends on the bech32 prefix:
43 - for `nprofile` it will be the 32 bytes of the profile public key 44 - for `nprofile` it will be the 32 bytes of the profile public key
44 - for `nevent` it will be the 32 bytes of the event id 45 - for `nevent` it will be the 32 bytes of the event id
45 - for `nrelay`, this is the relay URL. 46 - for `nrelay`, this is the relay URL
46 - for `nprofile`, `nevent` and `nrelay` this may be included only once. 47 - for `naddr`, it is the identifier (the `"d"` tag) of the event being referenced
47- `1`: `relay` 48- `1`: `relay`
48 - A relay in which the entity (profile or event) is more likely to be found, encoded as UTF-8. This may be included multiple times. 49 - for `nprofile`, `nevent` and `naddr`, a relay in which the entity (profile or event) is more likely to be found, encoded as ascii
49 - not applicable to `nrelay`. 50 - this may be included multiple times
51- `2`: `author`
52 - for `naddr`, the 32 bytes of the pubkey of the event
53- `3`: `kind`
54 - for `naddr`, the 32-bit unsigned integer of the kind, big-endian
55
56
50## Examples 57## Examples
51 58
52- `npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6` should decode into the public key hex `3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d` and vice-versa 59- `npub180cvv07tjdrrgpa0j7j7tmnyl2yr6yr7l8j4s3evf6u64th6gkwsyjh6w6` should decode into the public key hex `3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d` and vice-versa
diff --git a/23.md b/23.md
new file mode 100644
index 0000000..0648a35
--- /dev/null
+++ b/23.md
@@ -0,0 +1,64 @@
1NIP-23
2======
3
4Long-form Content
5-----------------
6
7`draft` `optional` `author:fiatjaf`
8
9This NIP defines `kind:30023` (a parameterized replaceable event according to NIP-33) for long-form text content, generally referred to as "articles" or "blog posts".
10
11"Social" clients that deal primarily with `kind:1` notes should not be expected to implement this NIP.
12
13### Format
14
15The `.content` of these events should be a string text in Markdown syntax.
16
17### Metadata
18
19For the date of the last update the `.created_at` field should be used, for "tags"/"hashtags" (i.e. topics about which the event might be of relevance) the `"t"` event tag should be used, as per NIP-12.
20
21Other metadata fields can be added as tags to the event as necessary. Here we standardize 4 that may be useful, although they remain strictly optional:
22
23- `"title"`, for the article title
24- `"image"`, for a URL pointing to an image to be shown along with the title
25- `"summary"`, for the article summary
26- `"published_at"`, for the timestamp in unix seconds (stringified) of the first time the article was published
27
28### Editability
29
30These articles are meant to be editable, so they should make use of the replaceability feature of NIP-33 and include a `"d"` tag with an identifier for the article. Clients should take care to only publish and read these events from relays that implement that. If they don't do that they should also take care to hide old versions of the same article they may receive.
31
32### Linking
33
34The article may be linked to using the NIP-19 `naddr` code along with the `"a"` tag (see NIP-33 and NIP-19).
35
36### References
37
38Clients that support publishing NIP-23 events should implement support for parsing pasted NIP-19 `naddr` identifiers and adding them automatically to the list of `.tags` of the event, replacing the actual content with a string like `#[tag_index]` in the same way as NIP-08 -- or, if the reference is in the form of a URL (for example, `[click here](naddr1...)`) then they should be replaced with just the tag number directly as if link with that name existed at the bottom of the Markdown (for example, `[click here][0]`).
39
40Reader clients should parse the Markdown and replace these references with either internal links so the referenced events can be accessed directly, with NIP-21 `nostr:naddr1...` links or direct links to web clients that will handle these references.
41
42The idea here is that having these tags is that reader clients can display a list of backreferences at the bottom when one article mentions another.
43
44The same principles can be applied to `nevent1...`, `note1...`, `nprofile1...` or `npub1...`.
45
46## Example Event
47
48```json
49{
50 "kind": 30023,
51 "created_at": 1675642635,
52 "content": "Lorem [ipsum][4] dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.\n\nRead more at #[3].",
53 "tags": [
54 ["d", "lorem-ipsum"],
55 ["title", "Lorem Ipsum"],
56 ["published_at", "1296962229"],
57 ["t", "placeholder"],
58 ["e", "b3e392b11f5d4f28321cedd09303a748acfd0487aea5a7450b3481c60b6e4f87", "wss://relay.example.com"],
59 ["a", "30023:a695f6b60119d9521934a691347d9f78e8770b56da16bb255ee286ddf9fda919:ipsum", "wss://relay.nostr.org"]
60 ],
61 "pubkey": "...",
62 "id": "..."
63}
64```
diff --git a/33.md b/33.md
index 6b05bd0..409ce4f 100644
--- a/33.md
+++ b/33.md
@@ -12,10 +12,10 @@ Implementation
12-------------- 12--------------
13The value of a tag is defined as the first parameter of a tag after the tag name. 13The value of a tag is defined as the first parameter of a tag after the tag name.
14 14
15A *parameterized replaceable event* is defined as an event with a kind `30000 <= n < 40000`. 15A *parameterized replaceable event* is defined as an event with a kind `30000 <= n < 40000`.
16Upon a parameterized replaceable event with a newer timestamp than the currently known latest 16Upon a parameterized replaceable event with a newer timestamp than the currently known latest
17replaceable event with the same kind and first `d` tag value being received, the old event 17replaceable event with the same kind and first `d` tag value being received, the old event
18SHOULD be discarded and replaced with the newer event. 18SHOULD be discarded and replaced with the newer event.
19A missing or a `d` tag with no value should be interpreted equivalent to a `d` tag with the 19A missing or a `d` tag with no value should be interpreted equivalent to a `d` tag with the
20value as an empty string. Events from the same author with any of the following `tags` 20value as an empty string. Events from the same author with any of the following `tags`
21replace each other: 21replace each other:
@@ -30,6 +30,20 @@ replace each other:
30 30
31Clients SHOULD NOT use `d` tags with multiple values and SHOULD include the `d` tag even if it has no value to allow querying using the `#d` filter. 31Clients SHOULD NOT use `d` tags with multiple values and SHOULD include the `d` tag even if it has no value to allow querying using the `#d` filter.
32 32
33Referencing and tagging
34-----------------------
35
36Normally (as per NIP-01, NIP-12) the `"p"` tag is used for referencing public keys and the
37`"e"` tag for referencing event ids and the `note`, `npub`, `nprofile` or `nevent` are their
38equivalents for event tags (i.e. an `nprofile` is generally translated into a tag
39`["p", "<event hex id>", "<relay url>"]`).
40
41To support linking to parameterized replaceable events, the `naddr` code is introduced on
42NIP-19. It includes the public key of the event author and the `d` tag (and relays) such that
43the referenced combination of public key and `d` tag can be found.
44
45The equivalent in `tags` to the `naddr` code is the tag `"a"`, comprised of `["a", "<kind>:<pubkey>:<d-identifier>", "<relay url>"]`.
46
33Client Behavior 47Client Behavior
34--------------- 48---------------
35 49
diff --git a/README.md b/README.md
index d4e3c04..c88d949 100644
--- a/README.md
+++ b/README.md
@@ -35,7 +35,6 @@ NIPs stand for **Nostr Implementation Possibilities**. They exist to document wh
35- [NIP-65: Relay List Metadata](65.md) 35- [NIP-65: Relay List Metadata](65.md)
36 36
37## Event Kinds 37## Event Kinds
38
39| kind | description | NIP | 38| kind | description | NIP |
40| ------------- | -------------------------------- | ----------------------- | 39| ------------- | -------------------------------- | ----------------------- |
41| 0 | Metadata | [1](01.md), [5](05.md) | 40| 0 | Metadata | [1](01.md), [5](05.md) |
@@ -56,6 +55,7 @@ NIPs stand for **Nostr Implementation Possibilities**. They exist to document wh
56| 9735 | Zap | [57](57.md) | 55| 9735 | Zap | [57](57.md) |
57| 10002 | Relay List Metadata | [65](65.md) | 56| 10002 | Relay List Metadata | [65](65.md) |
58| 22242 | Client Authentication | [42](42.md) | 57| 22242 | Client Authentication | [42](42.md) |
58| 30023 | Long-form Content | [23](23.md) |
59| 1000-9999 | Regular Events | [16](16.md) | 59| 1000-9999 | Regular Events | [16](16.md) |
60| 10000-19999 | Replaceable Events | [16](16.md) | 60| 10000-19999 | Replaceable Events | [16](16.md) |
61| 20000-29999 | Ephemeral Events | [16](16.md) | 61| 20000-29999 | Ephemeral Events | [16](16.md) |
@@ -92,6 +92,7 @@ When experimenting with kinds, keep in mind the classification introduced by [NI
92| ---------- | ----------------------- | ----------------- | ------------------------ | 92| ---------- | ----------------------- | ----------------- | ------------------------ |
93| e | event id (hex) | relay URL, marker | [1](01.md), [10](10.md) | 93| e | event id (hex) | relay URL, marker | [1](01.md), [10](10.md) |
94| p | pubkey (hex) | relay URL | [1](01.md) | 94| p | pubkey (hex) | relay URL | [1](01.md) |
95| a | coordinates to an event | relay URL | [33](33.md), [23](23.md) |
95| r | a reference (URL, etc) | | [12](12.md) | 96| r | a reference (URL, etc) | | [12](12.md) |
96| t | hashtag | | [12](12.md) | 97| t | hashtag | | [12](12.md) |
97| g | geohash | | [12](12.md) | 98| g | geohash | | [12](12.md) |