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. The NIP makes the following tradeoffs. 1. All votes are public. -2. All responses are editable (latest by timestamp considered last response) +2. All votes are editable (latest response by timestamp considered last vote) ## Events -### Poll Content +### Poll Event + +The poll event is defined as a `kind:1068` event. + +- **content** key holds the label for the poll. + +Major tags in the poll event are: -The poll event is defined as a `kind:1068` event. Major tags in the poll event are: -- **label**: The accompanying text of the poll. - **option**: The option tags contain an OptionId(any alphanumeric) field, followed by an option label field. -- **relays**: Set of relays that the poll is expecting respondents to respond on. -- **settings**: A JSON stringified object that may hold poll level configs and client specific configs. +- **relay**: One or multiple tags that the poll is expecting respondents to respond on. +- **polltype**: can be "singlechoice", "multiplechoice", or "rankedchoice". Polls that do not have a polltype should be considered a "singlechoice" poll. + Example Event @@ -36,15 +41,16 @@ Example Event ["label", "Pineapple on Pizza"], ["option", "qj518h583", "Yay"], ["option", "gga6cdnqj", "Nay"], - ["relays", "", ""], - ["settings", "{\"PollType\": \"singlechoice\" }"] + ["relay",""], + ["relay", ""], + ["polltype", "singlechoice"] ] } ``` ### Responses -The 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. +The 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. - **response** : The tag contains "response" as it's first positional argument followed by the option Id selected. @@ -60,7 +66,8 @@ Example Response Event "sig": "30071a633c65db8f3a075c7a8de757fbd8ce65e3607f4ba287fe6d7fbf839a380f94ff4e826fbba593f6faaa13683b7ea9114ade140720ecf4927010ebf3e44f", "tags": [ ["e", "1fc80cf813f1af33d5a435862b7ef7fb96b47e68a48f1abcadf8081f5a545550"], - ["response", "gga6cdnqj"] + ["response", "gga6cdnqj"], + ["response", "m3agjsdq1"] ] } ``` @@ -70,20 +77,16 @@ Example Response Event Poll 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. - **PollType: singlechoice**: The first response tag is to be considered the actual response. -- **PollType: multiplechoice**: The first response tag pointing to each id is considered the actual response, without considering the order. +- **PollType: multiplechoice**: The first response tag pointing to each id is considered the actual response, without considering the order of the response tags. - **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. ### Counting Results Results can be queried by fetching `kind:1018` events from the relays specified in the poll. -The results displayed should only be 1 vote per pubkey. +The results displayed should only be 1 vote event per pubkey. In case of multiple events for a pubkey, the event with the largest timestamp should be considered. ### Curation The 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. -Clients can also employ other curation algorithms, like Proof Of Work and Web of Trust scores for result curations. - -### Private Polls - -This nip does not cover private polling, Clients may follow [forms nip](https://github.com/nostr-protocol/nips/pull/1190) for private polling. +Clients can also employ other curation algorithms, like Proof Of Work and Web of Trust scores for result curations. \ No newline at end of file