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

Return parity from serialize in XOnlyPublicKey

Public commit record

What the developer wrote

Authored by Mitchell Bagot

80/100 · Strong
Return parity from serialize in XOnlyPublicKey

In order to have sufficient information to completely reconstruct an
XOnlyPublicKey, users now need to know the parity of the key. As such,
we should now return it alongside the raw key bytes from serialize.

Add parity return from serialize in XOnlyPublicKey.
✓ 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 changes the public API of XOnlyPublicKey::serialize() so it now returns both the 32-byte x-only key and its parity bit, instead of just the bytes. All existing callers inside the crate are updated to take only the first element (the bytes) and ignore the parity where it isn't needed. This is a routine API design change to expose extra information for users who need to fully reconstruct a key; it does not fix a bug or close a security hole.

Recommended action

No security action required. Downstream users of rust-bitcoin who call XOnlyPublicKey::serialize() will need to update their code to handle the new tuple return type when upgrading. Reviewers may want to confirm that no internal caller accidentally discards parity where it is now semantically required.

Security signals we found

01

API signature change in public key serialization

02

No validation or bounds-checking changes

03

No secret material handling changes

04

No cryptographic operation changes

Risk score

Why this scored 17/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 5/15
Confidence 8/10
Evidence quality 4/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.