← All NIPs

NIP-25

Reactions

DraftEvents

Likes, dislikes and emoji reactions as kind 7 events that point at the note you reacted to. "+" is a like, "-" a dislike, anything else an emoji. Kind 17 does the same for web pages and other things outside Nostr.

At a glance

Status
In use and still allowed to change.
Kinds
Tags
  • emoji
  • i
  • k
Last changed
Jun 13, 2026

Try it

Edit the form or the JSON: both stay in sync, the badge says whether the result is valid, and tapping any field explains it.

What to build
Examples
Valid 1 note

Not signed yet · Demo keys only. These personas' secret keys are public on purpose.

Form
Jan 1, 2025, 12:00 AM UTC

Content

"+" or empty = like, "-" = dislike, an emoji or one :shortcode: = emoji reaction.

Tags

  1. e Required

    The event being reacted to. Required; if there are several e tags, the target is the last.

  2. p Recommended

    Author of the event being reacted to, so they are notified. The target's author goes last.

  3. k Optional

    Kind of the event being reacted to.

Add tag

How this NIP works

Step 1 of 5

The content is the reaction

"+" (or an empty string) means like, "-" means dislike. Any other emoji, or a :shortcode: custom emoji, is shown as-is and is not counted as either.

In the course

No course chapter covers this NIP yet. The editor above is the quickest way in.

Builds on

See also

Specification

Specification text is quoted in English from the nostr-protocol/nips repository. Our explanations and the interface are translated. Source on GitHub at commit 0046368

Read the spec479 words, quoted from the repository at commit 0046368.

A reaction is a kind 7 event that is used to indicate user reactions to other events. A reaction's content field MUST include user-generated-content indicating the value of the reaction (conventionally +, -, or an emoji).

A reaction with content set to + or an empty string MUST be interpreted as a "like" or "upvote". A reaction with content set to - MUST be interpreted as a "dislike" or "downvote".

A reaction with content set to an emoji or NIP-30 custom emoji SHOULD NOT be interpreted as a "like" or "dislike". Clients MAY instead display this emoji reaction on the post.

Tags

There MUST be always an e tag set to the id of the event that is being reacted to. The e tag SHOULD include a relay hint pointing to a relay where the event being reacted to can be found. If a client decides to include other e, which not recommended, the target event id should be last of the e tags.

There SHOULD be a p tag set to the pubkey of the event being reacted to. If a client decides to include other p tags, which not recommended, the target event pubkey should be last the p tags.

If the event being reacted to is an addressable event, an a SHOULD be included together with the e tag, it must be set to the coordinates (kind:pubkey:d-tag) of the event being reacted to.

The e and a tags SHOULD include relay and pubkey hints. The p tags SHOULD include relay hints.

The reaction event MAY include a k tag with the stringified kind number of the reacted event as its value.

Example code

func make_like_event(pubkey: String, privkey: String, liked: NostrEvent, hint: String) -> NostrEvent {
    var tags: [[String]] = []
    tags.append(["e", liked.id, hint, liked.pubkey])
    tags.append(["p", liked.pubkey, hint])
    tags.append(["k", String(liked.kind)])
    let ev = NostrEvent(content: "+", pubkey: pubkey, kind: 7, tags: tags)
    ev.calculate_id()
    ev.sign(privkey: privkey)
    return ev
}

External Content Reactions

If the target of a reaction is not a native nostr event, the reaction MUST be a kind 17 event and MUST include NIP-73 external content k + i tags to properly reference the content.

Reacting to a website:

{
  "kind": 17,
  "content": "⭐",
  "tags": [
    ["k", "web"],
    ["i", "https://example.com"]
  ],
}

Reacting to a podcast episode:

{
  "kind": 17,
  "content": "+",
  "tags": [
    ["k", "podcast:guid"],
    ["i", "podcast:guid:917393e3-1b1e-5cef-ace4-edaa54e1f810", "https://fountain.fm/show/QRT0l2EfrKXNGDlRrmjL"],
    ["k", "podcast:item:guid"],
    ["i", "podcast:item:guid:PC20-229", "https://fountain.fm/episode/DQqBg5sD3qFGMCZoSuLF"]
  ],
}

Custom Emoji Reaction

The client may specify a custom emoji (NIP-30) :shortcode: in the reaction content. The client should refer to the emoji tag and render the content as an emoji if shortcode is specified.

{
  "kind": 7,
  "content": ":soapbox:",
  "tags": [
    ["emoji", "soapbox", "https://gleasonator.com/emoji/Gleasonator/soapbox.png"]
  ],
  // other fields...
}

The content can be set only one :shortcode:. And emoji tag should be one.