require ots tags accompany closed_at tags

This commit is contained in:
toadlyBroodle 2023-03-07 11:48:29 +09:00
parent f435bc80da
commit b8d39fd6c5

13
69.md
View File

@ -23,6 +23,7 @@ A poll event:
* 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
* SHOULD specify a `closed_at` time:
* when specified, MUST include a valid [`ots` tag](03.md), proving original poll publishing time
* a `closed_at` value of less than or equal to the `created_at` field indicates a poll SHOULD NOT be closed.
* MAY specify a `value_maximum` satoshi value for zapped votes to be included in the tally
* MAY specify a `value_minimum` satoshi value for zapped votes to be included in the tally
@ -45,6 +46,7 @@ A poll event:
["consensus_threshold", "required percentage to attain consensus <0..100>"],
["closed_at", "unix timestamp in seconds"],
],
"ots": <base64-encoded OTS file data>
"content": <primary poll description string>,
"sig": <64-bytes hex of the signature of the sha256 hash of the serialized event data, which is the same as the "id" field>
}
@ -61,14 +63,18 @@ The zap request event (kind `9734`):
* 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`
* MUST include a valid `ots` tag, if the original poll event specifies a `closed_at` time
```json
...
"tags": [
["e", <32-bytes hex of the id of the original poll event>, <primary poll host relay URL>],
["p", <32-bytes hex of the key>, <primary poll host relay URL>],
["poll_option", "n"],
...
]
],
"ots": <base64-encoded OTS file data>
...
```
## Poll outcome
@ -84,8 +90,9 @@ A tallying client:
* 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
* if a `closed_at` time is specified, clients:
* MUST ONLY tally zaps including a valid `ots` tag indicating a sent time greater than or equal to the original poll event's `ots` time
* MUST ONLY tally zaps including a valid `ots` tag indicating a sent time less than or equal to `closed_at` time
Additionally, a tallying client:
* MUST display the distribution percentages, from the tally total, for each vote option tally