Skip to content

Kind 9005: Group Event Deletion

Overview

This event is used in group moderation to delete or hide a specific event within a group. It allows group administrators or moderators to remove inappropriate or unwanted content from the group's timeline.

Specification

PropertyValue
Kind Number9005
Event RangeRegular
Defined inNIP-29

Content Format

The content field can contain an optional reason for deleting the event.

Schema

"optional reason"

Tags

Tag NameDescriptionFormatRequired
hGroup identifier["h", "<group-id>"]Yes
eEvent ID to be deleted["e", "<event-id-hex>"]Yes
previousTimeline references["previous", "<event-id-prefix>"]No, but recommended

Client Behavior

Clients with appropriate permissions can send this event to delete or hide a specific event within a group. The client should include the group ID in the h tag and the ID of the event to be deleted in the e tag.

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

When displaying the group timeline, clients should typically hide events that have been marked for deletion by the group's administrators or moderators.

Relay Behavior

Relays should validate that:

  1. The sender has the appropriate permissions to delete events in the group.
  2. The event contains a valid h tag with the group ID.
  3. The event contains a valid e tag with the event ID to be deleted.
  4. The event referenced in the e tag exists and belongs to the group.
  5. 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 mark the referenced event as deleted. Depending on the relay's implementation, this might involve removing the event from storage or adding it to a deletion list.

Use Cases

  • Removing spam or off-topic content from a group.
  • Deleting messages that violate the group's rules.
  • Removing outdated announcements or information.

Example

json
{
  "id": "...",
  "pubkey": "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
  "created_at": 1671217411,
  "kind": 9005,
  "tags": [
    ["h", "vegans-united"],
    ["e", "abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"],
    ["previous", "a1b2c3d4"]
  ],
  "content": "Removing post that contains incorrect information about pizza toppings",
  "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 or moderator with the capability to delete events).

Relays may implement different strategies for handling deleted events, such as complete removal from storage or just marking them as deleted while still retaining the data.