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

Add network to domain seperated hashes #5652

Closed
SWvheerden opened this issue Aug 22, 2023 · 1 comment · Fixed by #5980
Closed

Add network to domain seperated hashes #5652

SWvheerden opened this issue Aug 22, 2023 · 1 comment · Fixed by #5980
Assignees
Labels
release-blocker Something that needs to be fixed before a release can be made

Comments

@SWvheerden
Copy link
Collaborator

Currently, it's possible to replay duplicate utxos on separate networks. If we make the hashes require the network, this will enforce unique signatures per network.

@AaronFeickert
Copy link
Collaborator

One way to accomplish this generically would be to include a unique network identifier as part of hasher domain separation.

@SWvheerden SWvheerden added the release-blocker Something that needs to be fixed before a release can be made label Nov 17, 2023
@brianp brianp self-assigned this Nov 23, 2023
SWvheerden pushed a commit that referenced this issue Dec 1, 2023
Description
---
Add a lazy static value that allows us to access what the current
network is globally, so we can use the network byte to create network &
domain-specific hashers.

Motivation and Context
---
This prevents the spending of duplicated UTXO's across networks as the
hashes would compute differently based on the network byte.

Closes: #5652 

How Has This Been Tested?
---
CI

Breaking Changes
---

- [ ] None
- [x] Requires data directory on base node to be deleted
- [x] Requires hard fork
- [x] Other - Please specify

This will invalidate all previous hashes on the network, and require
both a network reset, with full data directory deletion.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-blocker Something that needs to be fixed before a release can be made
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants