rename nref to nitem and use the i tag.

This commit is contained in:
fiatjaf 2023-02-05 20:23:59 -03:00
parent 0acfd0e84b
commit 16b50a481f
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1
3 changed files with 13 additions and 14 deletions

8
19.md
View File

@ -35,7 +35,7 @@ These are the possible bech32 prefixes with `TLV`:
- `nprofile`: a nostr profile - `nprofile`: a nostr profile
- `nevent`: a nostr event - `nevent`: a nostr event
- `nrelay`: a nostr relay - `nrelay`: a nostr relay
- `nref`: a nostr parameterized replaceable event coordinate (NIP-33) - `nitem`: a nostr parameterized replaceable event coordinate (NIP-33)
These possible standardized `TLV` types are indicated here: These possible standardized `TLV` types are indicated here:
@ -44,12 +44,12 @@ These possible standardized `TLV` types are indicated here:
- for `nprofile` it will be the 32 bytes of the profile public key - for `nprofile` it will be the 32 bytes of the profile public key
- for `nevent` it will be the 32 bytes of the event id - for `nevent` it will be the 32 bytes of the event id
- for `nrelay`, this is the relay URL - for `nrelay`, this is the relay URL
- for `nref`, it is the identifier (the `"d"` tag) of the event being referenced - for `nitem`, it is the identifier (the `"d"` tag) of the event being referenced
- for `nprofile`, `nevent` and `nrelay` this may be included only once. - for `nprofile`, `nevent` and `nrelay` this may be included only once.
- `1`: `relay` - `1`: `relay`
- for `nprofile`, `nevent` and `nref`, 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 - for `nprofile`, `nevent` and `nitem`, 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
- `2`: `author` - `2`: `author`
- for `nref`, the 32 bytes of the pubkey of the event - for `nitem`, the 32 bytes of the pubkey of the event
## Examples ## Examples

15
23.md
View File

@ -24,13 +24,13 @@ These articles are meant to be editable, so they should make use of the replacea
### Linking ### Linking
The article may be linked to using the NIP-19 `nref` code along with the `"f"` tag (see NIP-33 and NIP-19). The article may be linked to using the NIP-19 `nitem` code along with the `"i"` tag (see NIP-33 and NIP-19).
### References ### References
Writing clients should implement support for parsing pasted NIP-19 `nref` 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](nref1...)`) 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]`). Writing clients should implement support for parsing pasted NIP-19 `nitem` 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](nitem1...)`) 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]`).
Reader 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:nref1...` links or direct links to web clients that will handle these references. Reader 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:nitem1...` links or direct links to web clients that will handle these references.
The 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. The 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.
@ -44,9 +44,9 @@ Article text:
title: Lorem Ipsum title: Lorem Ipsum
--- ---
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. Lorem [ipsum][3] 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.
Read more at #[3]. Read more at #[2].
``` ```
Derived event: Derived event:
@ -58,10 +58,9 @@ Derived event:
"title": "Lorem Ipsum\\n---\\n\\nLorem [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].", "title": "Lorem Ipsum\\n---\\n\\nLorem [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].",
"tags": [ "tags": [
["d", "lorem-ipsum"], ["d", "lorem-ipsum"],
["t", "lorem"], ["t", "plceholder"],
["t", "ipsum"],
["e", "b3e392b11f5d4f28321cedd09303a748acfd0487aea5a7450b3481c60b6e4f87", "wss://relay.example.com"], ["e", "b3e392b11f5d4f28321cedd09303a748acfd0487aea5a7450b3481c60b6e4f87", "wss://relay.example.com"],
["f", "a695f6b60119d9521934a691347d9f78e8770b56da16bb255ee286ddf9fda919:ipsum", "wss://relay.nostr.org"] ["i", "30023:a695f6b60119d9521934a691347d9f78e8770b56da16bb255ee286ddf9fda919:ipsum", "wss://relay.nostr.org"]
], ],
"pubkey": "...", "pubkey": "...",
"id": "..." "id": "..."

4
33.md
View File

@ -38,11 +38,11 @@ Normally (as per NIP-01, NIP-12) the `"p"` tag is used for referencing public ke
equivalents for event tags (i.e. an `nprofile` is generally translated into a tag equivalents for event tags (i.e. an `nprofile` is generally translated into a tag
`["p", "<event hex id>", "<relay url>"]`). `["p", "<event hex id>", "<relay url>"]`).
To support linking to parameterized replaceable events, the `nref` code is introduced on To support linking to parameterized replaceable events, the `nitem` code is introduced on
NIP-19. It includes the public key of the event author and the `d` tag (and relays) such that NIP-19. It includes the public key of the event author and the `d` tag (and relays) such that
the referenced combination of public key and `d` tag can be found. the referenced combination of public key and `d` tag can be found.
The equivalent in `tags` to the `nref` code is the tag `"f"`, comprised of `["f", "<pubkey>:<d-identifier>", "<relay url>"]`. The equivalent in `tags` to the `nitem` code is the tag `"i"`, comprised of `["i", "<kind>:<pubkey>:<d-identifier>", "<relay url>"]`.
Client Behavior Client Behavior
--------------- ---------------