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

bookkeeper: use iso4217 check, scale and print correct minor units.

Public commit record

What the developer wrote

Authored by Rusty Russell

65/100 · Adequate
bookkeeper: use iso4217 check, scale and print correct minor units.

e.g. USD = 2, CLF = 4, XAU = 0.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides an explanatory body
The short version

What changed, and why it matters

This commit fixes how the Core Lightning bookkeeper plugin handles fiat currency codes and their decimal places. Previously it assumed every currency used 4 decimal places when storing and displaying exchange rates. Now it uses a proper ISO 4217 table so currencies like USD use 2 decimals, Chilean Unidad de Fomento (CLF) uses 4, and gold (XAU) uses 0. It also validates that the configured currency is a known ISO 4217 code. The main risk is that old stored rates could be misinterpreted after the change, and users might see wrong converted values if they relied on the previous fixed scaling.

Recommended action

Treat as a functional correctness patch, not a security emergency. Operators using bkpr-currency should verify that historical currency rate data is still interpreted correctly after upgrade, because the scaling factor for stored rates may have changed. Review whether existing datastore entries need migration or whether the plugin already handles the transition.

Security signals we found

01

Input validation added: currency option is now checked against ISO 4217 list

02

Data-format change: stored raw_rate scaling changes from fixed 4 decimals to currency-specific decimals

03

Potential downgrade in data fidelity for currencies with fewer than 4 minor units (e.g. USD now uses 2 decimals instead of 4)

04

No cryptographic, network, or memory-safety changes observed

Risk score

Why this scored 18/100

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