{ "app": "fairdraw", "kind": "formula", "version": "fairdraw/v2", "sha256": "1c62a99c8c77168500ecbb44a6859c1d3cbe1b3d31d7b9f13663e1ec6bf9e618", "bytes": 1353, "hashOf": "sha256 of the UTF-8 bytes of the text field, re-encoded exactly as published", "note": "v1 defined the counted set by chain order, which this client cannot read; v2 replaces the boundary with the close pin enumerated list. Same arithmetic, new boundary.", "supersedes": "417be10728739ae200974807e340052706a36308d4fd47d8efe816a68fe3812di0", "text": "fairdraw/v2\n\ncounted entries\n the entry pin ids named in this draw's close pin, in its \"counted\" array.\n a named id counts only if it is readable at /protocols/fairdraw/entry and its \"draw\" field\n equals this draw's pin id; a named id that fails either test is reported, never counted.\n of all of a publisher's counted entries, only the lexicographically smallest pin id counts.\n\nthe list\n those pin ids, lowercased, sorted ascending byte-lexicographic, joined with a single LF byte.\n\nthe digest\n sha256 of the UTF-8 bytes of the ASCII string \"fairdraw/v2\" followed by one LF byte (0x0a),\n followed by the list.\n\nthe index\n the digest read as a big-endian unsigned 256-bit integer, modulo the number of counted entries.\n\nthe winner\n the entry at that index.\n\nnotes\n a draw may have more than one close pin. this formula says nothing about which of them to use:\n a pick is always relative to one close pin, and the receipt names the close it used.\n ordering of arrival is never used. the winner is a function of the SET of counted entries only.\n the close pin is the boundary: an entry it does not name is not counted, and the verify view\n shows every entry it finds that the close does not name.\n the version string in the digest keeps a v1 pick and a v2 pick distinguishable.\n an empty list has no winner; the draw is void and says so.\n" }