Trusted Lists

Specifies: kind 10040 kind 30392 kind 30393 kind 30394 kind 30395

Trusted Lists

draft optional

A cross between Trusted Assertions and NIP-51.

This NIP defines a standard for Web of Trust Service Providers to export lists of pubkeys, events, or strings ranked by personalized trust metric as nostr events.

The Trusted Lists NIP is similar to the Trusted Assertions NIP in the sense that each NIP specifies a method for WoT Service Providers to communicate the results of personalized trust metric calculations to clients in the form of a nostr event. For each NIP, trust metrics are calculated from the perspective of a single Observer. Also for each NIP, end user preferences regarding choice WoT Service Providers are recorded in a kind 10040 event.

Trusted Lists differs from Trusted Assertions in the sense that Trusted Assertions typically conveys multiple trust metrics pertaining to a single Subject, whereas Trusted Lists conveys the results of a single trust metric calculation pertaining to (typically) multiple Subjects.

The structure of each Trusted Lists event is similar to NIP-51 lists.

Trusted Lists

We create new event kinds: 30392-5 for the Trusted List, which will mirror the format of 30382x events of Trusted Assertions in terms of support for p, e, a, t, and i tags. The Trusted List event follows the format of a NIP-51 list, with the addition of an optional element in p, e, a, t, and i tags to indicate that list item’s trust metric.

Trust Context

The context of the Trusted List is indicated by the d tag. The d tag is a string that could be human readable (perhaps similar to the title) or could be non-human-readable such as an event id pointing to an event that provides details about the context, including the range and interpretation of the trust metric. The d tags of kind 3039x events should correspond exactly to the strings found in the kind 10040 events (below) (just after “3039x:”).

Unlike Trusted Assertions, which defines supported tags such as rank and followers, we do not specify a set of supported trust contexts; any string is allowed.

The items in the list are assumed to be ordered according to the trust metric, even if the optional trust metric of each item is not provided. The direction of ordering (ascending vs descending) will depend upon the context.

Optional Trust Metric

We will update standard e, p, and a tags as described in NIP-01 to add an optional _trust metric _string element after the other optional elements. We will also support t tags. The range and interpretation of the trust metric will depend upon the trust context.

The updated tags are as follows:

  • The e tag, used to refer to an event: ["e", <32-bytes lowercase hex of the id of another event>, <recommended relay URL, optional>, <32-bytes lowercase hex of the author's pubkey, optional>, <trust metric, optional>]
  • The p tag, used to refer to another user: ["p", <32-bytes lowercase hex of a pubkey>, <recommended relay URL, optional>, <trust metric, optional>]
  • The a tag, used to refer to an addressable or replaceable event
    • for an addressable event: ["a", "<kind integer>:<32-bytes lowercase hex of a pubkey>:<d tag value>", <recommended relay URL, optional>, <trust metric, optional>]
    • for a normal replaceable event: ["a", "<kind integer>:<32-bytes lowercase hex of a pubkey>:", <recommended relay URL, optional>, <trust metric, optional>] (note: include the trailing colon)
  • The t tag, used to refer to a string: ["t", <string>, <trust metric, optional>]

We also introduce an optional tag: metric, which indicates the name of the trust metric.

Example

Trending 24 Hour Content

{
  "id": "<id>",
  "pubkey": "<pubkey_wot_sp1>",
  "created_at": <timestamp>,
  "kind": 30393,
  "content": "",
  "tags": [
    ["d", "Trending-24-Hour-Content"],
    ["title", "Trending 24 Hour Content"],
    ["metric", "trending-score"],
    ["e", "<event id>", "<optional relay hint>", "<optional author pubkey>", "100"],
    ["e", "<event id>", "", "", "89"],
    ["e", "<event id>", "", "", "86"],
    ["e", "<event id>", "", "", "84"]
  ]
}

Top Bluegrass Musicians

{
  "id": "<id>",
  "pubkey": "<pubkey_wot_sp2>",
  "created_at": <timestamp>,
  "kind": 30392,
  "content": "",
  "tags": [
    ["d", "Top-Bluegrass-Musicians"],
    ["title", "Top Bluegrass Musicians"],
    ["metric", "musical-talent"],
    ["p", "<pubkey>", "<optional relay hint>", "100"],
    ["p", "<pubkey>", "", "89"],
    ["p", "<pubkey>", "", "86"],
    ["p", "<pubkey>", "", "84"]
  ]
}

Top Hashtags

{
  "id": "<id>",
  "pubkey": "<pubkey_wot_sp3>",
  "created_at": <timestamp>,
  "kind": 3039x,
  "content": "",
  "tags": [
    ["d", "top-hashtags"],
    ["title", "Top Hashtags"],
    ["metric", "rank"],
    ["t", "wotathon", "100"],
    ["t", "100pushups, "99"],
    ["t", "asknostr", "", "96"]
  ]
}

Top pubkeys by rank

{
  "id": "<id>",
  "pubkey": "<pubkey_wot_sp4>",
  "created_at": <timestamp>,
  "kind": 30392,
  "content": "",
  "tags": [
    ["d", "Top-100-pubkeys-by-rank"],
    ["title", "Top 100 Pubkeys by Rank"],
    ["metric", "rank"],
    ["p", "<pubkey>", "<optional relay hint>", "100"],
    ["p", "<pubkey>", "", "89"],
    ["p", "<pubkey>", "", "86"],
    ["p", "<pubkey>", "", "84"]
  ]
}

Declaring Trusted Lists Service Provider Preferences

We will reuse kind 10040 from the Trusted Assertions NIP to declare Trusted Lists Service Providers.

Kind 10040 events will be used to record user preferences not only for Trusted Assertions Service Providers, but also for Trusted List Service Providers. For each Trusted List, the SP preference will be indicated with the tag: ["3039x:<trusted-list-d-tag>", "<wot_sp_pubkey>", "<relay>"].

Example:

{
  "kind": 10040,
  "tags": [
    ["30382:rank", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://nip85.nostr.band"],
    ["30382:rank", "3d842afecd5e293f28b6627933704a3fb8ce153aa91d790ab11f6a752d44a42d", "wss://nostr.wine"],
    ["30382:zap_amt_sent", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://nip85.nostr.band"],
    ["30393:Trending-24-Hour-Content", "<pubkey_wot_sp1>", "wss://nip85.nostr.band"],
  ],
  "content": nip44Encrypt(JSON.stringify([
    ["30383:rank", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://nip85.nostr.band"],
    ["30384:rank", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://nip85.nostr.band"],
    ["30392:Top-Bluegrass-Musicians", "<pubkey_wot_sp2>", "wss://nip85.nostr.band"],
  ]),
  //...
}

Note that the d tag in the Trusted List kind 3039x event examples above match what is found in the kind 10040 event.


Looking for comments…

Searching Nostr relays. This may take a moment the first time this article is opened.