AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 49 Bitcoin

bitcoin: preserve parity for XOnlyPublicKey

Public commit record

What the developer wrote

Authored by jrakibi

80/100 · Strong
bitcoin: preserve parity for XOnlyPublicKey

both From impls for XOnlyPublicKey lose parity because they call `from_secp(`,
which defaults to Parity::Even. we now preserve parity by extracting it from
x_only_public_key() instead
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit fixes a bug in how X-only public keys were created from full public keys. An X-only key is just the X coordinate of a point, but a point can have an even or odd Y coordinate (parity). The old code always assumed even parity, which could silently produce the wrong key for odd-parity inputs. The fix preserves the actual parity from the source key.

Recommended action

Review any code that converted a full PublicKey to XOnlyPublicKey before this patch, especially Taproot output construction, tweaking, or BIP-340 operations. Re-derive affected keys/addresses and verify parity correctness. Consider adding regression tests for odd-parity public keys.

Security signals we found

01

Incorrect cryptographic key derivation

02

Parity mismatch in X-only public key conversion

03

Potential Taproot address/script derivation divergence

04

Silent data corruption rather than crash

Risk score

Why this scored 49/100

Our methodology →
Potential impact 12/30
Exploitability 10/25
Stealth signal 8/15
Affected reach 10/15
Confidence 6/10
Evidence quality 3/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.