Skip to content

fix(crypto): bind g1 identity to g2 in bls verification - #481

Merged
oxsteins merged 5 commits into
mainfrom
fix/bls-key-binding
Aug 1, 2026
Merged

fix(crypto): bind g1 identity to g2 in bls verification#481
oxsteins merged 5 commits into
mainfrom
fix/bls-key-binding

Conversation

@oxsteins

Copy link
Copy Markdown
Contributor

BLS verification checked the signature against the g2 supplied in the incoming message, with nothing tying it to the g1 key a validator is identified by. This folds the keypair check into the existing pairing so both halves have to belong together, matching SigBlsBn254.verify in relay-contracts. It stays a two term pairing check, so there is no extra pairing on the gossip path.

Applies to both bn254 and bls12381. Verify in bn254 was a byte for byte duplicate of VerifyWithHash and now delegates to it. Adds regression tests at the crypto and entity-processor layers.

Validators are identified by their on-chain g1 key, but verification ran
against the g2 supplied in the incoming message with nothing tying the two
together. Fold the keypair check into the pairing so a substituted g2 is
rejected, matching SigBlsBn254.verify in the contracts. Applies to both
bn254 and bls12381.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@github-actions

Copy link
Copy Markdown

Failed to generate code suggestions for PR

@alrxy
alrxy self-requested a review July 31, 2026 06:54
oxsteins added 2 commits July 31, 2026 13:05
Committer indices serialize as a bitmap, so ordering is not representable
and the deriver sorts them for that reason. Assert the set round-trips
intact in ascending order instead of an insertion order the codec never
promised.
Generated bindings differ between abigen releases and CI fails if `make
generate` leaves a diff, so an unpinned @latest breaks every PR whenever
upstream changes its output. v1.17.5 is the current latest and matches the
committed bindings.
@oxsteins
oxsteins enabled auto-merge (squash) August 1, 2026 05:26
@oxsteins
oxsteins merged commit b76680c into main Aug 1, 2026
9 of 13 checks passed
@oxsteins
oxsteins deleted the fix/bls-key-binding branch August 1, 2026 05:50
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.

2 participants