Appearance
Kind 9001: Group User Removal
Overview
This event is used in group management to remove a user from a group. It is part of the relay-based groups system defined in NIP-29.
Specification
Property | Value |
---|---|
Kind Number | 9001 |
Event Range | Regular |
Defined in | NIP-29 |
Content Format
The content
field can contain an optional reason for removing the user from the group.
Schema
"optional reason"
Tags
Tag Name | Description | Format | Required |
---|---|---|---|
h | Group identifier | ["h", "<group-id>"] | Yes |
p | User public key to be removed | ["p", "<pubkey-hex>"] | Yes |
previous | Timeline references | ["previous", "<event-id-prefix>"] | No, but recommended |
Client Behavior
Clients with appropriate permissions can send this event to remove a user from a group. The client should include the group ID in the h
tag and the user's public key in the p
tag.
Clients should include timeline references in the previous
tag to prevent messages from being used out of context.
When a user sends a leave request (kind 9022), the relay will automatically issue a kind 9001 event in response to remove the user.
Relay Behavior
Relays should validate that:
- The sender has the appropriate permissions to remove users from 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 remove the specified user.
Use Cases
- Removing a user from a group due to violations of group rules.
- Processing a user's request to leave a group.
- Pruning inactive members from a group.
Example
json
{
"id": "...",
"pubkey": "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"created_at": 1671217411,
"kind": 9001,
"tags": [
["h", "vegans-united"],
["p", "abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"],
["previous", "a1b2c3d4"]
],
"content": "Removing user due to inactivity",
"sig": "..."
}
References
Related Kinds
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 remove users), or it can be automatically generated by the relay in response to a kind 9022 leave request.