Refactor signatures#457
Merged
jonesmarvin8 merged 11 commits intomainfrom Apr 30, 2026
Merged
Conversation
6 tasks
moudyellaz
reviewed
Apr 27, 2026
moudyellaz
approved these changes
Apr 29, 2026
Collaborator
moudyellaz
left a comment
There was a problem hiding this comment.
lgtm, thanks for addressing my comments
schouhy
approved these changes
Apr 30, 2026
Collaborator
schouhy
left a comment
There was a problem hiding this comment.
Thanks LGTM! Left some minor comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Purpose
Refactor signatures for compatibility with Keycard. Both Keycard and LEE are BIP-340 compliant; however, the proposal was updated in 2022. Keycard is pre-2022 BIP-340 and LEE (currently) is post-2022. Post 2022 allowed for signatures to sign messages of variable length.
In this PR, we pre-hash messages before signing. Thus, enforcing 32-byte length for messages.
This PR updates how messages are signed. This induces a breaking change to LEE.
⚙️ Approach
Message(public and privacy version) for to hash a message (hash_message()).Signature::newlogic to only accept[u8;32]message.Signature::new_with_aux_randupdated tosign_prehash_with_rand🧪 How to Test
Refactoring. All previous tests still work (except the test vectors noted above)
🔗 Dependencies
N/A
🔜 Future Work
None.
📋 PR Completion Checklist
Mark only completed items. A complete PR should have all boxes ticked.