← Todos los NIPs

NIP-85

Afirmaciones de confianza

BorradorEventos

Permite que cálculos pesados, como puntuaciones de red de confianza o recuentos de seguidores, se hagan en un servicio que tú eliges, que publica los resultados como eventos firmados que tu cliente simplemente lee.

De un vistazo

Estado
En uso, pero todavía puede cambiar.
Kinds
Tags
  • d
Ú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

Cómo se conectan las partes: Elige un proveedor y lee sus puntuaciones

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

Vacío. Todos los resultados van en las etiquetas.

Este kind no lleva contenido: déjalo como un string vacío.

Tags

  1. d Obligatorio

    El sujeto de la afirmación: la pubkey descrita.

  2. rank Recomendado

    Una puntuación normalizada de 0 a 100. Cuanto más alta, más confianza según el algoritmo de este proveedor.

  3. followers Opcional

    Cuántos seguidores cuenta el proveedor para este usuario.

  4. first_created_at Opcional

    Cuándo vio el proveedor por primera vez una publicación de este usuario.

    1 ene 2024, 0:00 UTC
  5. post_cnt Opcional

    Número de publicaciones.

  6. zap_amt_recd Opcional

    Total de sats recibidos en zaps.

  7. t Opcional

    Un tema del que este usuario habla a menudo. Repítela para varios temas.

  8. t Opcional

    Un tema del que este usuario habla a menudo. Repítela para varios temas.

  9. active_hours_start Opcional

    Hora del día (UTC) en la que el usuario suele empezar a estar activo.

  10. active_hours_end Opcional

    Hora del día (UTC) en la que el usuario suele dejar de estar activo.

  11. p Opcional

    Repite el sujeto solo para añadirle una pista de relay.

Añadir tag

Cómo funciona este NIP

Paso 1 de 5

Por qué delegar los cálculos

Clasificar a un usuario o contar reacciones requiere millones de eventos. Un teléfono no puede descargar todo eso, así que un servicio de confianza hace el trabajo y publica las respuestas.

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

Certain Webs of Trust calculations require access to a large volume of events and/or computing power, making it virtually impossible to perform them directly on clients. This NIP allows users to offload such calculations to declared trusted service providers, and for these providers to publish signed "Trusted Assertion" events for the user client's consumption.

Assertion Events

Trusted Assertions are always addressable (replaceable) events with the d tag pointing to the "subject" of the assertion. This NIP currently recognizes four distinct target "subjects" on which such calculations can be performed: pubkeys, regular events, addressable events, and nip73 identifiers. Each subject type is mapped to an event kind:

Subject Event Kind d tag value
User 30382 <pubkey>
Event 30383 <event_id>
Addressable Event 30384 <event_address>
NIP-73 Identifier 30385 <i-tag>

Calculation results are saved in pre-defined tags whose syntax and semantics are agreed upon by providers and clients.

Example of ranking a pubkey with a web of trust score of 89:

{
  "kind": 30382,
  "pubkey": "<service pubkey>",
  "tags": [
    ["d", "e88a691e98d9987c964521dff60025f60700378a4879180dcbbb4a5027850411"], // target user's public key
    ["rank", "89"],
  ],
  "content": "",
  //...
}

Service providers MUST use different service keys for distinct algorithms, including a key per user when the algorithm is personalized to that user's point of view or settings.

Kind 30382: Users as Subject:

The following result types have been declared:

Result type Tag name Tag value format
Follower Count followers int
User Rank rank int, norm 0-100
First Post Time first_created_at unix timestamp
Post Count post_cnt int
Reply Count reply_cnt int
Reactions Count reactions_cnt int
Zap Amount Received zap_amt_recd int, sats
Zap Amount Sent zap_amt_sent int, sats
Zap Number Received zap_cnt_recd int
Zap Number Sent zap_cnt_sent int
Avg Zap Amount/day recd zap_avg_amt_day_recd int, sats
Avg Zap Amount/day sent zap_avg_amt_day_sent int, sats
Reports Received reports_cnt_recd int
Reports Sent reports_cnt_sent int
Common Topics t string
Generally active start active_hours_start int, 0-24, UTC
Generally active end active_hours_end int, 0-24, UTC

