Update NIP-10 to clarify usage of reposts and quote posts

This commit is contained in:
Alex Gleason 2023-02-28 18:59:02 -06:00
parent b549a9809f
commit d147e6861f
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
3 changed files with 13 additions and 37 deletions

2
08.md
View File

@ -12,6 +12,6 @@ Clients that want to allow tagged mentions they MUST show an autocomplete compon
Once a mention is identified, for example, the pubkey `27866e9d854c78ae625b867eefdfa9580434bc3e675be08d2acb526610d96fbe`, the client MUST add that pubkey to the `.tags` with the tag `p`, then replace its textual reference (inside `.content`) with the notation `#[index]` in which "index" is equal to the 0-based index of the related tag in the tags array.
The same process applies for mentioning event IDs.
The same process is used to indicate related events. See NIP-10 for more information.
A client that receives a `text_note` event with such `#[index]` mentions in its `.content` CAN do a search-and-replace using the actual contents from the `.tags` array with the actual pubkey or event ID that is mentioned, doing any desired context augmentation (for example, linking to the pubkey or showing a preview of the mentioned event contents) it wants in the process.

46
10.md
View File

@ -1,57 +1,33 @@
NIP-10
======
On "e" and "p" tags in Text Events (kind 1).
Replies, Reposts, and Quote Posts in Text Events (kind 1).
--------------------------------------------
`draft` `optional` `author:unclebobmartin`
`draft` `optional` `author:unclebobmartin` `author:alexgleason`
## Abstract
This NIP describes how to use "e" and "p" tags in text events, especially those that are replies to other text events. It helps clients thread the replies into a tree rooted at the original event.
This NIP describes how to use "e" and "p" tags in text events to denote replies, reposts, and quote posts.
## Positional "e" tags (DEPRECATED)
>This scheme is in common use; but should be considered deprecated.
## The "e" tag
Used to associate an event with another event.
`["e", <event-id>, <relay-url>]` as per NIP-01.
Where:
* `<event-id>` is the id of the event being referenced.
* `<relay-url>` is the URL of a recommended relay associated with the reference. Many clients treat this field as optional.
**The positions of the "e" tags within the event denote specific meanings as follows**:
* No "e" tag: <br>
This event is not a reply to, nor does it refer to, any other event.
* One "e" tag: <br>
`["e", <id>]`: The id of the event to which this event is a reply.
* Two "e" tags: `["e", <root-id>]`, `["e", <reply-id>]` <br>
`<root-id>` is the id of the event at the root of the reply chain. `<reply-id>` is the id of the article to which this event is a reply.
* Many "e" tags: `["e", <root-id>]` `["e", <mention-id>]`, ..., `["e", <reply-id>]`<br>
There may be any number of `<mention-ids>`. These are the ids of events which may, or may not be in the reply chain.
They are citings from this event. `root-id` and `reply-id` are as above.
>This scheme is deprecated because it creates ambiguities that are difficult, or impossible to resolve when an event references another but is not a reply.
## Marked "e" tags (PREFERRED)
`["e", <event-id>, <relay-url>, <marker>]`
Where:
* `<event-id>` is the id of the event being referenced.
* `<relay-url>` is the URL of a recommended relay associated with the reference. Clients SHOULD add a valid `<relay-URL>` field, but may instead leave it as `""`.
* `<marker>` is optional and if present is one of `"reply"`, `"root"`, or `"mention"`.
* `<marker>` is one of `"reply"` or `"mention"`.
**The order of marked "e" tags is not relevant.** Those marked with `"reply"` denote the id of the reply event being responded to. Those marked with `"root"` denote the root id of the reply thread being responded to. For top level replies (those replying directly to the root event), only the `"root"` marker should be used. Those marked with `"mention"` denote a quoted or reposted event id.
`<marker>` MUST be one of the following:
A direct reply to the root of a thread should have a single marked "e" tag of type "root".
- `"reply"` - when the note is a reply, and the ID refers to its parent.
- `"mention"` - when the note is a quote post, and the ID refers to the quoted event.
>This scheme is preferred because it allows events to mention others without confusing them with `<reply-id>` or `<root-id>`.
When `"mention"` is used, the event content MUST include an index marker with the notation `#[index]` as specified in NIP-08, where the index matches the position of the `"e"` tag in the tags array. Note that a repost is a quote post without comment. For example, a quote post's content may look like `hello world\n#[0]`, while a repost would contain only `#[0]`.
Clients MUST NOT include multiple `"e"` tags with the same marker in an event. The order of "e" tags is not relevant.
## The "p" tag
Used in a text event contains a list of pubkeys used to record who is involved in a reply thread.

View File

@ -11,7 +11,7 @@ NIPs stand for **Nostr Implementation Possibilities**. They exist to document wh
- [NIP-07: `window.nostr` capability for web browsers](07.md)
- [NIP-08: Handling Mentions](08.md)
- [NIP-09: Event Deletion](09.md)
- [NIP-10: Conventions for clients' use of `e` and `p` tags in text events](10.md)
- [NIP-10: Replies, Reposts, and Quote Posts in text events](10.md)
- [NIP-11: Relay Information Document](11.md)
- [NIP-12: Generic Tag Queries](12.md)
- [NIP-13: Proof of Work](13.md)