Skip to content

Conversation

nlordell
Copy link
Collaborator

@nlordell nlordell commented Aug 5, 2025

The Ledger device API returns the signature v value as a hexadecimal encoded string and not a number. This causes unexpected behaviour with the bitwise operations, and why the yParity computation would sometimes fail.

This PR fixes the issue by first parseInt-ing the v value in base 16 (i.e. hexadecimal) before applying the bitwise operations.

The Ledger device API returns the signature `v` value as a hexadecimal
encoded string and **not** a number. This causes unexpected behaviour
with the bitwise operations, and why the `yParity` computation would
sometimes fail.

This PR fixes the issue by first `parseInt`-ing the `v` value in base
16 (i.e. hexadecimal) before applying the bitwise operations.
@nlordell nlordell requested a review from a team as a code owner August 5, 2025 08:01
@nlordell nlordell merged commit 700879c into main Aug 5, 2025
1 check passed
@nlordell nlordell deleted the fix/parse-v branch August 5, 2025 08:06
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.

2 participants