Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future-proofed replay protection via hardfork hash personalization constants. #2566

Closed
nathan-at-least opened this issue Aug 4, 2017 · 1 comment
Labels
C-future-proofing Category: Changes that minimise the effects of shocks and stresses of future events. I-SECURITY Problems and improvements related to security. network upgrade management Z-NU0 wishlist

Comments

@nathan-at-least
Copy link
Contributor

nathan-at-least commented Aug 4, 2017

Specification: When hashing transactions for references [1], Include a personalization field [2] which is defined by the protocol spec and is intended to change on each hardfork at the appropriate trigger height.

Example: Starting with Hardfork 0, if we use this approach we may define a global constant such as Zcash Replay Protection: HF0 <128 bits of entropy>. Later, when the "Zcash Cashy Cash" fork comes along, they would politely activate a different personalization such as Zcash Replay Protection: Zcash Cashy Cash <127 different bits of entropy>. The later forks would ensure the switch of personalization only occurs when a hardfork triggers so that their nodes can still validate pre-fork transactions.

Motivation: One nice detail about these constants is that they are not user facing so there needn't be political struggle over who gets to control a name. End-user won't ever see these and only devs and geeks need to know it exists.

Inspiration: This tweet by @SergioDemianLerner: https://twitter.com/SDLerner/status/893188548211470336?s=03

Further Analysis: I don't yet understand the implications of doing this. It is clear this will ensure nodes from different hardforks cannot validate prevout pointers or block transaction tree roots. I'm not yet comfortable with this until I understand what nodes do when they cannot validate those references. For example, if they cannot resolve a prevout they may assume it refers to a transaction not-yet-seen and therefore it will hold onto the "other fork" transaction indefinitely.

Another kind of analysis worth pursuing: what if two factions intend to cause mutually incompatible, chain-splitting, hardfork upgrades, but for unanticipated political reasons they both refuse to alter their personalization constants?

Footnotes:

[1] References include txids, such as prevout pointers, what UIs / block explorers display, etc…

[2] I use the term personalization inspired by the clean design of BLAKE2's interface. See The BLAKE2 Document, §2.8. This is a globally unique value mixed into all instances of the hash function for a given application purpose, in contrast to the term salt which often implies a unique value mixed into each instance.

@nathan-at-least nathan-at-least changed the title Future-proofed replay protection. Future-proofed replay protection via hardfork hash personalization constants. Aug 4, 2017
@daira daira added C-future-proofing Category: Changes that minimise the effects of shocks and stresses of future events. I-SECURITY Problems and improvements related to security. labels Sep 28, 2017
@nathan-at-least
Copy link
Contributor Author

Note, this is similar to #2584 except less specified and maybe dangerously ambiguous (for example, when I wrote it I thought it may apply to txid hashes, not just signatures). Let's just do #2584 which has much broader review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-future-proofing Category: Changes that minimise the effects of shocks and stresses of future events. I-SECURITY Problems and improvements related to security. network upgrade management Z-NU0 wishlist
Projects
None yet
Development

No branches or pull requests

2 participants