← Todos los NIPs

NIP-25

Reacciones

BorradorEventos

Me gusta, no me gusta y reacciones con emoji como eventos kind 7 que apuntan a la nota a la que reaccionaste. "+" es un me gusta, "-" un no me gusta y cualquier otra cosa un emoji. El kind 17 hace lo mismo para páginas web y otras cosas fuera de Nostr.

De un vistazo

Estado
En uso, pero todavía puede cambiar.
Kinds
Tags
  • emoji
  • i
  • k
Último cambio
13 jun 2026

Pruébalo

Edita el formulario o el JSON: ambos se mantienen sincronizados, la insignia indica si el resultado es válido y, al tocar cualquier campo, se explica qué hace.

Qué construir
Ejemplos
Válido 1 nota

Aún sin firmar · Solo claves de demo. Las claves secretas de estos personajes son públicas a propósito.

Formulario
1 ene 2025, 0:00 UTC

Contenido

"+" o vacío = me gusta, "-" = no me gusta, un emoji o un :shortcode: = reacción con emoji.

Tags

  1. e Obligatorio

    El evento al que se reacciona. Obligatorio; si hay varios tags e, el objetivo es el último.

  2. p Recomendado

    Autor del evento al que se reacciona, para que reciba la notificación. El autor del objetivo va al final.

  3. k Opcional

    Kind del evento al que se reacciona.

Añadir tag

Cómo funciona este NIP

Paso 1 de 5

El content es la reacción

"+" (o un string vacío) significa me gusta, "-" significa no me gusta. Cualquier otro emoji, o un emoji personalizado :shortcode:, se muestra tal cual y no cuenta como ninguno de los dos.

En el curso

Ningún capítulo del curso cubre este NIP todavía. El editor de arriba es la forma más rápida de empezar.

Se basa en

Ver también

Especificación

El texto de las especificaciones se cita en inglés del repositorio nostr-protocol/nips. Nuestras explicaciones y la interfaz están traducidas. Código fuente en GitHub en el commit 0046368

Leer la especificación479 palabras, citadas del repositorio en el 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.