Each provider can offer their own ways to calculate such values. For instance, the Follower Count of one trust provider might remove the user's muted public keys while another provider keeps them. Users can then choose how they want to see this information in their preferred client by picking a provider that aligns with their view.

Kind 30383: Events as Subject

Providers can rate individual events with the following tags:

Result type Tag name Tag value format
Event Rank rank int, norm 0-100
Event Comment Count comment_cnt int
Event Quote Count quote_cnt int
Event Repost Count repost_cnt int
Event Reaction Count reaction_cnt int
Event Zap Count zap_cnt int
Event Zap Amount zap_amount int, sats

Kind 30384: Addressables as Subject

Providers can rate all versions of addressable events using the following tags:

Result type Tag name Tag value format
Address Rank rank int, norm 0-100
Address Comment Count comment_cnt int
Address Quote Count quote_cnt int
Address Repost Count repost_cnt int
Address Reaction Count reaction_cnt int
Address Zap Count zap_cnt int
Address Zap Amount zap_amount int, sats

Kind 30385: External identifier as Subject

Providers can rate books, locations, movies, websites, and hashtags using NIP-73 identifiers.

Result type Tag name Tag value format
Rank rank int, norm 0-100
Comment Count comment_cnt int
Reaction Count reaction_cnt int

NIP-73 k tags should be added to the event as well.

Declaring Trusted Service Providers

Kind 10040 lists the user's preferred source for each result. Each kind:tag is followed by the publisher's pubkey and the relay where assertion events can be obtained. Service providers may use multiple keys and relays as needed, including a key per user when the algorithm is personalized to that user's point of view or settings. Users can share these settings publicly or keep them private by JSON-stringifying and encrypting the tag list within the .content field using NIP-44.

{
  "kind": 10040,
  "tags": [
    ["<kind:tag>", "<service key>", "<relay hint>"],

    // examples
    ["30382:rank", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://nip85.nostr.band"],
    ["30382:rank", "3d842afecd5e293f28b6627933704a3fb8ce153aa91d790ab11f6a752d44a42d", "wss://nostr.wine"],
    ["30382:zap_amt_sent", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://nip85.nostr.band"],
  ],
  "content": nip44Encrypt(JSON.stringify([
    ["<kind:tag>", "<service key>", "<relay hint>"],

     // examples
    ["30383:rank", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://nip85.nostr.band"],
    ["30384:rank", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://nip85.nostr.band"],
  ]),
  //...
}

If the provider offers several algorithms or multiple points of view of an algorithm, the key listed in each tag SHOULD point to the key created for each algorithm or point of view.

Final Considerations

Service providers SHOULD update Trusted Assertions as fast as new information arrives, but only if the contents of each event actually change to avoid re-downloading the same information.

Service providers MAY limit access to the results by using paid relays.

In TAs, p, e, and a tags with the same value as the d tag MAY be used to add a relay hint to the home relay of that user or event.

Appendix 1: Service provider discoverability

Service Providers SHOULD sign a kind 0 of each service key that explains who controls the key and what the current version of the algorithm is about.

{
  "kind": 0,
  "pubkey": "<service pubkey>",
  "tags": [],
  "content": "{
   \"name\" = \"Vitor's Brainstormer\", 
   \"about\" = \"A Web of Trust algorithm from Vitor's point of view that considers Follows and Mutes, but no reports, and gives extra score points for anyone around Boston\",
   \"picture\" = \"https://brainstorm.com/logo.png\",
   \"website\" = \"https://brainstorm.com\"
  }",
  // other fields...
}

Clients wishing to offer a list of Service Providers to their users SHOULD:

  1. Download kind 10040 events of the user's follow list
  2. Connect to each of the listed relays and download the kind 0 of the respective service keys
  3. Parse the kind 0 and collect the website property
  4. Load the OpenGraph tags of that website and display them as clickable items