NIP-25: reactions to a website (#1381)

* NIP-25: reactions to a website

* add note about URL normalization

---------

Co-authored-by: fiatjaf_ <fiatjaf@gmail.com>
This commit is contained in:
Don 2024-08-09 00:36:08 +09:00 committed by GitHub
parent 6de688f459
commit 744bce8fca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 1 deletions

20
25.md
View File

@ -52,6 +52,26 @@ func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> Nost
}
```
Reactions to a website
---------------------
If the target of the reaction is a website, the reaction MUST be a `kind 17` event and MUST include an `r` tag with the website's URL.
```json
{
"kind": 17,
"content": "⭐",
"tags": [
["r", "https://example.com/"]
],
...other fields
}
```
URLs SHOULD be [normalized](https://datatracker.ietf.org/doc/html/rfc3986#section-6), so that reactions to the same website are not omitted from queries.
A fragment MAY be attached to the URL, to react to a section of the page.
It should be noted that a URL with a fragment is not considered to be the same URL as the original.
Custom Emoji Reaction
---------------------

View File

@ -109,6 +109,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `13` | Seal | [59](59.md) |
| `14` | Direct Message | [17](17.md) |
| `16` | Generic Repost | [18](18.md) |
| `17` | Reaction to a website | [25](25.md) |
| `40` | Channel Creation | [28](28.md) |
| `41` | Channel Metadata | [28](28.md) |
| `42` | Channel Message | [28](28.md) |
@ -245,7 +246,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
| `L` | label namespace | -- | [32](32.md) |
| `m` | MIME type | -- | [94](94.md) |
| `q` | event id (hex) | relay URL | [18](18.md) |
| `r` | a reference (URL, etc) | petname | [24](24.md) |
| `r` | a reference (URL, etc) | -- | [24](24.md), [25](25.md) |
| `r` | relay url | marker | [65](65.md) |
| `t` | hashtag | -- | |
| `alt` | summary | -- | [31](31.md) |