diff options
| author | Abhay Raizada <toabhayraizada@gmail.com> | 2024-07-16 23:03:02 +0530 |
|---|---|---|
| committer | Abhay Raizada <toabhayraizada@gmail.com> | 2024-07-16 23:03:28 +0530 |
| commit | c258875395bfdc22c4e74669c5a7b0bde567a9d4 (patch) | |
| tree | 2d2a63d89bb886ebdc7452f9997f258d3f2cade5 | |
| parent | 21587e236785616b6c0ca796c03a29a3ad5e69ea (diff) | |
Remove settings, fine tuning
| -rw-r--r-- | 118.md | 37 |
1 files changed, 20 insertions, 17 deletions
| @@ -9,18 +9,23 @@ This NIP defines the event scheme that describe Polls on nostr. | |||
| 9 | The NIP makes the following tradeoffs. | 9 | The NIP makes the following tradeoffs. |
| 10 | 10 | ||
| 11 | 1. All votes are public. | 11 | 1. All votes are public. |
| 12 | 2. All responses are editable (latest by timestamp considered last response) | 12 | 2. 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 | |||
| 18 | The poll event is defined as a `kind:1068` event. | ||
| 19 | |||
| 20 | - **content** key holds the label for the poll. | ||
| 21 | |||
| 22 | Major tags in the poll event are: | ||
| 17 | 23 | ||
| 18 | The 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 | ||
| 25 | Example Event | 30 | Example 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 | ||
| 47 | 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. | 53 | 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. |
| 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 | |||
| 70 | 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. | 77 | 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. |
| 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 | ||
| 78 | Results can be queried by fetching `kind:1018` events from the relays specified in the poll. | 85 | Results can be queried by fetching `kind:1018` events from the relays specified in the poll. |
| 79 | The results displayed should only be 1 vote per pubkey. | 86 | The results displayed should only be 1 vote event per pubkey. |
| 80 | In case of multiple events for a pubkey, the event with the largest timestamp should be considered. | 87 | In case of multiple events for a pubkey, the event with the largest timestamp should be considered. |
| 81 | 88 | ||
| 82 | ### Curation | 89 | ### Curation |
| 83 | 90 | ||
| 84 | 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. | 91 | 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. |
| 85 | Clients can also employ other curation algorithms, like Proof Of Work and Web of Trust scores for result curations. | 92 | 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 |
| 86 | |||
| 87 | ### Private Polls | ||
| 88 | |||
| 89 | This nip does not cover private polling, Clients may follow [forms nip](https://github.com/nostr-protocol/nips/pull/1190) for private polling. | ||