Skip to content

Add SchnorrSignature type with parsing and serialization #9

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

Merged
merged 3 commits into from
Oct 16, 2024

Conversation

prolic
Copy link

@prolic prolic commented Sep 30, 2024

  • Introduced SchnorrSignature type with parsing and serialization functions.

resolves #8

@prolic
Copy link
Author

prolic commented Sep 30, 2024

@ProofOfKeags Let me know if I should change something. I also added the randomness, that was only put as "todo".

@prolic
Copy link
Author

prolic commented Sep 30, 2024 via email

@prolic prolic changed the title Add randomness to Schnorr signatures for BIP340 compliance, add SchnorrSignature type with parsing and serialization Add SchnorrSignature type with parsing and serialization Sep 30, 2024
@prolic
Copy link
Author

prolic commented Sep 30, 2024

@ProofOfKeags done

@prolic
Copy link
Author

prolic commented Sep 30, 2024

@ProofOfKeags I added a second commit with the randomness changes required (also schnorrSign lives now in IO). It's up to you if you want to accept the randomness or not, but the schnorr signature changes with import / export capabilities are something that I absolutely need.

Thanks for your great work, without you, I would have to maintain yet another lib.

Copy link
Collaborator

@ProofOfKeags ProofOfKeags left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One change I'd make and otherwise I think this is ready to go.

@prolic
Copy link
Author

prolic commented Sep 30, 2024 via email

@prolic
Copy link
Author

prolic commented Oct 1, 2024

@ProofOfKeags done. Please double check, I hope I didn't miss anything.

Copy link
Collaborator

@ProofOfKeags ProofOfKeags left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely to cause memory safety issues as is. I'm surprised the tests pass. If you get burned out on this PR I can take it over. Also happy to keep giving feedback and getting it to where it needs to be.

@prolic
Copy link
Author

prolic commented Oct 2, 2024 via email

@ProofOfKeags
Copy link
Collaborator

Sorry, I actually can't do any serious C 🤣. But I'll give it another shot
tomorrow if you don't get to it before me.

No worries. The main thing to pay attention to is that you don't want to let the pointer escape the scope of the closure. Basically, don't return the pointer out of the closure passed to useAsCString.

@prolic
Copy link
Author

prolic commented Oct 2, 2024

@ProofOfKeags Alright, I squashed the last 2 commits. I think I now understand your point and I hope the solution I provided is sufficient.

@ProofOfKeags
Copy link
Collaborator

Looks like I can't push to this branch right now despite being a maintainer. This is good but I need two more tiny things to be done and we can merge:

  1. please reauthor 52473c8 to include a change to the package.yaml file with the random dependency added. We do not use cabal files directly here. They are autogenerated by the package.yaml
  2. please squash (preferably with a fixup) 73758ee and ed56452

prolic added 2 commits October 2, 2024 14:42
- Add deterministic and non-deterministic Schnorr signing functions
- Update tests to cover new signing functions
- Modify schnorrSign to accept optional StdGen for controlled randomness
@prolic
Copy link
Author

prolic commented Oct 2, 2024

@ProofOfKeags pushed

Copy link
Collaborator

@ProofOfKeags ProofOfKeags left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good to go @wraithm do you wanna take a second look?

@prolic
Copy link
Author

prolic commented Oct 15, 2024

ping @ProofOfKeags @wraithm

@ProofOfKeags ProofOfKeags merged commit 9db4d62 into haskell-bitcoin:master Oct 16, 2024
@prolic
Copy link
Author

prolic commented Oct 16, 2024

@ProofOfKeags Thank you so much! Any change I can get this on hackage, too?

@ProofOfKeags
Copy link
Collaborator

Yes, can do. Give me a day or so.

@prolic
Copy link
Author

prolic commented Nov 12, 2024

@ProofOfKeags please relase on hackage ❤️

@ProofOfKeags
Copy link
Collaborator

Uploaded at 0.3.0

@prolic
Copy link
Author

prolic commented Nov 19, 2024

thank you!

@prolic prolic deleted the v2 branch November 19, 2024 21:55
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.

Wrong export for schnorr signatures
2 participants