Add claim management to nip 86 (#2408)

This commit is contained in:
hodlbod
2026-09-23 22:14:11 -03:00
committed by GitHub
parent 182a13e3be
commit 62d5feddb1
2 changed files with 22 additions and 17 deletions
+1 -17
View File
@@ -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
+21
View File
@@ -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.