-
-
Notifications
You must be signed in to change notification settings - Fork 54
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: recoverPublicKey should return bytes #60
Comments
I kinda agree, but we're stuck with the current type for a long time, until next major version. Which will probably need re-audit, etc. Updating docs seems like a nice idea. |
paulmillr
changed the title
Unexpected return type for sig.recoverPublicKey(msg)
v2: recoverPublicKey should return bytes or hex
Nov 10, 2023
paulmillr
changed the title
v2: recoverPublicKey should return bytes or hex
v2: recoverPublicKey should return bytes
Nov 10, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried to run the example from the README to recover the public key from a signature
sig.recoverPublicKey(msg) === pub; // public key recovery
which results actually as false.
I saw in the test the
secp256k1.getPublicKey(priv);
gets wrapped into a Point objectconst publicKey = Point.fromHex(secp.getPublicKey(privateKey)).toHex(false);
which isn't that expected using the library.
I would expect to get an Uint8Array back when calling
sig.recoverPublicKey(msg)
Test code:
The text was updated successfully, but these errors were encountered: