Appearance
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
| Property | Value |
|---|---|
| Kind Number | 10040 |
| Event Range | Replaceable |
| Defined in | NIP-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 Name | Description | Format | Required |
|---|---|---|---|
kind:tag | Kind 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 scores30382:followers- Follower counts30382:zap_amt_sent- Zap amounts sent30382:zap_amt_recd- Zap amounts received
Event Assertions (30383):
30383:rank- Event ranking scores30383:comment_cnt- Comment counts30383:zap_cnt- Zap counts
Addressable Event Assertions (30384):
30384:rank- Addressable event ranking scores30384:zap_amount- Zap amounts
External Identifier Assertions (30385):
30385:rank- External entity ranking scores
Client Behavior
Clients should:
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.
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.
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:
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.
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:
- Store trusted service provider configuration events.
- Support queries by author to allow clients to fetch user configurations.
- Implement proper handling of replaceable events.
- 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
Related Kinds
- Kind 30382: User Trusted Assertions - Assertions about users
- Kind 30383: Event Trusted Assertions - Assertions about individual events
- Kind 30384: Addressable Event Trusted Assertions - Assertions about addressable events
- Kind 30385: External Identifier Trusted Assertions - Assertions about NIP-73 identifiers
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.