upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/85.md
diff options
context:
space:
mode:
authorVitor Pamplona <vitor@vitorpamplona.com>2026-01-22 11:47:55 -0500
committerGitHub <noreply@github.com>2026-01-22 13:47:55 -0300
commitb58a6048b12e6cbbb64250664a9e78ee85579ff0 (patch)
tree30a863ceb87b0353135fcaec49a0322a2d3d15f9 /85.md
parentf461065c29f469b34ebd9d111d6ea9123e5292e7 (diff)
Trusted Assertions (#1534)
Co-authored-by: arthurfranca <arthur.a.franca@gmail.com>
Diffstat (limited to '85.md')
-rw-r--r--85.md132
1 files changed, 132 insertions, 0 deletions
diff --git a/85.md b/85.md
new file mode 100644
index 0000000..c11ce5a
--- /dev/null
+++ b/85.md
@@ -0,0 +1,132 @@
1NIP-85
2======
3
4Trusted Assertions
5------------------
6
7`draft` `optional`
8
9Certain 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.
10
11## Assertion Events
12
13Trusted 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:
14
15| Subject | Event Kind | `d` tag value |
16| ------------------ | -------------- | ----------------- |
17| User | 30382 | `<pubkey>` |
18| Event | 30383 | `<event_id>` |
19| Addressable Event | 30384 | `<event_address>` |
20| NIP-73 Identifier | 30385 | `<i-tag>` |
21
22Calculation results are saved in pre-defined tags whose syntax and semantics are agreed upon by providers and clients.
23
24Example of ranking a pubkey with a web of trust score of `89`:
25
26```jsonc
27{
28 "kind": 30382,
29 "tags": [
30 ["d", "e88a691e98d9987c964521dff60025f60700378a4879180dcbbb4a5027850411"], // target user's public key
31 ["rank", "89"],
32 ],
33 "content": "",
34 //...
35}
36```
37
38## Kind 30382: Users as Subject:
39
40The following result types have been declared:
41
42| Result type | Tag name | Tag value format |
43| ----------------------- | ---------------------- | ----------------- |
44| Follower Count | `followers` | int |
45| User Rank | `rank` | int, norm 0-100) |
46| First Post Time | `first_created_at` | unix timestamp |
47| Post Count | `post_cnt` | int, |
48| Reply Count | `reply_cnt` | int |
49| Reactions Count | `reactions_cnt` | int |
50| Zap Amount Received | `zap_amt_recd` | int, sats |
51| Zap Amount Sent | `zap_amt_sent` | int, sats |
52| Zap Number Received | `zap_cnt_recd` | int |
53| Zap Number Sent | `zap_cnt_sent` | int |
54| Avg Zap Amount/day recd | `zap_avg_amt_day_recd` | int, sats |
55| Avg Zap Amount/day sent | `zap_avg_amt_day_sent` | int, sats |
56| Reports Received | `reports_cnt_recd` | int |
57| Reports Sent | `reports_cnt_sent` | int |
58| Common Topics | `t` | string |
59| Generally active start | `active_hours_start` | int, 0-24, UTC |
60| Generally active end | `active_hours_end` | int, 0-24, UTC |
61
62Each 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.
63
64## Kind 30383: Events as Subject
65
66Providers can rate individual events with the following tags:
67
68| Result type | Tag name | Tag value format |
69| ----------------------- | ---------------------- | ----------------- |
70| Event Rank | `rank` | int, norm 0-100 |
71| Event Comment Count | `comment_cnt` | int |
72| Event Quote Count | `quote_cnt` | int |
73| Event Repost Count | `repost_cnt` | int |
74| Event Reaction Count | `reaction_cnt` | int |
75| Event Zap Count | `zap_cnt` | int |
76| Event Zap Amount | `zap_amount` | int, sats |
77
78## Kind 30384: Addressables as Subject
79
80Providers can rate all versions of addressable events using the following tags:
81
82| Result type | Tag name | Tag value format |
83| ------------------------- | ---------------------- | ----------------- |
84| Address Rank | `rank` | int, norm 0-100 |
85| Address Comment Count | `comment_cnt` | int |
86| Address Quote Count | `quote_cnt` | int |
87| Address Repost Count | `repost_cnt` | int |
88| Address Reaction Count | `reaction_cnt` | int |
89| Address Zap Count | `zap_cnt` | int |
90| Address Zap Amount | `zap_amount` | int, sats |
91
92## Kind 30385: External identifier as Subject
93
94Providers can rate books, locations, movies, websites, and hashtags using [NIP-73](73.md) identifiers.
95
96| Result type | Tag name | Tag value format |
97| ----------------- | ---------------------- | ----------------- |
98| Rank | `rank` | int, norm 0-100 |
99| Comment Count | `comment_cnt` | int |
100| Reaction Count | `reaction_cnt` | int |
101
102NIP-73 `k` tags should be added to the event as well.
103
104## Declaring Trusted Service Providers
105
106Kind `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.
107
108```js
109{
110 "kind": 10040,
111 "tags": [
112 ["30382:rank", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://nip85.nostr.band"],
113 ["30382:rank", "3d842afecd5e293f28b6627933704a3fb8ce153aa91d790ab11f6a752d44a42d", "wss://nostr.wine"],
114 ["30382:zap_amt_sent", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://nip85.nostr.band"],
115 ],
116 "content": nip44Encrypt(JSON.stringify([
117 ["30383:rank", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://nip85.nostr.band"],
118 ["30384:rank", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://nip85.nostr.band"],
119 ]),
120 //...
121}
122```
123
124If 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.
125
126## Final Considerations
127
128Service 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.
129
130Service providers MAY limit access to the results by using paid relays.
131
132In 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.