{"id":"d803e5e6e60f5cd21e028af9c11a341c90e6b1149b6e131d40dd8c928122a4a0","pubkey":"2b39b4ffe62933df970e19366c22c1e092f953f83fcfed754e0f04d5a3b459f9","created_at":1782756665,"kind":30817,"tags":[["d","nip-43"],["title","NIP-43: Relay Access Metadata and Requests"],["summary","How a relay advertises the roles it grants and the membership it enforces, and how a client asks to be admitted."],["s","draft"],["t","nostr"],["t","nip"],["k","8000","Add User"],["k","8001","Remove User"],["k","13534","Membership Lists"],["k","28934","Join Request"],["k","28935","Invite Request"],["k","28936","Leave Request"],["alt","A specification: NIP-43: Relay Access Metadata and Requests"],["client","openspecs-import"],["published_at","1761821088"],["proxy","https://github.com/nostr-protocol/nips/blob/656cecc7c0a815b6a2b218d3b5d6f078b3f4dbab/43.md","web"],["x","5c312a5e708d7462bc0d33c57edfb37fff0684c23e625d68675e4e59c1afe2b7"]],"content":"NIP-43\n======\n\nRelay Access Metadata and Requests\n----------------------------------\n\n`draft` `optional` `relay`\n\nThis NIP defines a way for relays to advertise membership lists, and for clients to request admission to relays on behalf of users.\n\n## Role Definitions\n\nRelays MAY publish a `kind 33534` event which defines a role which may be assigned to members. This event MUST be signed by the pubkey specified in the `self` field of the relay's [NIP 11](nostr:naddr1qvzqqqrcvypzq2eeknl7v2fnm7tsuxfkds3vrcyjl9fls070a465urcy6k3mgk0eqqrxu6ts95cnzjt5dcs) document.\n\nThe following tags are required:\n\n- A [NIP 70](nostr:naddr1qvzqqqrcvypzq2eeknl7v2fnm7tsuxfkds3vrcyjl9fls070a465urcy6k3mgk0eqqrxu6ts95mnq8gw7fu) `-` tag\n- The event's `d` tag defines the role id.\n\nThe following tags are optional:\n\n- `label` - a label for the role.\n- `description` - a description of the role.\n- `color` - a `hue` value from `0` to `360` for the role.\n- `order` - a `order` integer for the role (for client display only).\n\n```yaml\n{\n  \"kind\": 33534,\n  \"pubkey\": \"<nip11.self>\",\n  \"tags\": [\n    [\"-\"],\n    [\"d\", \"28b7e50f\"],\n    [\"label\", \"king\"],\n    [\"description\", \"ruler of the relay\"],\n    [\"color\", \"37\"],\n    [\"order\", \"1\"],\n  ],\n  // ...other fields\n}\n```\n\nRelays MAY treat members with a given role differently in terms of relay access policies, but no mechanism for introspection is defined at this time.\n\n## Membership Lists\n\nRelays MAY publish a `kind 13534` event which indicates pubkeys that have access to a given relay. This event MUST be signed by the pubkey specified in the `self` field of the relay's [NIP 11](nostr:naddr1qvzqqqrcvypzq2eeknl7v2fnm7tsuxfkds3vrcyjl9fls070a465urcy6k3mgk0eqqrxu6ts95cnzjt5dcs) document.\n\nThe following tags are required:\n\n- A [NIP 70](nostr:naddr1qvzqqqrcvypzq2eeknl7v2fnm7tsuxfkds3vrcyjl9fls070a465urcy6k3mgk0eqqrxu6ts95mnq8gw7fu) `-` tag\n- A `member` tag containing a hex pubkey should be included for each member. Assigned roles may be included as subsequent arguments.\n\nThis list should not be considered exhaustive or authoritative. To determine membership, both a `kind 13534` event by the relay, and a `kind 10010` event by the member should be consulted.\n\nExample:\n\n```yaml\n{\n  \"kind\": 13534,\n  \"pubkey\": \"<nip11.self>\",\n  \"tags\": [\n    [\"-\"],\n    [\"member\", \"c308e1f882c1f1dff2a43d4294239ddeec04e575f2d1aad1fa21ea7684e61fb5\"],\n    [\"member\", \"ee1d336e13779e4d4c527b988429d96de16088f958cbf6c074676ac9cfd9c958\", \"28b7e50f\"]\n  ],\n  // ...other fields\n}\n```\n\n## Add User\n\nRelays MAY publish a `kind 8000` event when a member is added to the relay. This event MUST be signed by the pubkey specified in the `self` field of the relay's [NIP 11](nostr:naddr1qvzqqqrcvypzq2eeknl7v2fnm7tsuxfkds3vrcyjl9fls070a465urcy6k3mgk0eqqrxu6ts95cnzjt5dcs) document.\n\nThe following tags are required:\n\n- A [NIP 70](nostr:naddr1qvzqqqrcvypzq2eeknl7v2fnm7tsuxfkds3vrcyjl9fls070a465urcy6k3mgk0eqqrxu6ts95mnq8gw7fu) `-` tag\n- A `p` tag indicating the member's hex pubkey\n\nExample:\n\n```yaml\n{\n  \"kind\": 8000,\n  \"pubkey\": \"<nip11.self>\",\n  \"tags\": [\n    [\"-\"],\n    [\"p\", \"c308e1f882c1f1dff2a43d4294239ddeec04e575f2d1aad1fa21ea7684e61fb5\"]\n  ],\n  // ...other fields\n}\n```\n\n## Remove User\n\nRelays MAY publish a `kind 8001` event when a member is removed from the relay. This event MUST be signed by the pubkey specified in the `self` field of the relay's [NIP 11](nostr:naddr1qvzqqqrcvypzq2eeknl7v2fnm7tsuxfkds3vrcyjl9fls070a465urcy6k3mgk0eqqrxu6ts95cnzjt5dcs) document.\n\nThe following tags are required:\n\n- A [NIP 70](nostr:naddr1qvzqqqrcvypzq2eeknl7v2fnm7tsuxfkds3vrcyjl9fls070a465urcy6k3mgk0eqqrxu6ts95mnq8gw7fu) `-` tag\n- A `p` tag indicating the member's hex pubkey\n\nExample:\n\n```yaml\n{\n  \"kind\": 8001,\n  \"pubkey\": \"<nip11.self>\",\n  \"tags\": [\n    [\"-\"],\n    [\"p\", \"c308e1f882c1f1dff2a43d4294239ddeec04e575f2d1aad1fa21ea7684e61fb5\"]\n  ],\n  // ...other fields\n}\n```\n\n## Join Request\n\nA user MAY send a `kind 28934` to a relay in order to request admission. It MUST have a `claim` tag containing an invite code. The event's `created_at` MUST be now, plus or minus a few minutes.\n\n```yaml\n{\n  \"kind\": 28934,\n  \"pubkey\": \"<user pubkey>\",\n  \"tags\": [\n    [\"-\"],\n    [\"claim\", \"<invite code>\"]\n  ],\n  // ...other fields\n}\n```\n\nUpon receiving a claim, a relay MUST notify the client as to what the status of the claim is using an `OK` message. Failed claims SHOULD use the same standard `\"restricted: \"` prefix specified by NIP 42.\n\nRelays SHOULD update their `kind 13534` member list and MAY publish a `kind 8000` \"add member\" event.\n\nSome examples:\n\n```\n[\"OK\", <event-id>, false, \"restricted: that invite code is expired.\"]\n[\"OK\", <event-id>, false, \"restricted: that is an invalid invite code.\"]\n[\"OK\", <event-id>, true, \"duplicate: you are already a member of this relay.\"]\n[\"OK\", <event-id>, true, \"info: welcome to wss://relay.bunk.skunk!\"]\n```\n\n## Invite Request\n\nUsers 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](nostr:naddr1qvzqqqrcvypzq2eeknl7v2fnm7tsuxfkds3vrcyjl9fls070a465urcy6k3mgk0eqqrxu6ts95cnzjt5dcs) document.\n\n```yaml\n{\n  \"kind\": 28935,\n  \"pubkey\": \"<nip11.self>\",\n  \"tags\": [\n    [\"-\"],\n    [\"claim\", \"<invite code>\"],\n  ],\n  // ...other fields\n}\n```\n\nNote 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.\n\n## Leave Request\n\nA user MAY send a `kind 28936` to a relay in order to request that their access be revoked. The event's `created_at` MUST be now, plus or minus a few minutes. This event MUST include a [NIP 70](nostr:naddr1qvzqqqrcvypzq2eeknl7v2fnm7tsuxfkds3vrcyjl9fls070a465urcy6k3mgk0eqqrxu6ts95mnq8gw7fu) `-` tag.\n\n```yaml\n{\n  \"kind\": 28936,\n  \"tags\": [[\"-\"]],\n  // ...other fields\n}\n```\n\nRelays SHOULD update their `kind 13534` member list and MAY publish a `kind 8001` \"remove member\" event.\n\n## Implementation\n\nClients MUST only request `kind 28935` events from and send `kind 28934` events to relays which include this NIP in the `supported_nips` section of its [NIP 11](nostr:naddr1qvzqqqrcvypzq2eeknl7v2fnm7tsuxfkds3vrcyjl9fls070a465urcy6k3mgk0eqqrxu6ts95cnzjt5dcs) relay information document.\n","sig":"e4f5b4ad684764a837f7ba9574c025c8f390b86fb42dd92050497e6655eefd6f143401e038e261dfe03b125d94ae45af1348c7e18a70f96e6626df213dd91b28"}