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

VerifySignature should be called in the BOLT11PaymentRequest ctor #21

Open
Sword-Smith opened this issue Sep 27, 2019 · 1 comment
Open

Comments

@Sword-Smith
Copy link

Sword-Smith commented Sep 27, 2019

As far as I can see, the signature is not verified by the constructor. Why not call VerifySignature iff ExplicitPayeePubKey != null and throw an exception if the signature does not match explicit pubkey?

Alternatively, the signature could also be verified in Parse/TryParse.

@NicolasDorier
Copy link
Member

This is because of performance. Imagine you deserialize 1000th payment requests. Checking the signatures can be the difference between 100 ms and 10 seconds.

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

No branches or pull requests

2 participants