Appearance
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
Property | Value |
---|---|
Kind Number | 9000 |
Event Range | Regular |
Defined in | NIP-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 Name | Description | Format | Required |
---|---|---|---|
h | Group identifier | ["h", "<group-id>"] | Yes |
p | User public key with optional roles | ["p", "<pubkey-hex>", "<role1>", "<role2>", ...] | Yes |
previous | Timeline 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:
- The sender has the appropriate permissions to add users to the group.
- The event contains a valid
h
tag with the group ID. - The event contains a valid
p
tag with the user's public key. - 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
Related Kinds
- Kind 9001: Group User Removal
- Kind 9021: Group Join Request
- Kind 39001: Group Admins
- Kind 39002: Group Members
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).