Skip to content

Kind 9000: Group User Addition

Overview

This event is used in group management to add a user to a group or modify their roles within a group. It is part of the relay-based groups system defined in NIP-29.

Specification

PropertyValue
Kind Number9000
Event RangeRegular
Defined inNIP-29

Content Format

The content field can contain an optional reason for adding the user to the group or modifying their roles.

Schema

"optional reason"

Tags

Tag NameDescriptionFormatRequired
hGroup identifier["h", "<group-id>"]Yes
pUser public key with optional roles["p", "<pubkey-hex>", "<role1>", "<role2>", ...]Yes
previousTimeline references["previous", "<event-id-prefix>"]No, but recommended

Client Behavior

Clients with appropriate permissions can send this event to add a user to a group or modify their roles. The client should include the group ID in the h tag and the user's public key in the p tag, along with any roles being assigned.

Clients should include timeline references in the previous tag to prevent messages from being used out of context.

Relay Behavior

Relays should validate that:

  1. The sender has the appropriate permissions to add users to the group.
  2. The event contains a valid h tag with the group ID.
  3. The event contains a valid p tag with the user's public key.
  4. The timeline references in the previous tag, if present, refer to events in the relay's database.

If validation succeeds, the relay should process the event and update the group's membership to include the specified user with the assigned roles.

Use Cases

  • Adding a new user to a group.
  • Modifying the roles of an existing group member.
  • Responding to a join request (kind 9021) to grant access.

Example

json
{
  "id": "...",
  "pubkey": "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
  "created_at": 1671217411,
  "kind": 9000,
  "tags": [
    ["h", "vegans-united"],
    ["p", "abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890", "member"],
    ["previous", "a1b2c3d4"]
  ],
  "content": "Adding a new vegan enthusiast to our group",
  "sig": "..."
}

References

Notes

The event should only be accepted by relays if it comes from a user with appropriate permissions (e.g., a group admin with the capability to add users).