Repository navigation
feat(crypto): batch-verify BLS signatures via blst multi-pairing - #397
Merged
Merged
Conversation
Add `verify_batch()` to `aether-crypto-bls` using blst's `verify_multiple_aggregate_signatures` with randomized 64-bit scalars (Bellare et al. 2007). N verification equations collapse into one final exponentiation — blst parallelizes the miller loops internally. Wire batch verification into consensus via `HybridConsensus::batch_process_votes()`: pre-validate votes, batch-verify all BLS signatures in one call, then process each through the existing equivocation/dedup/quorum logic. Falls back to individual verification when the batch check fails (identifies which specific vote has a bad signature). Blast radius: consensus `process_vote()` is unchanged — batch_process_votes is additive. BLS crate gains one new public function. No behavioral changes to existing code paths. Node crate tests pass (depends on consensus). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
verify_batch()toaether-crypto-blsusing blst'sverify_multiple_aggregate_signatureswith randomized 64-bit scalars (Bellare et al. 2007). N verification equations collapse into one final exponentiation — blst parallelizes the miller loops across a thread pool internally.HybridConsensus::batch_process_votes()that pre-validates votes, batch-verifies all BLS signatures in one call, then processes each through existing equivocation/dedup/quorum logic. Falls back to individual verification when the batch fails (identifies bad votes).verify_batch(valid, bad sig, empty, single, same-message, throughput), 3 forbatch_process_votes(quorum, bad sig rejection, empty).Blast radius
process_vote()is unchanged —batch_process_votesis purely additive.verify_batch). No behavioral changes to existing API.aether-crypto-bls,aether-consensus.aether-nodetests pass (depends on consensus).Security
Random 64-bit scalars in the linear combination prevent an attacker from crafting two invalid signatures whose pairing contributions cancel (standard batch verification security argument, Bellare-Garay-Rabin 2007). If the batch check fails, individual fallback verification identifies the bad vote(s).
Test plan
cargo test -p aether-crypto-bls --all-features— 30 pass, 2 ignoredcargo test -p aether-consensus --all-features— 156 passcargo test -p aether-node --all-features— all passcargo clippyon touched crates — cleancargo fmt --check— clean--ignoredthroughput benchmark:cargo test -p aether-crypto-bls -- verify_batch_throughput --ignored🤖 Agent 5 — Cryptography & Refactor Lead