-
Notifications
You must be signed in to change notification settings - Fork 374
Batch verification of ed25519 signatures #781
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
Comments
@ethanfrey @joe-bowman could you elaborate on your intended use case for bach verify, especially the range of the inputs (count and size)? I still wonder:
Ed25519 batch verification does not require the same message. If we keep it completely open, we need to allocate/copy |
I will defer to Joe on this, but I think when validations sign block headers, they may use the same message. Not fully sure there |
We can easily support two variants here:
All other combinations result in an error (including empty arrays, i. e. verifying nothing equals false / error). |
Agree with this. There are no other variants I can think of. |
There's one more potential use case we can support:
This is for verifying multiple messages signed by a single user / with the same private key. To be clear, we already support that conventionally: just send the same pubkey multiple times. It would be nice to support sending the pubkey only once, instead of multiple times. In the same way we support sending messages only once. By the way, this case is the one in which batch verification provides a (algorithmic) performance improvement over multiple single verifications. See https://github.com/ZcashFoundation/ed25519-zebra/blob/main/src/batch.rs#L167L172. |
Looking at the graph in https://docs.rs/ed25519-zebra/2.2.0/ed25519_zebra/batch/index.html it seems like batching saves more than 50% even when all pubkeys are distinct (blue vs. red line). Then if only one pubkey is used, you get another 2x improvement (green line vs. red line). So I wonder what the usual method is (in the comment). |
You're right. Funny that the graph contradicts the text to a certain extent. |
Given the state of this discussion, I would avoid any kind of optimizations that we need to build and maintain. Instead, let's focus on the most general API and use that to gather experience of its value and limitations. |
Uh oh!
There was an error while loading. Please reload this page.
Part of #751
Should be implemented via ed25519_zebra::batch. There you see we only get a single boolean result. And it turns out each item in the batch can be different. So the implementation looks something like
Is there a need to optimize for a batch that all share the same message?
The text was updated successfully, but these errors were encountered: