Skip to content

Conversation

@mohd-kashif
Copy link
Contributor

@mohd-kashif mohd-kashif commented Oct 22, 2025

Ticket: WIN-7654

enhance signature creation and recovery with secp256k1 package for sdk-coin-flrp and added related test cases

@mohd-kashif mohd-kashif self-assigned this Oct 22, 2025
@mohd-kashif mohd-kashif changed the title feat(secp256k1): implement public key recovery in recoverySignature method and add unit tests feat(secp256k1): implement public key recovery in secp256k1 unit tests Oct 22, 2025
@mohd-kashif mohd-kashif force-pushed the WIN-7654 branch 2 times, most recently from 995d77a to a5a357b Compare October 22, 2025 13:10
@mohd-kashif mohd-kashif marked this pull request as ready for review October 22, 2025 13:37
@mohd-kashif mohd-kashif requested review from a team as code owners October 22, 2025 13:37
Copy link

Copilot AI left a 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 recoverPublicKey method 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 recoverySignature method 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.

…ethod and add unit tests

enhance signature creation and recovery with secp256k1 package for sdk-coin-flrp
and added related test cases

TICKET: WIN-7654
Copy link

Copilot AI left a 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.

@shenbenson
Copy link

@claude can you explain this PR and provide a review?

@mohd-kashif
Copy link
Contributor Author

@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)

@mohd-kashif mohd-kashif merged commit 5a7401c into master Oct 24, 2025
16 checks passed
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.

4 participants