Skip to content

Kind 10040: Trusted Service Providers

Overview

Trusted Service Providers events (kind 10040) allow users to declare which service providers they authorize for different types of trusted assertion calculations. These events list the user's preferred providers for specific metrics (like user rankings, event engagement scores, etc.) along with relay hints where the assertion results can be found.

This kind enables users to maintain control over which algorithmic services they trust for Web of Trust calculations while allowing clients to automatically discover and consume assertion data from these authorized providers. Users can specify these provider lists publicly or privately using NIP-44 encryption.

Specification

PropertyValue
Kind Number10040
Event RangeReplaceable
Defined inNIP-85: Trusted Assertions

Content Format

The content field can be empty (for public provider lists) or contain NIP-44 encrypted provider configurations (for private lists).

Schema

For public lists:

""

For private lists:

json
{
  "ciphertext": "base64-encoded-encrypted-data",
  "nonce": "base64-encoded-nonce"
}

Tags

Tag NameDescriptionFormatRequired
kind:tagKind and tag combination for assertion type["<kind>:<tag>", "<service_pubkey>", "<relay_hint>"]No

Common Tag Combinations

Based on NIP-85, common kind:tag combinations include:

User Assertions (30382):

  • 30382:rank - User ranking scores
  • 30382:followers - Follower counts
  • 30382:zap_amt_sent - Zap amounts sent
  • 30382:zap_amt_recd - Zap amounts received

Event Assertions (30383):

  • 30383:rank - Event ranking scores
  • 30383:comment_cnt - Comment counts
  • 30383:zap_cnt - Zap counts

Addressable Event Assertions (30384):

  • 30384:rank - Addressable event ranking scores
  • 30384:zap_amount - Zap amounts

External Identifier Assertions (30385):

  • 30385:rank - External entity ranking scores

Client Behavior

Clients should:

  1. Provider Discovery:

    • Query the user's kind 10040 events to discover authorized service providers.
    • Parse both public tags and decrypt private content when available.
    • Cache provider configurations for efficient lookup.
  2. Assertion Fetching:

    • Connect to the specified relay hints to fetch assertion data.
    • Query the listed service provider pubkeys for relevant assertion events.
    • Handle cases where multiple providers offer the same metric types.
  3. User Configuration:

    • Allow users to add, remove, and modify trusted service providers.
    • Support both public and private provider configurations.
    • Enable users to specify different providers for different metric types.

Service Provider Behavior

Service providers should:

  1. Service Discovery:

    • Publish kind 0 metadata events for each service key explaining the algorithm.
    • Maintain consistent service keys for specific algorithms.
    • Provide clear documentation about what metrics they compute.
  2. Result Publishing:

    • Publish assertion results to the relays specified in user configurations.
    • Use the service keys that users have authorized in their kind 10040 events.
    • Update assertions efficiently to minimize bandwidth usage.

Relay Behavior

Relays should:

  1. Store trusted service provider configuration events.
  2. Support queries by author to allow clients to fetch user configurations.
  3. Implement proper handling of replaceable events.
  4. Support REQ filters for efficient querying.

Use Cases

Algorithmic Choice:

  • Allowing users to select which Web of Trust algorithms they trust.
  • Supporting multiple service providers with different approaches.
  • Enabling personalized assertion sources.

Privacy Control:

  • Supporting both public and private provider configurations.
  • Allowing users to keep their algorithmic preferences private.
  • Enabling selective disclosure of trusted services.

Service Discovery:

  • Helping clients automatically discover assertion data sources.
  • Reducing manual configuration burden for users.
  • Facilitating seamless integration with trusted assertion systems.

Example

Public Provider Configuration

json
{
  "id": "c7d8e9f0a1b2...",
  "pubkey": "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d",
  "created_at": 1675642635,
  "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"],
    ["30383:rank", "5e320f5321a4b7b8cb094795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://assertions.relay.com"]
  ],
  "content": "",
  "sig": "..."
}

Mixed Public and Private Configuration

json
{
  "id": "d8e9f0a1b2c3...",
  "pubkey": "3bf0c63fcb93463407af97a5e5ee64fa883d107ef9e558472c4eb9aaaefa459d",
  "created_at": 1675642635,
  "kind": 10040,
  "tags": [
    ["30382:rank", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://nip85.nostr.band"],
    ["30382:followers", "3d842afecd5e293f28b6627933704a3fb8ce153aa91d790ab11f6a752d44a42d", "wss://nostr.wine"]
  ],
  "content": "{\"ciphertext\":\"...\",\"nonce\":\"...\"}",
  "sig": "..."
}

References

Notes

  • Users can configure different service providers for different types of metrics, allowing fine-grained control over algorithmic sources.
  • The same metric type (e.g., 30382:rank) can have multiple authorized providers, enabling users to compare different algorithms.
  • Service providers offering multiple algorithms or personalized views should use different service keys for each algorithm variation.
  • Clients should handle cases where private content decryption fails gracefully, falling back to public configurations.
  • The relay hint in each tag should point to relays where the service provider publishes their assertion results.
  • Users can update their trusted provider configurations at any time by publishing new kind 10040 events.