I want to be able to write "We will use the standard blockchain tiebreaking protocol".
I'm not aware of any such standard, but I suppose one may exist without my knowledge.
If I were going to create a standard, I think I would do it as follows...
- Each contestant chooses (or is assigned) some unique piece of data
- A designated future tie-breaking block height is chosen
- If there are any ties, then the unique data of each tied contestant is separately combined with the hash of the designated block using some predetermined method
- The resulting combined data for each contestant is hashed
- The resulting hashes are sorted using a predetermined sort ordering and the "winners" are chosen in the sorted order of their respective hashes
As an example the following could be chosen before the election as the tie breaking mechanism:
- Block height 412150, where the genesis block is block 0, is chosen as the tie breaking block height, but only after 6 additional blocks have been added to the blockchain (to avoid using an orphaned block).
- Each contestant is assigned a number in the order that they registered (or were nominated?) for the election.
- HMAC_SHA256 is chosen as the hashing method, with the contestant unique data represented as a string for the key and the block hash in hex represented as a string for the message
- Hash results will be sorted numerically in increasing order
- The "winners" will be chosen in numeric order of the resulting hashes as sorted from lowest to highest
After the election it is found the contestants that were assigned 3, 7, and 9 are tied for the final 2 positions.
Calculate the following:
- HMAC_SHA256("3", "00000000000000000159ed8373074591e4088c3735d4e85238b65c0a11bad6c9") = e69350a027d8b375da6b9c08556cc8a952b712174d87fe8f96be18c2eedd5abe
- HMAC_SHA256("7", "00000000000000000159ed8373074591e4088c3735d4e85238b65c0a11bad6c9") = dd9de1981a23af9af43110fb0e056b0ba06560b4dc8de7a37a133a3e9a9ea163
- HMAC_SHA256("9", "00000000000000000159ed8373074591e4088c3735d4e85238b65c0a11bad6c9") = ddfa6b045541afaafeb50e40b4732fa394de1952012cfde8519b13f7b872a9d8
The first winner is the contestant assigned 7 since his HMAC hash has the lowest value, the next winner is the contestant assigned 9 since his HMAC hash has the next lowest value.
If you want to reduce the number of people that have access to the contestants' unique identifiers before the results are determined, then you can randomly choose a 256 bit number for every contestant and publish the SHA256(identifier) list of contestant hashes. Then after the election, you can publish the identifier so that the SHA256(identifier) list and the elections results can verified.
EDIT: Removed an idea that was pretty silly and not well thought out.