-
Notifications
You must be signed in to change notification settings - Fork 784
Trusted Assertions #1534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Trusted Assertions #1534
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
682e4c4
Adds service providers
vitorpamplona e666636
Adds service provider revenue model
vitorpamplona 9c38c8e
Fix typos
vitorpamplona a95634d
Adds event-based results
vitorpamplona ab673fb
Reformats table
vitorpamplona c8663bb
Adds zap count and zap amount to event-based providers.
vitorpamplona 6834c1b
Adds quote counts
vitorpamplona 14674d3
Adds web of trust / page rank score for events and addresses
vitorpamplona 34a6e98
improves description, grammar
vitorpamplona 4382476
Adds more user-based stats
vitorpamplona 6650aff
moves wot to rank
vitorpamplona 4b483c0
Update 85.md
vitorpamplona 1ced632
Update 85.md
vitorpamplona 0d7831b
Improving the text - no other changes
vitorpamplona 912e75c
Rename section from 'Events' to 'Addressables'
vitorpamplona 41c64d7
Updating from nostrhub
vitorpamplona File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| NIP-85 | ||
| ====== | ||
|
|
||
| Trusted Assertions | ||
| ------------------ | ||
|
|
||
| `draft` `optional` | ||
|
|
||
| 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 three distinct target "subjects" on which such calculations can be performed: *pubkeys*, *regular events*, and *addressable events*. 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`: | ||
|
|
||
| ```jsonc | ||
| { | ||
| "kind": 30382, | ||
| "tags": [ | ||
| ["d", "e88a691e98d9987c964521dff60025f60700378a4879180dcbbb4a5027850411"], // target user's public key | ||
| ["rank", "89"], | ||
| ], | ||
| "content": "", | ||
| //... | ||
| } | ||
| ``` | ||
|
|
||
| ## 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](73.md) 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 authorized providers for each result. Each `kind:tag` is followed by the `pubkey` of the service and the relay where the results are published. Users can specify these publicly or privately by JSON-stringifying and encrypting the tag list in the `.content` using NIP-44. | ||
|
|
||
| ```js | ||
| { | ||
| "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"], | ||
| ], | ||
| "content": nip44Encrypt(JSON.stringify([ | ||
| ["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. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.