← Todos los NIPs

NIP-08

Manejo de menciones

No recomendadoEventos

La forma antigua de mencionar personas y notas: sustituir la mención por #[índice], que apunta al array de tags. Obsoleto en favor de las URIs nostr: de NIP-27.

De un vistazo

Estado
Sigue documentado, pero el software nuevo no debería apoyarse en él.
Último cambio
16 nov 2023

No recomendado: deprecated in favor of NIP-27

Usa en su lugar: NIP-27

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.

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

Texto con marcadores #[0], #[1]…

Tags

  1. p Opcional

    Un usuario mencionado.

  2. e Opcional

    Un evento mencionado.

Añadir tag

Cómo funciona este NIP

Paso 1 de 4

Usa NIP-27 en su lugar

Escribe nostr:npub… o nostr:nevent… en content (NIP-27). Los marcadores de índice se rompen en cuanto se reordenan los tags.

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.

Reemplazado por

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ón265 palabras, citadas del repositorio en el commit 0046368.

This document standardizes the treatment given by clients of inline mentions of other events and pubkeys inside the content of text_notes.

Clients that want to allow tagged mentions they MUST show an autocomplete component or something analogous to that whenever the user starts typing a special key (for example, "@") or presses some button to include a mention etc -- or these clients can come up with other ways to unambiguously differentiate between mentions and normal text.

Once a mention is identified, for example, the pubkey 27866e9d854c78ae625b867eefdfa9580434bc3e675be08d2acb526610d96fbe, the client MUST add that pubkey to the .tags with the tag p, then replace its textual reference (inside .content) with the notation #[index] in which "index" is equal to the 0-based index of the related tag in the tags array.

The same process applies for mentioning event IDs.

A client that receives a text_note event with such #[index] mentions in its .content CAN do a search-and-replace using the actual contents from the .tags array with the actual pubkey or event ID that is mentioned, doing any desired context augmentation (for example, linking to the pubkey or showing a preview of the mentioned event contents) it wants in the process.

Where #[index] has an index that is outside the range of the tags array or points to a tag that is not an e or p tag or a tag otherwise declared to support this notation, the client MUST NOT perform such replacement or augmentation, but instead display it as normal text.