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

v2: Improve signature and nonce handling #11

Merged
merged 2 commits into from
Feb 20, 2025
Merged

v2: Improve signature and nonce handling #11

merged 2 commits into from
Feb 20, 2025

Conversation

lukechampine
Copy link
Member

@lukechampine lukechampine commented Feb 18, 2025

Sia has historically hashed all signature messages with BLAKE2b (in addition to the SHA512 performed internally by Ed25519), but this is unnecessary. Furthermore, nonces were being reused in an unsafe manner that could leak plaintext relationships (though the encryption key itself remains safe). This PR addresses both issues by bumping the version to 3 and branching on the version within the handshake. I don't love this; the "right" way to introduce a new version is to create an entire new v3 package. But that felt like an egregious amount of duplicated code. I'm hoping that we can clean up this situation when we drop support for v1 post-hardfork.

I'll try running a node with these changes to ensure that it can communicate with existing v2 muxes.

@n8maninger n8maninger merged commit 4ae5086 into master Feb 20, 2025
9 checks passed
@n8maninger n8maninger deleted the flip-nonce branch February 20, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants