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

util.format_satoshis: floating-point paranoia

Public commit record

What the developer wrote

Authored by SomberNight

45/100 · Thin
util.format_satoshis: floating-point paranoia
✓ Descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
The short version

What changed, and why it matters

This commit tightens how Electrum converts numbers into displayed bitcoin amounts. It removes the ability to pass plain strings into a key formatting helper, and routes integer and float inputs through a safer Decimal conversion to avoid tiny rounding errors that can appear when computers handle decimal numbers. The change also makes one fee calculation explicitly use Decimal arithmetic. The patch is defensive and does not by itself fix a known exploitable bug, but it reduces the risk of incorrect amounts being shown or used in fee calculations.

Recommended action

Treat as a defensive hardening commit. Review whether any remaining float-based monetary paths should be migrated to Decimal, as suggested by the TODO. No immediate incident response is indicated, but downstream users relying on format_satoshis with string inputs will need to update their code.

Security signals we found

01

Floating-point/Decimal conversion hardening in monetary formatting functions

02

Removal of str input type from format_satoshis to reduce unexpected parsing paths

03

Explicit Decimal conversion in fee-per-byte calculation

04

Added unit test demonstrating correct rounding behavior for float input

05

TODO comment suggesting future hard-fail on float inputs for money values

Risk score

Why this scored 46/100

Our methodology →
Potential impact 12/30
Exploitability 8/25
Stealth signal 7/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.