Change wording to imply that reactions can target any event (#815)

* kind:17 generic reactions.

* `kind 7` is available for all kind events.

* `k` tag is not required.
This commit is contained in:
Don 2023-10-11 20:55:27 +09:00 committed by GitHub
parent 21c6c12c52
commit 324c7aafdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 42 deletions

6
25.md
View File

@ -7,7 +7,7 @@ Reactions
`draft` `optional` `author:jb55` `draft` `optional` `author:jb55`
A reaction is a `kind 7` note that is used to react to other notes. A reaction is a `kind 7` event that is used to react to other events.
The generic reaction, represented by the `content` set to a `+` string, SHOULD The generic reaction, represented by the `content` set to a `+` string, SHOULD
be interpreted as a "like" or "upvote". be interpreted as a "like" or "upvote".
@ -34,6 +34,9 @@ The last `e` tag MUST be the `id` of the note that is being reacted to.
The last `p` tag MUST be the `pubkey` of the event being reacted to. The last `p` tag MUST be the `pubkey` of the event being reacted to.
The reaction event MAY include a `k` tag with the stringified kind number
of the reacted event as its value.
Example code Example code
```swift ```swift
@ -43,6 +46,7 @@ func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> Nost
} }
tags.append(["e", liked.id]) tags.append(["e", liked.id])
tags.append(["p", liked.pubkey]) tags.append(["p", liked.pubkey])
tags.append(["k", liked.kind])
let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags) let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags)
ev.calculate_id() ev.calculate_id()
ev.sign(privkey: privkey) ev.sign(privkey: privkey)

View File

@ -156,47 +156,47 @@ Please update these lists when proposing NIPs introducing new event kinds.
## Standardized Tags ## Standardized Tags
| name | value | other parameters | NIP | | name | value | other parameters | NIP |
| ----------------- | ------------------------------------ | -------------------- | ------------------------ | | ----------------- | ------------------------------------ | -------------------- | ------------------------------------- |
| `e` | event id (hex) | relay URL, marker | [01](01.md), [10](10.md) | | `e` | event id (hex) | relay URL, marker | [01](01.md), [10](10.md) |
| `p` | pubkey (hex) | relay URL, petname | [01](01.md), [02](02.md) | | `p` | pubkey (hex) | relay URL, petname | [01](01.md), [02](02.md) |
| `a` | coordinates to an event | relay URL | [01](01.md) | | `a` | coordinates to an event | relay URL | [01](01.md) |
| `d` | identifier | -- | [01](01.md) | | `d` | identifier | -- | [01](01.md) |
| `alt` | summary | -- | [31](31.md) | | `alt` | summary | -- | [31](31.md) |
| `g` | geohash | -- | [52](52.md) | | `g` | geohash | -- | [52](52.md) |
| `i` | identity | proof | [39](39.md) | | `i` | identity | proof | [39](39.md) |
| `k` | kind number (string) | -- | [18](18.md), [72](72.md) | | `k` | kind number (string) | -- | [18](18.md), [25](25.md), [72](72.md) |
| `l` | label, label namespace | annotations | [32](32.md) | | `l` | label, label namespace | annotations | [32](32.md) |
| `L` | label namespace | -- | [32](32.md) | | `L` | label namespace | -- | [32](32.md) |
| `m` | MIME type | -- | [94](94.md) | | `m` | MIME type | -- | [94](94.md) |
| `r` | a reference (URL, etc) | petname | | | `r` | a reference (URL, etc) | petname | |
| `r` | relay url | marker | [65](65.md) | | `r` | relay url | marker | [65](65.md) |
| `t` | hashtag | -- | | | `t` | hashtag | -- | |
| `amount` | millisatoshis, stringified | -- | [57](57.md) | | `amount` | millisatoshis, stringified | -- | [57](57.md) |
| `bolt11` | `bolt11` invoice | -- | [57](57.md) | | `bolt11` | `bolt11` invoice | -- | [57](57.md) |
| `challenge` | challenge string | -- | [42](42.md) | | `challenge` | challenge string | -- | [42](42.md) |
| `content-warning` | reason | -- | [36](36.md) | | `content-warning` | reason | -- | [36](36.md) |
| `delegation` | pubkey, conditions, delegation token | -- | [26](26.md) | | `delegation` | pubkey, conditions, delegation token | -- | [26](26.md) |
| `description` | invoice/badge description | -- | [57](57.md), [58](58.md) | | `description` | invoice/badge description | -- | [57](57.md), [58](58.md) |
| `emoji` | shortcode, image URL | -- | [30](30.md) | | `emoji` | shortcode, image URL | -- | [30](30.md) |
| `expiration` | unix timestamp (string) | -- | [40](40.md) | | `expiration` | unix timestamp (string) | -- | [40](40.md) |
| `goal` | event id (hex) | relay URL | [75](75.md) | | `goal` | event id (hex) | relay URL | [75](75.md) |
| `image` | image URL | dimensions in pixels | [23](23.md), [58](58.md) | | `image` | image URL | dimensions in pixels | [23](23.md), [58](58.md) |
| `lnurl` | `bech32` encoded `lnurl` | -- | [57](57.md) | | `lnurl` | `bech32` encoded `lnurl` | -- | [57](57.md) |
| `location` | location string | -- | [52](52.md), [99](99.md) | | `location` | location string | -- | [52](52.md), [99](99.md) |
| `name` | badge name | -- | [58](58.md) | | `name` | badge name | -- | [58](58.md) |
| `nonce` | random | -- | [13](13.md) | | `nonce` | random | -- | [13](13.md) |
| `preimage` | hash of `bolt11` invoice | -- | [57](57.md) | | `preimage` | hash of `bolt11` invoice | -- | [57](57.md) |
| `price` | price | currency, frequency | [99](99.md) | | `price` | price | currency, frequency | [99](99.md) |
| `proxy` | external ID | protocol | [48](48.md) | | `proxy` | external ID | protocol | [48](48.md) |
| `published_at` | unix timestamp (string) | -- | [23](23.md) | | `published_at` | unix timestamp (string) | -- | [23](23.md) |
| `relay` | relay url | -- | [42](42.md) | | `relay` | relay url | -- | [42](42.md) |
| `relays` | relay list | -- | [57](57.md) | | `relays` | relay list | -- | [57](57.md) |
| `subject` | subject | -- | [14](14.md) | | `subject` | subject | -- | [14](14.md) |
| `summary` | article summary | -- | [23](23.md) | | `summary` | article summary | -- | [23](23.md) |
| `thumb` | badge thumbnail | dimensions in pixels | [58](58.md) | | `thumb` | badge thumbnail | dimensions in pixels | [58](58.md) |
| `title` | article title | -- | [23](23.md) | | `title` | article title | -- | [23](23.md) |
| `zap` | pubkey (hex), relay URL | weight | [57](57.md) | | `zap` | pubkey (hex), relay URL | weight | [57](57.md) |
## Criteria for acceptance of NIPs ## Criteria for acceptance of NIPs