Add kind to i reference

This commit is contained in:
arthurfranca 2024-05-15 18:13:59 -03:00
parent 1c34174ef0
commit 61addbd271

12
22.md
View File

@ -23,11 +23,13 @@ It must have a `k` tag pointing to the kind of the subject being commented on.
For example, when commenting on a `kind:30023`, the `k` tag is set to "30023".
When replying to another `kind:1111`, the `k` tag is set to "1111".
If commenting on an `https://abc.com/articles/1` artcile the `k` tag is set to "https://abc.com" (its domain).
The `k` tag is useful to fetch top-level comments about events of specific kinds (or domains), for example,
by filtering with `{ "#k": ["30023"], "kinds": [1111] }`.
### Threads
There is always an `o` tag pointing to the original post that started the thread.
It can be an event id (with an `"i:<event-pubkey>:"` prefix),
It can be an event id (with an `"i:<event-kind>:<event-pubkey>:"` prefix),
an event address (`"a:"` prefix) or an url (`"<protocol>"` prefix). The second value
is the optional recommended relay url where the referenced event may be found.
This tag is useful to load all messages of a thread at once.
@ -36,8 +38,8 @@ Note that if commenting on a replaceable event, one can choose to add both id an
Examples:
- `["o", "i:<event-pubkey>:<event-id>", "<relay-url, optional>"]`
- `["o", "a:<event-address>", "<relay-url, optional>"]`
- `["o", "i:<event-kind>:<event-pubkey>:<event-id>", "<relay-url, optional>"]`
- `["o", "a:<event-kind>:<event-pubkey>:<d-tag, optional>", "<relay-url, optional>"]`
- `["o", "https://abc.com/articles/1/"]`
Also, there is always an `r` tag pointing to the subject being directly commented on or replied to, using the
@ -54,13 +56,13 @@ the client supports the [NIP-65](65.md) relay usage spec,
```js
{
kind: 1111,
w: 1111,
content: 'Agree with your comment.',
tags: [
// referencing the OP
["o", "https://abc.com/articles/1/"],
// replying to a parent kind:1111 comment
["r", "i:f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca:5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"],
["r", "i:1111:f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca:5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36"],
// the parent kind
["k", "1111"]
]