From b8d39fd6c5a3e08b77a75bc41846b018639f3449 Mon Sep 17 00:00:00 2001 From: toadlyBroodle Date: Tue, 7 Mar 2023 11:48:29 +0900 Subject: [PATCH] require ots tags accompany closed_at tags --- 69.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/69.md b/69.md index 1750b620..1a098e8f 100644 --- a/69.md +++ b/69.md @@ -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": "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> } @@ -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>, ], ["p", <32-bytes hex of the key>, ], ["poll_option", "n"], ... -] +], +"ots": +... ``` ## 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