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

fix potential off by 1 sat rounding error on imported send to many dialog amounts

Public commit record

What the developer wrote

Authored by Craig Raw

50/100 · Thin
fix potential off by 1 sat rounding error on imported send to many dialog amounts
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
The short version

What changed, and why it matters

This commit fixes a small rounding bug when importing a 'send to many' payment list in Sparrow Wallet. When amounts were entered in whole bitcoins (BTC), the app converted them to satoshis by multiplying with a large constant using normal decimal math. Because computers can store decimal fractions imprecisely, the result could be off by one satoshi (the smallest Bitcoin unit). The fix uses a dedicated helper that handles the conversion more safely. A one-satoshi error is tiny in dollar terms, but could cause a transaction to be slightly wrong or, in edge cases, fail validation.

Recommended action

Review `BitcoinUnit.getSatsValue(double)` to confirm it uses a rounding mode appropriate for monetary conversion (e.g., HALF_UP or exact parsing). Consider adding unit tests covering BTC values with many decimal places and edge cases such as 0.00000001 BTC. Users relying on imported send-to-many lists should verify payment totals after updating.

Security signals we found

01

Financial-amount rounding error in transaction construction

02

Floating-point conversion from BTC to satoshis replaced with unit-aware helper

03

Potential off-by-one satoshi discrepancy in imported payment amounts

04

No input validation or bounds checks added in this patch

Risk score

Why this scored 42/100

Our methodology →
Potential impact 12/30
Exploitability 5/25
Stealth signal 8/15
Affected reach 6/15
Confidence 7/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.