diff --git a/kinds/5951.md b/kinds/5951.md new file mode 100644 index 0000000..f40717e --- /dev/null +++ b/kinds/5951.md @@ -0,0 +1,72 @@ +--- +layout: default +title: Relay Access Request +description: Request write-access to private relays +--- + +Clients can use this job to request access to private relays, either by mentioning a specific relay's NIP-11 pubkey, or by creating an empty request and relying on DVMs to suggest relays to the user. + +# Input + +The URL (eg `wss://relay.mostr.pub/`), if any. +If no input is provided, the client is relying on DVMs to suggest relays to the user. + +```js +[ "i", "", "text" ] +``` + +## Example request + +```js +{ + kind: 5951, + tags: [ + ["i", "wss://relay.mostr.pub/", "text"], + ["p", "66b4fefa1d29b0be53dbe0012f2d0461b3a03dcdbddd81fad2191261caa2104d"], + ] +} +``` + +# Params + +- `invite` - an optional invite code. Typically invite codes are given out by relay operators directly to users through side channels to grant immediate access. Care should be taken when using this option to either encrypt the request, or send it only to the one relay. + +```js +{ + kind: 5951, + tags: [ + ["i", "wss://relay.mostr.pub/", "text"], + ["param", "invite", "abcd..."], + ] +} +``` + +# Output + +The relay URL that was registered by the DVM for the user. + +## Example response + +```js +{ + kind: 6951, + content: "wss://relay.mostr.pub/", + tags: [ + ["request", "\"{...}\""], + ["i", "wss://relay.mostr.pub/", "text"], + ["e", "abcd..."], + ["p", "ef01..."], + ], +} +``` + +# Feedback + +The DVM may request payment from users, or reject the request for any reason. + +# Recommendations + +Relay operators can run a relay in whitelist mode, and then run a bot alongside it that processes kind `5951` requests and updates the whitelist. +Alternatively, relay developers could integrate such functionality directly into a relay. + +The DVMs pubkey MUST match the relay's NIP-11 pubkey. Clients may choose to check this before sending the request. \ No newline at end of file