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

primitives: Fix hash debug reversal for no-hex

Public commit record

What the developer wrote

Authored by Mitchell Bagot

68/100 · Adequate
primitives: Fix hash debug reversal for no-hex

The hash_types in primitives can have a reversal flag as defined in
the hashes impl of the wrapped hash type. For non-hex builds, the
debug implementation doesn't currently handle reversing correctly.

Fix Debug impl for reversed hash types in primitives
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit fixes a formatting bug in how Bitcoin transaction and block hashes are displayed when the library is built without the optional 'hex' feature. Some hash types in Bitcoin are conventionally shown in reverse byte order. The old no-hex debug code ignored that convention and always printed bytes forward, so a developer could see a hash string that looks wrong compared to the rest of the ecosystem. It is a display bug, not a cryptographic or consensus bug, and it does not directly let an attacker steal funds or corrupt data.

Recommended action

Treat as a low-severity correctness fix. Users relying on Debug output of Txid/BlockHash/etc. without the hex feature should upgrade to avoid reversed-hash confusion. No immediate incident response is warranted.

Security signals we found

01

Display/formatting inconsistency in hash debug output

02

Reversal flag ignored in no-hex code path

03

Potential developer confusion or misidentification of transaction/block hashes

Risk score

Why this scored 20/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 2/15
Affected reach 3/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.