From 4f337ed2de38272f19b528c07deea95df51e72f0 Mon Sep 17 00:00:00 2001 From: landonMutch Date: Thu, 2 Mar 2023 13:41:40 +0900 Subject: [PATCH] standardize poll format -add standardized poll event json format --- 69.md | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/69.md b/69.md index 7e9c1700..4a73a7b2 100644 --- a/69.md +++ b/69.md @@ -8,13 +8,37 @@ 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. Polls MAY also include a consensus threshold percentage. +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`. Polls MAY also include a `consensus_threshold` integar (0-100), representing a percentage threshold to achieve consensus. -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 predefined choice of voting options. +```json +{ + "id": <32-bytes lowercase hex-encoded sha256 of the the serialized event data> + "pubkey": <32-bytes lowercase hex-encoded public key of the event creator>, + "created_at": , + "kind": 6969, + "tags": [ + ["e", <32-bytes hex of the id of another event>, ], + ["p", <32-bytes hex of the key>, ], + ["poll_options": [ + ["0", ], + ["1", ], + ["2", ], + ["n", ], + ], + ["tally_method", "value"||"count"], + ["closing_time", ], + ["consensus_threshold", ], + ], + "content": , + "sig": <64-bytes hex of the signature of the sha256 hash of the serialized event data, which is the same as the "id" field> +} +``` + +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. ## 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. +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.