mirror of
https://github.com/nostr-protocol/nips.git
synced 2026-10-05 18:58:44 +00:00
Add claim management to nip 86 (#2408)
This commit is contained in:
@@ -143,23 +143,7 @@ Some examples:
|
|||||||
["OK", <event-id>, true, "info: welcome to wss://relay.bunk.skunk!"]
|
["OK", <event-id>, true, "info: welcome to wss://relay.bunk.skunk!"]
|
||||||
```
|
```
|
||||||
|
|
||||||
## Invite Request
|
Users can request a `claim` using the [NIP 86](./86.md) `createclaim` method.
|
||||||
|
|
||||||
Users may request a claim string from a relay by making a request for `kind 28935` events. This event MUST be signed by the pubkey specified in the `self` field of the relay's [NIP 11](./11.md) document.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
{
|
|
||||||
"kind": 28935,
|
|
||||||
"pubkey": "<nip11.self>",
|
|
||||||
"tags": [
|
|
||||||
["-"],
|
|
||||||
["claim", "<invite code>"],
|
|
||||||
],
|
|
||||||
// ...other fields
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Note that these events are in the `ephemeral` range, which means relays must explicitly opt-in to this behavior by generating claims on the fly when requested. This allows relays to improve security by issuing a different claim for each request, only issuing claims to certain users, or expiring claims.
|
|
||||||
|
|
||||||
## Leave Request
|
## Leave Request
|
||||||
|
|
||||||
|
|||||||
@@ -112,6 +112,27 @@ Removes a role from a pubkey.
|
|||||||
- params: `["<32-byte-hex-public-key>", "<role-id>"]`
|
- params: `["<32-byte-hex-public-key>", "<role-id>"]`
|
||||||
- result: `true` (a boolean always set to `true`)
|
- result: `true` (a boolean always set to `true`)
|
||||||
|
|
||||||
|
### `listclaims`
|
||||||
|
|
||||||
|
Lists [NIP 43](./43.md) invite codes currently accepted by the relay.
|
||||||
|
|
||||||
|
- params: `[]`
|
||||||
|
- result: `[claim, ...]`, an array of NIP 43 invite codes
|
||||||
|
|
||||||
|
### `createclaim`
|
||||||
|
|
||||||
|
Creates a new [NIP 43](./43.md) invite code.
|
||||||
|
|
||||||
|
- params: `[claim]`
|
||||||
|
- result: `true` (boolean true)
|
||||||
|
|
||||||
|
### `deleteclaim`
|
||||||
|
|
||||||
|
Revokes a [NIP 43](./43.md) invite code.
|
||||||
|
|
||||||
|
- params: `[claim]`
|
||||||
|
- result: `true` (boolean true)
|
||||||
|
|
||||||
### `listeventsneedingmoderation`
|
### `listeventsneedingmoderation`
|
||||||
|
|
||||||
Lists events awaiting moderation.
|
Lists events awaiting moderation.
|
||||||
|
|||||||
Reference in New Issue
Block a user