Skip to content

Kind 7: Reaction

Overview

Reaction events (kind 7) allow users to express simple responses to other events, similar to "likes," "dislikes," or emoji reactions on other platforms. They provide a lightweight way to engage with content without creating a full reply.

Specification

PropertyValue
Kind Number7
Event RangeRegular
Defined inNIP-25

Content Format

The content field determines the type of reaction:

  • + or empty string: A "like" or "upvote"
  • -: A "dislike" or "downvote"
  • Emoji or custom emoji: A specific reaction using that emoji

Schema

json
// Like
"content": "+"

// Dislike
"content": "-"

// Emoji reaction
"content": "❤️"

// Custom emoji (NIP-30)
"content": ":soapbox:"

Tags

Tag NameDescriptionFormatRequired
eReferenced event being reacted to["e", "<event-id>", "<relay-url>"]Yes
pAuthor of the referenced event["p", "<pubkey-hex>"]Recommended
aCoordinates (for addressable events)["a", "<kind>:<pubkey>:<d-tag>"]Conditionally
kKind of the referenced event["k", "<kind-number>"]Recommended
emojiCustom emoji definition["emoji", "shortcode", "url"]Conditionally

Client Behavior

Clients should:

  1. Display reactions aggregated by type with counts
  2. Interpret + and empty string as likes/upvotes
  3. Interpret - as dislikes/downvotes
  4. Display emoji reactions appropriately, including rendering custom emoji
  5. When creating reactions:
    • Include the e tag with a relay hint for the referenced event
    • Include the p tag with the original author's pubkey
    • Include the k tag with the kind of the event being reacted to
    • For custom emoji reactions, include an emoji tag

Relay Behavior

Relays should:

  1. Store reaction events alongside regular notes
  2. Make reactions discoverable via event tag filters

Use Cases

  • Expressing approval/disapproval of content
  • Providing lightweight feedback without composing a reply
  • Expressing more nuanced emotions with emoji reactions
  • Building social proof and engagement metrics

Example

json
// Simple like reaction
{
  "id": "4376c65d2f232afbe9b882a35baa4f6fe8667c4e684749af565f981833ed6a65",
  "pubkey": "79dff8f82963424e0bb02708a22e44b4980893e3a4be0fa3cb60a43b946764e3",
  "created_at": 1671217411,
  "kind": 7,
  "tags": [
    ["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36", "wss://nostr.example.com"],
    ["p", "f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca"],
    ["k", "1"]
  ],
  "content": "+",
  "sig": "908a15e46fb4d8675bab026fc230a0e3542bfade63da02d542fb78b2a8513fcd0092619a2c8c1221e581946e0191f2af505dfdf8657a414dbca329186f009262"
}

// Custom emoji reaction
{
  "id": "4376c65d2f232afbe9b882a35baa4f6fe8667c4e684749af565f981833ed6a79",
  "pubkey": "79dff8f82963424e0bb02708a22e44b4980893e3a4be0fa3cb60a43b946764e3",
  "created_at": 1671217500,
  "kind": 7,
  "tags": [
    ["e", "5c83da77af1dec6d7289834998ad7aafbd9e2191396d75ec3cc27f5a77226f36", "wss://nostr.example.com"],
    ["p", "f7234bd4c1394dda46d09f35bd384dd30cc552ad5541990f98844fb06676e9ca"],
    ["k", "1"],
    ["emoji", "soapbox", "https://gleasonator.com/emoji/Gleasonator/soapbox.png"]
  ],
  "content": ":soapbox:",
  "sig": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2c3d4"
}

References

Notes

  • The target event being reacted to should be the last e tag if multiple e tags are present.
  • The target pubkey should be the last p tag if multiple p tags are present.
  • For custom emoji reactions, only one emoji shortcode should be used in the content.
  • An empty string in content should be treated the same as a + (like).