-
Couldn't load subscription status.
- Fork 300
feat(secp256k1): implement public key recovery in secp256k1 unit tests #7301
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
Conversation
995d77a to
a5a357b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements public key recovery functionality for secp256k1 signatures to support the FLRP coin implementation. The changes add signature recovery capabilities using the secp256k1 package, enabling verification of signatures by recovering the public key from the signature and message.
Key Changes
- Added
recoverPublicKeymethod to the secp256k1 module with validation for message hash length, signature format, and recovery parameter - Enhanced signature creation in utils.ts to include recovery parameter (creating 65-byte signatures instead of 64-byte)
- Implemented
recoverySignaturemethod to recover public keys from signatures with proper message hashing
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| modules/secp256k1/src/index.ts | Adds recoverPublicKey method with input validation for hash length, signature format, and recovery parameter |
| modules/secp256k1/test/index.ts | Comprehensive test suite for public key recovery covering compressed/uncompressed formats and error cases |
| modules/sdk-coin-flrp/src/lib/utils.ts | Updates createSignature to append recovery parameter and implements recoverySignature to extract and use it |
| modules/sdk-coin-flrp/test/unit/lib/utils.ts | Test cases validating signature recovery functionality and error handling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@claude can you explain this PR and provide a review? |
@shenbenson claude review is not enabled on SDK PRs. you can refer to this copilot review --> #7301 (review) |
Ticket: WIN-7654
enhance signature creation and recovery with secp256k1 package for sdk-coin-flrp and added related test cases