mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-12-09 16:48:50 +00:00
Compare commits
8 Commits
alexgleaso
...
reaction-t
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23b069d469 | ||
|
|
1b86a40df4 | ||
|
|
7cc120ecb0 | ||
|
|
93d9a12f16 | ||
|
|
0b6b69bcc7 | ||
|
|
58287cd641 | ||
|
|
0f12cf111f | ||
|
|
619e3bea57 |
6
05.md
6
05.md
@@ -101,9 +101,3 @@ Users should ensure that their `/.well-known/nostr.json` is served with the HTTP
|
|||||||
The `/.well-known/nostr.json` endpoint MUST NOT return any HTTP redirects.
|
The `/.well-known/nostr.json` endpoint MUST NOT return any HTTP redirects.
|
||||||
|
|
||||||
Fetchers MUST ignore any HTTP redirects given by the `/.well-known/nostr.json` endpoint.
|
Fetchers MUST ignore any HTTP redirects given by the `/.well-known/nostr.json` endpoint.
|
||||||
|
|
||||||
### Implementing a NIP-05 server
|
|
||||||
|
|
||||||
NIP-05 is designed so that `nostr.json` can be hosted as a static file. But some services may allow users to sign up and be granted a NIP-05. The `nostr.json` is then served dynamically, depending on the `name` query parameter.
|
|
||||||
|
|
||||||
For these servers, the **case** of the localpart should be considered. It is recommended to make the lowercase representation unique in the database, so that two people cannot reserve the same name in different cases (eg `chad` vs `Chad`). Servers may then serve any case variation of the name, allowing users to freely change the case of their name. However, the name in the server's response MUST match the case provided by the `name` query parameter.
|
|
||||||
|
|||||||
19
25.md
19
25.md
@@ -25,26 +25,21 @@ consider it a "+".
|
|||||||
Tags
|
Tags
|
||||||
----
|
----
|
||||||
|
|
||||||
The reaction event SHOULD include `e` and `p` tags from the note the user is reacting to (and optionally `a` tags if the target is a replaceable event). This allows users to be notified of reactions to posts they were mentioned in. Including the `e` tags enables clients to pull all the reactions associated with individual posts or all the posts in a thread. `a` tags enables clients to seek reactions for all versions of a replaceable event.
|
There MUST be always an `e` tag set to the `id` of the event that is being reacted to. The `e` tag SHOULD include a relay hint pointing to a relay where the event being reacted to can be found. If a client decides to include other `e`, which not recommended, the target event `id` should be last of the `e` tags.
|
||||||
|
|
||||||
The last `e` tag MUST be the `id` of the note that is being reacted to.
|
The SHOULD be a `p` tag set to the `pubkey` of the event being reacted to. If a client decides to include other `p` tags, which not recommended, the target event `pubkey` should be last the `p` tags.
|
||||||
|
|
||||||
The last `p` tag MUST be the `pubkey` of the event being reacted to.
|
If the event being reacted to is an addressable event, an `a` SHOULD be included together with the `e` tag, it must be set to the coordinates (`kind:pubkey:d-tag`) of the event being reacted to.
|
||||||
|
|
||||||
The `a` tag MUST contain the coordinates (`kind:pubkey:d-tag`) of the replaceable being reacted to.
|
The reaction SHOULD include a `k` tag with the stringified kind number of the reacted event as its value.
|
||||||
|
|
||||||
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
|
||||||
func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent {
|
func make_like_event(pubkey: String, privkey: String, liked: NostrEvent) -> NostrEvent {
|
||||||
var tags: [[String]] = liked.tags.filter {
|
tags.append(["e", liked.id, liked.source_relays.first ?? ""])
|
||||||
tag in tag.count >= 2 && (tag[0] == "e" || tag[0] == "p")
|
|
||||||
}
|
|
||||||
tags.append(["e", liked.id])
|
|
||||||
tags.append(["p", liked.pubkey])
|
tags.append(["p", liked.pubkey])
|
||||||
tags.append(["k", liked.kind])
|
tags.append(["k", String(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)
|
||||||
|
|||||||
2
27.md
2
27.md
@@ -10,7 +10,7 @@ This document standardizes the treatment given by clients of inline references o
|
|||||||
|
|
||||||
When creating an event, clients should include mentions to other profiles and to other events in the middle of the `.content` using [NIP-21](21.md) codes, such as `nostr:nprofile1qqsw3dy8cpu...6x2argwghx6egsqstvg`.
|
When creating an event, clients should include mentions to other profiles and to other events in the middle of the `.content` using [NIP-21](21.md) codes, such as `nostr:nprofile1qqsw3dy8cpu...6x2argwghx6egsqstvg`.
|
||||||
|
|
||||||
Including [NIP-10](10.md)-style tags (`["e", <hex-id>, <relay-url>, <marker>]`) for each reference is optional, clients should do it whenever they want the profile being mentioned to be notified of the mention, or when they want the referenced event to recognize their mention as a reply.
|
Including [NIP-18](18.md)'s quote tags (`["q", "<event-id> or <event-address>", "<relay-url>", "<pubkey-if-a-regular-event>"]`) for each reference is optional, clients should do it whenever they want the profile being mentioned to be notified of the mention, or when they want the referenced event to recognize their mention as a reply.
|
||||||
|
|
||||||
A reader client that receives an event with such `nostr:...` mentions in its `.content` can do any desired context augmentation (for example, linking to the profile or showing a preview of the mentioned event contents) it wants in the process. If turning such mentions into links, they could become internal links, [NIP-21](21.md) links or direct links to web clients that will handle these references.
|
A reader client that receives an event with such `nostr:...` mentions in its `.content` can do any desired context augmentation (for example, linking to the profile or showing a preview of the mentioned event contents) it wants in the process. If turning such mentions into links, they could become internal links, [NIP-21](21.md) links or direct links to web clients that will handle these references.
|
||||||
|
|
||||||
|
|||||||
7
34.md
7
34.md
@@ -22,9 +22,10 @@ Git repositories are hosted in Git-enabled servers, but their existence can be a
|
|||||||
["description", "brief human-readable project description>"],
|
["description", "brief human-readable project description>"],
|
||||||
["web", "<url for browsing>", ...], // a webpage url, if the git server being used provides such a thing
|
["web", "<url for browsing>", ...], // a webpage url, if the git server being used provides such a thing
|
||||||
["clone", "<url for git-cloning>", ...], // a url to be given to `git clone` so anyone can clone it
|
["clone", "<url for git-cloning>", ...], // a url to be given to `git clone` so anyone can clone it
|
||||||
["relays", "<relay-url>", ...] // relays that this repository will monitor for patches and issues
|
["relays", "<relay-url>", ...], // relays that this repository will monitor for patches and issues
|
||||||
["r", "<earliest-unique-commit-id>", "euc"]
|
["r", "<earliest-unique-commit-id>", "euc"],
|
||||||
["maintainers", "<other-recognized-maintainer>", ...]
|
["maintainers", "<other-recognized-maintainer>", ...],
|
||||||
|
["t", "<arbitrary string>"], // hashtags labelling the repository
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
8
53.md
8
53.md
@@ -63,7 +63,7 @@ This feature is important to avoid malicious event owners adding large account h
|
|||||||
|
|
||||||
### Live Chat Message
|
### Live Chat Message
|
||||||
|
|
||||||
Event `kind:1311` is live chat's channel message. Clients MUST include the `a` tag of the activity with a `root` marker. Other Kind-1 tags such as `reply` and `mention` can also be used.
|
Event `kind:1311` is live chat's channel message. Clients MUST include the `a` tag of the activity. An `e` tag denotes the direct parent message this post is replying to.
|
||||||
|
|
||||||
```jsonc
|
```jsonc
|
||||||
{
|
{
|
||||||
@@ -76,6 +76,12 @@ Event `kind:1311` is live chat's channel message. Clients MUST include the `a` t
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
`q` tags MAY be used when citing events in the `.content` with [NIP-21](21.md).
|
||||||
|
|
||||||
|
```json
|
||||||
|
["q", "<event-id> or <event-address>", "<relay-url>", "<pubkey-if-a-regular-event>"]
|
||||||
|
```
|
||||||
|
|
||||||
Hosts may choose to pin one or more live chat messages by updating the `pinned` tags in the live event kind `30311`.
|
Hosts may choose to pin one or more live chat messages by updating the `pinned` tags in the live event kind `30311`.
|
||||||
|
|
||||||
## Use Cases
|
## Use Cases
|
||||||
|
|||||||
61
62.md
Normal file
61
62.md
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
NIP-62
|
||||||
|
======
|
||||||
|
|
||||||
|
Request to Vanish
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
`draft` `optional`
|
||||||
|
|
||||||
|
This NIP offers a Nostr-native way to request a complete reset of a key's fingerprint on the web. This procedure is legally binding in some jurisdictions, and thus, supporters of this NIP should truly delete events from their database.
|
||||||
|
|
||||||
|
## Request to Vanish from Relay
|
||||||
|
|
||||||
|
Kind `62` requests a specific relay to delete everything, including [NIP-09](09.md) Deletion Events, from the `.pubkey` until its `.created_at`.
|
||||||
|
|
||||||
|
```jsonc
|
||||||
|
{
|
||||||
|
"kind": 62,
|
||||||
|
"pubkey": <32-byte hex-encoded public key of the event creator>,
|
||||||
|
"tags": [
|
||||||
|
["relay", "<relay url>"]
|
||||||
|
],
|
||||||
|
"content": "<reason or note>",
|
||||||
|
//...other fields
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The tag list MUST include at least one `relay` value.
|
||||||
|
|
||||||
|
Content MAY include a reason or a legal notice to the relay operator.
|
||||||
|
|
||||||
|
Relays MUST fully delete any events from the `.pubkey` if their service URL is tagged in the event.
|
||||||
|
|
||||||
|
Relays SHOULD delete all [NIP-59](59.md) Gift Wraps that p-tagged the `.pubkey` if their service URL is tagged in the event, deleting all DMs to the pubkey.
|
||||||
|
|
||||||
|
Relays MUST ensure the deleted events cannot be re-broadcasted into the relay.
|
||||||
|
|
||||||
|
Relays MAY store the signed request to vanish for bookkeeping.
|
||||||
|
|
||||||
|
Paid relays or relays that restrict who can post MUST also follow the request to vanish regardless of the user's status.
|
||||||
|
|
||||||
|
Publishing a deletion request event (Kind `5`) against a request to vanish has no effect. Clients and relays are not obliged to support "unrequest vanish" functionality.
|
||||||
|
|
||||||
|
Clients SHOULD send this event to the target relays only.
|
||||||
|
|
||||||
|
## Global Request to Vanish
|
||||||
|
|
||||||
|
To request ALL relays to delete everything, the event MUST include a `relay` tag with the value `ALL_RELAYS` in uppercase.
|
||||||
|
|
||||||
|
```jsonc
|
||||||
|
{
|
||||||
|
"kind": 62,
|
||||||
|
"pubkey": <32-byte hex-encoded public key of the event creator>,
|
||||||
|
"tags": [
|
||||||
|
["relay", "ALL_RELAYS"]
|
||||||
|
],
|
||||||
|
"content": "<reason>",
|
||||||
|
//...other fields
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Clients SHOULD broadcast this event to as many relays as possible.
|
||||||
@@ -5,6 +5,8 @@ reverse chronological order.
|
|||||||
|
|
||||||
| Date | Commit | NIP | Change |
|
| Date | Commit | NIP | Change |
|
||||||
| ----------- | --------- | -------- | ------ |
|
| ----------- | --------- | -------- | ------ |
|
||||||
|
| 2025-02-14 | [81908b6e](https://github.com/nostr-protocol/nips/commit/81908b6e) | [07](07.md), [46](46.md), [55](55.md) | `getRelays` and `get_relays` were removed |
|
||||||
|
| 2025-02-07 | [0023ca81](https://github.com/nostr-protocol/nips/commit/0023ca81) | [10](10.md) | `"mention"` marker was removed |
|
||||||
| 2025-01-31 | [6a4b125a](https://github.com/nostr-protocol/nips/commit/6a4b125a) | [71](71.md) | video events were changed to regular |
|
| 2025-01-31 | [6a4b125a](https://github.com/nostr-protocol/nips/commit/6a4b125a) | [71](71.md) | video events were changed to regular |
|
||||||
| 2024-12-05 | [6d16019e](https://github.com/nostr-protocol/nips/commit/6d16019e) | [46](46.md) | message encryption was changed to NIP-44 |
|
| 2024-12-05 | [6d16019e](https://github.com/nostr-protocol/nips/commit/6d16019e) | [46](46.md) | message encryption was changed to NIP-44 |
|
||||||
| 2024-11-12 | [2838e3bd](https://github.com/nostr-protocol/nips/commit/2838e3bd) | [29](29.md) | `kind: 12` and `kind: 10` were removed (use `kind: 1111` instead) |
|
| 2024-11-12 | [2838e3bd](https://github.com/nostr-protocol/nips/commit/2838e3bd) | [29](29.md) | `kind: 12` and `kind: 10` were removed (use `kind: 1111` instead) |
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
|||||||
- [NIP-59: Gift Wrap](59.md)
|
- [NIP-59: Gift Wrap](59.md)
|
||||||
- [NIP-60: Cashu Wallet](60.md)
|
- [NIP-60: Cashu Wallet](60.md)
|
||||||
- [NIP-61: Nutzaps](61.md)
|
- [NIP-61: Nutzaps](61.md)
|
||||||
|
- [NIP-62: Request to Vanish](62.md)
|
||||||
- [NIP-64: Chess (PGN)](64.md)
|
- [NIP-64: Chess (PGN)](64.md)
|
||||||
- [NIP-65: Relay List Metadata](65.md)
|
- [NIP-65: Relay List Metadata](65.md)
|
||||||
- [NIP-68: Picture-first feeds](68.md)
|
- [NIP-68: Picture-first feeds](68.md)
|
||||||
@@ -130,6 +131,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
|||||||
| `42` | Channel Message | [28](28.md) |
|
| `42` | Channel Message | [28](28.md) |
|
||||||
| `43` | Channel Hide Message | [28](28.md) |
|
| `43` | Channel Hide Message | [28](28.md) |
|
||||||
| `44` | Channel Mute User | [28](28.md) |
|
| `44` | Channel Mute User | [28](28.md) |
|
||||||
|
| `62` | Request to Vanish | [62](62.md) |
|
||||||
| `64` | Chess (PGN) | [64](64.md) |
|
| `64` | Chess (PGN) | [64](64.md) |
|
||||||
| `818` | Merge Requests | [54](54.md) |
|
| `818` | Merge Requests | [54](54.md) |
|
||||||
| `1018` | Poll Response | [88](88.md) |
|
| `1018` | Poll Response | [88](88.md) |
|
||||||
@@ -299,7 +301,7 @@ They exist to document what may be implemented by [Nostr](https://github.com/nos
|
|||||||
| `s` | status | -- | [69](69.md) |
|
| `s` | status | -- | [69](69.md) |
|
||||||
| `t` | hashtag | -- | [24](24.md), [34](34.md), [35](35.md) |
|
| `t` | hashtag | -- | [24](24.md), [34](34.md), [35](35.md) |
|
||||||
| `u` | url | -- | [61](61.md), [98](98.md) |
|
| `u` | url | -- | [61](61.md), [98](98.md) |
|
||||||
| `x` | infohash | -- | [35](35.md) |
|
| `x` | hash | -- | [35](35.md), [56](56.md) |
|
||||||
| `y` | platform | -- | [69](69.md) |
|
| `y` | platform | -- | [69](69.md) |
|
||||||
| `z` | order number | -- | [69](69.md) |
|
| `z` | order number | -- | [69](69.md) |
|
||||||
| `-` | -- | -- | [70](70.md) |
|
| `-` | -- | -- | [70](70.md) |
|
||||||
|
|||||||
Reference in New Issue
Block a user