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:
authorAlex Gleason <alex@alexgleason.me>2026-04-10 13:31:37 -0500
committerAlex Gleason <alex@alexgleason.me>2026-04-10 13:31:37 -0500
commit5e1e24766910fc07cb61a049aed2623987458ec2 (patch)
treeb7588f61fddf9374268d5cd6f4e3f2655d7c840a /85.md
parentb8782df594b4e7e8f088869134908eed58be6078 (diff)
parent3465f540e3eaedccb5309711b502f0febf56b52f (diff)
Merge nip44-big-payloads into bigger-nip44bigger-nip44
Diffstat (limited to '85.md')
-rw-r--r--85.md166
1 files changed, 166 insertions, 0 deletions
diff --git a/85.md b/85.md
new file mode 100644
index 0000000..587095d
--- /dev/null
+++ b/85.md
@@ -0,0 +1,166 @@
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 four distinct target "subjects" on which such calculations can be performed: *pubkeys*, *regular events*, *addressable events*, and *nip73 identifiers*. 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 "pubkey": "<service pubkey>",
30 "tags": [
31 ["d", "e88a691e98d9987c964521dff60025f60700378a4879180dcbbb4a5027850411"], // target user's public key
32 ["rank", "89"],
33 ],
34 "content": "",
35 //...
36}
37```
38
39Service providers MUST use different service keys for distinct algorithms, including a key per user when the algorithm is personalized to that user's point of view or settings.
40
41## Kind 30382: Users as Subject:
42
43The following result types have been declared:
44
45| Result type | Tag name | Tag value format |
46| ----------------------- | ---------------------- | ----------------- |
47| Follower Count | `followers` | int |
48| User Rank | `rank` | int, norm 0-100 |
49| First Post Time | `first_created_at` | unix timestamp |
50| Post Count | `post_cnt` | int |
51| Reply Count | `reply_cnt` | int |
52| Reactions Count | `reactions_cnt` | int |
53| Zap Amount Received | `zap_amt_recd` | int, sats |
54| Zap Amount Sent | `zap_amt_sent` | int, sats |
55| Zap Number Received | `zap_cnt_recd` | int |
56| Zap Number Sent | `zap_cnt_sent` | int |
57| Avg Zap Amount/day recd | `zap_avg_amt_day_recd` | int, sats |
58| Avg Zap Amount/day sent | `zap_avg_amt_day_sent` | int, sats |
59| Reports Received | `reports_cnt_recd` | int |
60| Reports Sent | `reports_cnt_sent` | int |
61| Common Topics | `t` | string |
62| Generally active start | `active_hours_start` | int, 0-24, UTC |
63| Generally active end | `active_hours_end` | int, 0-24, UTC |
64
65Each 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.
66
67## Kind 30383: Events as Subject
68
69Providers can rate individual events with the following tags:
70
71| Result type | Tag name | Tag value format |
72| ----------------------- | ---------------------- | ----------------- |
73| Event Rank | `rank` | int, norm 0-100 |
74| Event Comment Count | `comment_cnt` | int |
75| Event Quote Count | `quote_cnt` | int |
76| Event Repost Count | `repost_cnt` | int |
77| Event Reaction Count | `reaction_cnt` | int |
78| Event Zap Count | `zap_cnt` | int |
79| Event Zap Amount | `zap_amount` | int, sats |
80
81## Kind 30384: Addressables as Subject
82
83Providers can rate all versions of addressable events using the following tags:
84
85| Result type | Tag name | Tag value format |
86| ------------------------- | ---------------------- | ----------------- |
87| Address Rank | `rank` | int, norm 0-100 |
88| Address Comment Count | `comment_cnt` | int |
89| Address Quote Count | `quote_cnt` | int |
90| Address Repost Count | `repost_cnt` | int |
91| Address Reaction Count | `reaction_cnt` | int |
92| Address Zap Count | `zap_cnt` | int |
93| Address Zap Amount | `zap_amount` | int, sats |
94
95## Kind 30385: External identifier as Subject
96
97Providers can rate books, locations, movies, websites, and hashtags using [NIP-73](73.md) identifiers.
98
99| Result type | Tag name | Tag value format |
100| ----------------- | ---------------------- | ----------------- |
101| Rank | `rank` | int, norm 0-100 |
102| Comment Count | `comment_cnt` | int |
103| Reaction Count | `reaction_cnt` | int |
104
105NIP-73 `k` tags should be added to the event as well.
106
107## Declaring Trusted Service Providers
108
109Kind `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.
110
111```js
112{
113 "kind": 10040,
114 "tags": [
115 ["<kind:tag>", "<service key>", "<relay hint>"],
116
117 // examples
118 ["30382:rank", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://nip85.nostr.band"],
119 ["30382:rank", "3d842afecd5e293f28b6627933704a3fb8ce153aa91d790ab11f6a752d44a42d", "wss://nostr.wine"],
120 ["30382:zap_amt_sent", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://nip85.nostr.band"],
121 ],
122 "content": nip44Encrypt(JSON.stringify([
123 ["<kind:tag>", "<service key>", "<relay hint>"],
124
125 // examples
126 ["30383:rank", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://nip85.nostr.band"],
127 ["30384:rank", "4fd5e210530e4f6b2cb083795834bfe5108324f1ed9f00ab73b9e8fcfe5f12fe", "wss://nip85.nostr.band"],
128 ]),
129 //...
130}
131```
132
133If 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.
134
135## Final Considerations
136
137Service 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.
138
139Service providers MAY limit access to the results by using paid relays.
140
141In 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.
142
143## Appendix 1: Service provider discoverability
144
145Service Providers SHOULD sign a kind `0` of each service key that explains who controls the key and what the current version of the algorithm is about.
146
147```jsonc
148{
149 "kind": 0,
150 "pubkey": "<service pubkey>",
151 "tags": [],
152 "content": "{
153 \"name\" = \"Vitor's Brainstormer\",
154 \"about\" = \"A Web of Trust algorithm from Vitor's point of view that considers Follows and Mutes, but no reports, and gives extra score points for anyone around Boston\",
155 \"picture\" = \"https://brainstorm.com/logo.png\",
156 \"website\" = \"https://brainstorm.com\"
157 }",
158 // other fields...
159}
160```
161
162Clients wishing to offer a list of Service Providers to their users SHOULD:
1631. Download kind `10040` events of the user's follow list
1642. Connect to each of the listed relays and download the kind `0` of the respective service keys
1653. Parse the kind `0` and collect the `website` property
1664. Load the OpenGraph tags of that website and display them as clickable items