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

currencyrate: make oracle store and serve the BTC price, not msat per fiat unit.

Public commit record

What the developer wrote

Authored by Rusty Russell

83/100 · Strong
currencyrate: make oracle store and serve the BTC price, not msat per fiat unit.

This is the first step in updating the API.

Subtly, the median of BTC prices is different from the median of msat-per-dollar,
given it's the invoice. This changes our test:

```
FAILED tests/test_currencyrate.py::test_cached_median - assert 133333 == 150000
```

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

What changed, and why it matters

This commit changes how a Core Lightning plugin stores and calculates Bitcoin exchange rates. Previously the plugin stored 'millisatoshis per fiat unit' and took the median of those inverted values. Now it stores the raw fiat price of one bitcoin and converts only at output time. The commit message explicitly notes this is a subtle change because the median of bitcoin prices is mathematically different from the median of inverted rates. The patch is described as the first step in updating the API, not as a security fix.

Recommended action

No security action required. Treat as a normal API correctness refactor. If reviewing the broader currencyrate feature, verify that downstream consumers expect the new median semantics and that floating-point rounding behavior is acceptable for financial amounts.

Security signals we found

01

No security-relevant keywords in commit title or message

02

No bounds checking or sanitization changes

03

No cryptographic or authentication changes

04

Arithmetic refactor with explicit note about median semantics

05

Test expectation changed to match new formula

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.