zap vote format

-add zap vote format section
-edit, elaborate other sections
This commit is contained in:
landonMutch 2023-03-02 18:45:53 +09:00 committed by GitHub
parent a55a79e4e3
commit 4d6da84175
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

26
69.md
View File

@ -1,6 +1,6 @@
# Poll event
A poll note is a nostr event type (kind 6969) for conducting valuation polls. A poll presents two or more voting options, which participants my vote on by sending zap events indicating a single chosen option. Poll results may be blinded, until after users have voted. Polls may specify a closing time, after which results should be unblinded, closed to new votes, and considered final. Polls may also specify a consensus threshold.
A poll note is a nostr event type (kind `6969`) for conducting paid polls. A poll presents two or more voting options, which participants my vote on by sending regular zap events which include an additional `poll_option` vote tag. Poll results may be blinded, until after users have voted. Polls may specify a closing time, after which results should be unblinded, closed to new votes, and considered final. Polls may also specify a consensus threshold.
## Purpose
@ -8,7 +8,9 @@ The purpose of poll notes is to conduct quantitative public opinion polls over n
## Poll format
A poll is a self-contained nostr event which MUST have a primary description along with a predefined number of voting options. A poll MUST include at least 2 unique voting options, and each option MUST contain a corresponding secondary description. A poll MUST specify a primary tally method (`value` or `count`) and SHOULD specify a `closing_time`. When specified, a `closing_time` MUST be greater than the `created_at` field. Polls MAY also include a `consensus_threshold` integar (0-100), representing a percentage threshold to achieve poll consensus.
A poll is a self-contained nostr event which MUST have a primary description string specified in the `content` field, along with a predefined list of voting options. A poll MUST include at least 2 unique voting options, and each option MUST contain a corresponding, unique secondary description string.
A poll MUST specify a primary tally method (`value` or `count`) and SHOULD specify a `closing_time`. A `closing_time` value of less than or equal to the `created_at` field indicates a poll SHOULD NOT be closed.
Polls MAY also include a `consensus_threshold` integar (0-100), representing a percentage threshold for any single vote option to achieve poll consensus, with '0' indicative of null.
```json
{
@ -33,13 +35,26 @@ A poll is a self-contained nostr event which MUST have a primary description alo
}
```
Poll options are voted on by referencing a chosen option, using the `poll_option` tag, within zap events sent to the original poll note. `poll_option` tags MUST include exactly 1 option selected from the list of voting options, predefined in the original poll event.
## Zap vote format
Poll options are voted on by sending zap events (to the original poll event) which include 1 additional `poll_option` tag within their otherwise standard json structure.
`poll_option` tags MUST include exactly 1 option from the list of predefined `polling_options`, referenced by its corresponding integar `n`:
```json
"tags": [
...
["poll_option", "n"],
...
]
```
## Poll outcomes
Votes may be tallied either by value or by count. To avoid ambiguity of a winning outcome, a primary tally method MUST be specified as either `value` or `count`. When a `count` tally method is specified, only a single vote (the most recent) per unique voter MUST be included in the tally, zap amounts MUST be ignored, and anonymous zaps MUST NOT be counted.
If a closing time is specified, after it is passed, a poll should be unblinded publicly and MUST be treated as closed (late votes must not be tallied). Once closed, the option associated with either the most satoshis (value) or the most votes (counts), depending on tally method, MUST be treated as the winning option; while the distribution percentages across all vote options MUST be considered respresentative of the distribution of opinion amongst participants.
If a `closing_time` is specified, after it is passed, a poll should be unblinded publicly and MUST be treated as closed (late votes must not be tallied). Once closed, the option associated with either the most satoshis (value) or the most votes (counts), depending on tally method, MUST be treated as the winning option; while the distribution percentages across all vote options MUST be considered respresentative of the distribution of opinion amongst participants.
If a `closing_time` is not specified (or is less than or equal to `created_at`), all votes SHOULD be tallied into perpetuity, and the most recent tally SHOULD be treated as the definitive outcome.
Additionally, if a consensus threshold percentage is specified, and any single option's associated value (or vote count) percentage of the poll's total value (or vote count, respectively) exceeds the consensus threshold, then consensus MUST be considered attained.
@ -47,8 +62,7 @@ Strict adherence to these requirements should enable a formal means of quantitat
## TODO
* define standardized voting zap format
* refine standardized polling format
* refine standardized polling formats based on dev feedback
* send pull request (RFC) to nostr-protocol/NIPs
* implement polls in 1 relay
* implement polls in 2 clients