Skip to content
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

Verify error #5

Closed
shanelau opened this issue Apr 3, 2023 · 2 comments · Fixed by #6
Closed

Verify error #5

shanelau opened this issue Apr 3, 2023 · 2 comments · Fixed by #6

Comments

@shanelau
Copy link

shanelau commented Apr 3, 2023

  String public =
      '0000a0fa65fcccd99e6fd32fc7870339af40f4a94703ea30999fc5c091daa222';
  String message =
      '3518d08e684f4b94a68367a060a9075dc0b5d1058f87bcc6b6bc9e676b9f2c71';
  String sig =
    '637d91a9f93fd4a6b71ed3a542a9159ed58dc63bfaa319d834f59f158851e28803f54c9e89c26edcf1942819fd4571bc891874318a84d3e387755d4cf113ed38';

const result  = bip340.verify(public, message, sig);
result  === false

The is an error and I think it's because my account number starts with 0000. When I switched to another account, verification succeeded.

However, when I switched to a different library, there was no error: bip-schnorr.

This library will return the correct validation results.

@ryzizub
Copy link
Contributor

ryzizub commented May 22, 2023

Yeah seems that public keys that starts with zeros have issues in this library. Generating signatures are also a problem here.

Testing private key nsec1dwt55gfuryx9mmmqv9g3skasxmvsv89h4f525pzyu53rvj07d3jqqu37wm

@ryzizub
Copy link
Contributor

ryzizub commented Jun 4, 2023

Fixed this in #6

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 a pull request may close this issue.

2 participants