Difference between revisions of "Use of Hashes in BlogNomic"

From BlogNomic Wiki
Jump to navigation Jump to search
Line 34: Line 34:
 
If the original string is very short or commonplace, such as a single dictionary word, the internet might already know about it. For example, the hash of the single word <code>tangelo</code> comes out as <code>e1723c6ace5b7108c93c49d4dcda9ea5</code>, and if you search online for that output hash, the internet will indeed tell you that this is the hash of "tangelo".
 
If the original string is very short or commonplace, such as a single dictionary word, the internet might already know about it. For example, the hash of the single word <code>tangelo</code> comes out as <code>e1723c6ace5b7108c93c49d4dcda9ea5</code>, and if you search online for that output hash, the internet will indeed tell you that this is the hash of "tangelo".
  
If the original string follows a predictable format, opponents might be able to guess what you wrote, and confirm their suspicion straight away. For example, if all orders in a game were being written in the form of <code>I move my army from [place] to [place].</code> and an opponent suspect you might be moving from Rome to Venice this turn, they could check the hash you'd shared to see if it matched that, before submitting their own orders. With a little more effort, a player might write a script to generate hashes for all possible sentences in that format, allowing them to read everyone's orders just from the hashes.
+
If the original string follows a predictable format, opponents might be able to guess what you wrote, and confirm their suspicion straight away. For example, if all orders in a game were being written in the form of <code>I move my army from [place] to [place].</code> and an opponent suspects you might be moving from Rome to Venice this turn, they could check the hash you'd shared to see if it matched that, before submitting their own orders. With a little more effort, a player might write a script to generate hashes for all possible sentences in that format, allowing them to read everyone's orders just from the hashes.
  
 
The way to get around both of these issues is to add a '''salt''' to the input string: a handful of unpredictable extra words or characters, added by the writer. These can just be stuck on the end of the input (<code>I move my army from Rome to Venice. paradiddle hypoxia terrarium magnetite</code>), or players can be encouraged to write their orders in any language they wish so long as the core instruction is unambiguous (<code>Leaving our garrison at Rome, my general leads his troops on the long march north to Venice.</code>) Both of these would be realistically unguessable.
 
The way to get around both of these issues is to add a '''salt''' to the input string: a handful of unpredictable extra words or characters, added by the writer. These can just be stuck on the end of the input (<code>I move my army from Rome to Venice. paradiddle hypoxia terrarium magnetite</code>), or players can be encouraged to write their orders in any language they wish so long as the core instruction is unambiguous (<code>Leaving our garrison at Rome, my general leads his troops on the long march north to Venice.</code>) Both of these would be realistically unguessable.

Revision as of 16:12, 27 March 2023

Essay by Kevan

BlogNomic dynasties sometimes use hashes to store information. Here's a simplified, game-specific overview of what hashes are and what you need to know about them.

How hashes work

A hashing process takes a piece of text and converts it into a short, garbled string of letters and numbers. That output string is known as a hash. You can try this out for yourself at https://www.md5hashgenerator.com

For example, the input string The Ruleset and Gamestate can only be altered in manners specified by the Ruleset. produces the hash 8d788fec20e1c0815096ecbf6fb6d84a

Hashing is a one-way process: it's not possible to reverse the hash to get the original string back. All input strings always reduce to a 32 character hash,[1] so a single hash will theoretically correspond to multiple potential input strings. And if you hashed the full text of a novel down to 32 characters, it would obviously be impossible to reverse that to get the entire novel back: no compression method could be that good.

All you can do is repeat the original string to confirm that it matches the hash.

Why this is useful for BlogNomic

Hashes allow players to publicly commit to a decision without revealing the details of that decision, in a way that they can confirm later on. It also doesn't require a third party to keep track of that data: although it works to have the Emperor receive and then publish such secret decisions, hashes don't require players to wait for the Emperor, and will survive the rare (but not unknown) situation where the Emperor disappears from the game mid-dynasty taking secret information with them.

An example game rule might be that players use hashes to announce their moves, and when everyone has announced, players reveal the actual moves, which get processed simultaneously:

Player 1, 9:30am: My moves are 3a20a09c9c8ecb4d1935f180a39c4f0b

Player 2, 9:45am: And mine are 2df028843fbc3b43957c626bbb111f9f

[other players pass]

Player 2, 2pm: Okay, my moves were I walk north, lock the front door, then move east to the drawing room.

Player 1, 2:10pm: Oh no! Mine were I search the garden twice, then move in through the front door. I'm locked out!

Having revealed their original inputs, each player is now able to confirm that when their opponent posted a hash earlier in the day, that hash corresponded to the input. A player can't change their mind and try to claim a different move instead, as that wouldn't match the earlier hash.

Strings to be careful of

If the original string is very short or commonplace, such as a single dictionary word, the internet might already know about it. For example, the hash of the single word tangelo comes out as e1723c6ace5b7108c93c49d4dcda9ea5, and if you search online for that output hash, the internet will indeed tell you that this is the hash of "tangelo".

If the original string follows a predictable format, opponents might be able to guess what you wrote, and confirm their suspicion straight away. For example, if all orders in a game were being written in the form of I move my army from [place] to [place]. and an opponent suspects you might be moving from Rome to Venice this turn, they could check the hash you'd shared to see if it matched that, before submitting their own orders. With a little more effort, a player might write a script to generate hashes for all possible sentences in that format, allowing them to read everyone's orders just from the hashes.

The way to get around both of these issues is to add a salt to the input string: a handful of unpredictable extra words or characters, added by the writer. These can just be stuck on the end of the input (I move my army from Rome to Venice. paradiddle hypoxia terrarium magnetite), or players can be encouraged to write their orders in any language they wish so long as the core instruction is unambiguous (Leaving our garrison at Rome, my general leads his troops on the long march north to Venice.) Both of these would be realistically unguessable.

Remember your original strings!

The most important thing when using hashes in BlogNomic is to write the original strings down, and carefully. If you can't reproduce your original input exactly, you won't be able to prove that your hash is valid.

In the earlier example, if Player 1 could remember that 2df028843fbc3b43957c626bbb111f9f was the hash for locking the front door and moving to the drawing room, that in itself is not enough to confirm their move. They need to be able to quote the original string exactly to confirm to other players that this was their actual order.

Dynastic rules will usually be written in such a way that a player who forgets a string is no different from a player who failed to submit one at all: that their secret orders or information will be considered blank.

Examples of usage

  • The Tenth Dynasty of Josh used hashes in its Denizens rule: anonymous GNDT Hacker accounts could post a hash of "a grammatical English sentence of no more than 20 words which includes the Hacker’s own Corp Name and no other Corp Names" to record who controlled them, which the controlling player would have to confirm at a later date if they wanted to claim credit for the Hacker's actions.
  • The Sixteenth Dynasty of Kevan used hashes in its Confessions rule, for resolving Prisoners' Dilemmas. Two players would post comments as hashes, and then reveal the strings. The rule simply required strings to contain the word "defect" to be a defection, with all other outcomes (including the player failing to prove their hash) being taken as cooperation. Example post: The Vienna Opera Heist
  • The Twenty-Third Dynasty of Kevan used hashes in its Loyalty rule. Each player's first action had to be joining a secret faction by publicly posting a hash of such a statement; this could then be confirmed at the end of the game, for scoring.
  • The Fourteenth Dynasty of Josh used hashes in the Ethics of the Nobility, allowing the Emperor to note the true identity of an anonymous message sender in a way that could only be verified at the end of the game.
  • The First Dynasty of Habanero used hashes in its Secrets and Tells rule: when players found items in a search, they could privately decide what those items were, locking it in by posting a hash to their gamestate. If they wanted to reveal and use the item, they had to prove that their hash matched it.

Footnotes

  1. Or more, depending on what hashing system a dynasty decides to use. The examples in this essay just use basic MD5. At the time of writing, the core ruleset doesn't enforce a standard.

Further reading