upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--118.md37
1 files changed, 20 insertions, 17 deletions
diff --git a/118.md b/118.md
index 15bc730..b22b006 100644
--- a/118.md
+++ b/118.md
@@ -9,18 +9,23 @@ This NIP defines the event scheme that describe Polls on nostr.
9The NIP makes the following tradeoffs. 9The NIP makes the following tradeoffs.
10 10
111. All votes are public. 111. All votes are public.
122. All responses are editable (latest by timestamp considered last response) 122. All votes are editable (latest response by timestamp considered last vote)
13 13
14## Events 14## Events
15 15
16### Poll Content 16### Poll Event
17
18The poll event is defined as a `kind:1068` event.
19
20- **content** key holds the label for the poll.
21
22Major tags in the poll event are:
17 23
18The poll event is defined as a `kind:1068` event. Major tags in the poll event are:
19 24
20- **label**: The accompanying text of the poll.
21- **option**: The option tags contain an OptionId(any alphanumeric) field, followed by an option label field. 25- **option**: The option tags contain an OptionId(any alphanumeric) field, followed by an option label field.
22- **relays**: Set of relays that the poll is expecting respondents to respond on. 26- **relay**: One or multiple tags that the poll is expecting respondents to respond on.
23- **settings**: A JSON stringified object that may hold poll level configs and client specific configs. 27- **polltype**: can be "singlechoice", "multiplechoice", or "rankedchoice". Polls that do not have a polltype should be considered a "singlechoice" poll.
28
24 29
25Example Event 30Example Event
26 31
@@ -36,15 +41,16 @@ Example Event
36 ["label", "Pineapple on Pizza"], 41 ["label", "Pineapple on Pizza"],
37 ["option", "qj518h583", "Yay"], 42 ["option", "qj518h583", "Yay"],
38 ["option", "gga6cdnqj", "Nay"], 43 ["option", "gga6cdnqj", "Nay"],
39 ["relays", "<relay1 url>", "<relay 2 url>"], 44 ["relay","<relay url1>"],
40 ["settings", "{\"PollType\": \"singlechoice\" }"] 45 ["relay", "<relay url2>"],
46 ["polltype", "singlechoice"]
41 ] 47 ]
42} 48}
43``` 49```
44 50
45### Responses 51### Responses
46 52
47The response event is a `kind:1018` event. It contains an e tag referencing the poll event it is referencing, followed by one or more response tags. 53The response event is a `kind:1018` event. It contains an e tag with the poll event it is referencing, followed by one or more response tags.
48 54
49- **response** : The tag contains "response" as it's first positional argument followed by the option Id selected. 55- **response** : The tag contains "response" as it's first positional argument followed by the option Id selected.
50 56
@@ -60,7 +66,8 @@ Example Response Event
60 "sig": "30071a633c65db8f3a075c7a8de757fbd8ce65e3607f4ba287fe6d7fbf839a380f94ff4e826fbba593f6faaa13683b7ea9114ade140720ecf4927010ebf3e44f", 66 "sig": "30071a633c65db8f3a075c7a8de757fbd8ce65e3607f4ba287fe6d7fbf839a380f94ff4e826fbba593f6faaa13683b7ea9114ade140720ecf4927010ebf3e44f",
61 "tags": [ 67 "tags": [
62 ["e", "1fc80cf813f1af33d5a435862b7ef7fb96b47e68a48f1abcadf8081f5a545550"], 68 ["e", "1fc80cf813f1af33d5a435862b7ef7fb96b47e68a48f1abcadf8081f5a545550"],
63 ["response", "gga6cdnqj"] 69 ["response", "gga6cdnqj"],
70 ["response", "m3agjsdq1"]
64 ] 71 ]
65} 72}
66``` 73```
@@ -70,20 +77,16 @@ Example Response Event
70Poll Types can be configured in the settings object of the poll, the setting dictates how multiple response tags are handled in the `kind:1018` event. 77Poll Types can be configured in the settings object of the poll, the setting dictates how multiple response tags are handled in the `kind:1018` event.
71 78
72- **PollType: singlechoice**: The first response tag is to be considered the actual response. 79- **PollType: singlechoice**: The first response tag is to be considered the actual response.
73- **PollType: multiplechoice**: The first response tag pointing to each id is considered the actual response, without considering the order. 80- **PollType: multiplechoice**: The first response tag pointing to each id is considered the actual response, without considering the order of the response tags.
74- **PollType: rankedchoice**: The first response tag pointing to each id is the considered the actual response, while also taking into account the order of the response tags. 81- **PollType: rankedchoice**: The first response tag pointing to each id is the considered the actual response, while also taking into account the order of the response tags.
75 82
76### Counting Results 83### Counting Results
77 84
78Results can be queried by fetching `kind:1018` events from the relays specified in the poll. 85Results can be queried by fetching `kind:1018` events from the relays specified in the poll.
79The results displayed should only be 1 vote per pubkey. 86The results displayed should only be 1 vote event per pubkey.
80In case of multiple events for a pubkey, the event with the largest timestamp should be considered. 87In case of multiple events for a pubkey, the event with the largest timestamp should be considered.
81 88
82### Curation 89### Curation
83 90
84The clients may configure fetching results by specific people. This can be achieved by creating `kind:30000` follow sets, and fetching results only from the follow set. 91The clients may configure fetching results by specific people. This can be achieved by creating `kind:30000` follow sets, and fetching results only from the follow set.
85Clients can also employ other curation algorithms, like Proof Of Work and Web of Trust scores for result curations. 92Clients can also employ other curation algorithms, like Proof Of Work and Web of Trust scores for result curations. \ No newline at end of file
86
87### Private Polls
88
89This nip does not cover private polling, Clients may follow [forms nip](https://github.com/nostr-protocol/nips/pull/1190) for private polling.