diff --git a/69.md b/69.md index d8602d13..1750b620 100644 --- a/69.md +++ b/69.md @@ -17,6 +17,8 @@ A careful balancing of all poll attributes should enable pollers to conduct tail ## Poll format A poll event: +* MUST specify an `e` tag that includes a primary hosting relay URL +* MUST specify a `p` tag that includes the same primary hosting relay specified in the `e` tag * MUST contain a primary description string, specified in the `content` field * MUST contain a `poll_options` tag, containing a serialized key-value array of vote options, formatted as below * MUST include at least 2 voting options, each with its own unique description string @@ -35,8 +37,8 @@ A poll event: "created_at": , "kind": 6969, "tags": [ - ["e", <32-bytes hex of the id of another event>, ], - ["p", <32-bytes hex of the key>, ], + ["e", <32-bytes hex of the id of the poll event>, ], + ["p", <32-bytes hex of the key>, ], ["poll_options", "[[0, 'poll option 0 description string'], [1, 'poll option 1 description string'], [, 'poll option description string']]"], ["value_maximum", "maximum satoshi value for inclusion in tally"], ["value_minimum", "minimum satoshi value for inclusion in tally"], @@ -50,15 +52,20 @@ A poll event: ## Zap vote format -Poll options are voted on by sending [zap events](57.md) (referencing the original poll event) which include 1 additional `poll_option` tag in the zap request event. +Poll options are voted on by sending [zap events](57.md) (referencing the original poll event's `e` and `p` values) that indicate their chosen vote option in a `poll_option`. To ensure all eligible votes are included in the tally, `e` and `p` tags must specify a primary hosting relay. The zap request event (kind `9734`): +* MUST specify an `e` tag that references the original poll event + * MUST include a primary hosting relay URL in the `e` tag +* MUST specify a `p` tag that references the poller's pubkey + * MUST include the same primary hosting relay URL in the `p` tag as is specified in the `e` tag * MUST include exactly 1 `poll_option` tag * MUST reference the vote option by its corresponding integer `n`, chosen from the original poll event's key-value array of predefined `polling_options` ```json "tags": [ - ... + ["e", <32-bytes hex of the id of the original poll event>, ], + ["p", <32-bytes hex of the key>, ], ["poll_option", "n"], ... ] @@ -66,17 +73,17 @@ The zap request event (kind `9734`): ## Poll outcome +Polls results are tallied by summing the exact satoshi values from all eligible zaps for each `poll_option`. The total tally is the sum of all individual `poll_option` tallies, and `poll_option` results are calculated by their percentage of the total tally value. + To avoid ambiguity of results, strict adherence to the following rules is vital when tallying and rendering poll outcomes. A tallying client: * MUST clearly indicate the `value_maximum`, `value_minimum`, and `closed_at` attributes (when specified) to participants before they vote -* MUST ONLY include full satoshi value amounts in option tallies from all eligible zaps, according to the following criteria: -* if a `value_maximum` is specified, clients: - * MUST include zap amounts less than or equal to `value_maximum` in the tally - * MUST NOT include zap amounts greater than `value_maximum` in the tally -* if a `value_minimum` is specified, clients: - * MUST include zap amounts greater than or equal to `value_minimum` in the tally - * MUST NOT include zap amounts less than `value_minimum` in the tally +* MUST ONLY include full satoshi value amounts in option tallies from ALL eligible zaps that meet ALL following criteria: +* MUST ONLY tally zaps that reference the original poll event by its `e` tag value +* MUST ONLY tally zaps sent to the poller's `p` key +* MUST ONLY include zap amounts less than or equal to `value_maximum`, if specified +* MUST ONLY include zap amounts greater than or equal to `value_minimum`, if specified * if a valid `closed_at` time is specified, clients: * MUST NOT tally late votes received after `closed_at` time