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

wallet: generate fixup chainmoves and channelmoves when first starting.

Public commit record

What the developer wrote

Authored by Rusty Russell

73/100 · Adequate
wallet: generate fixup chainmoves and channelmoves when first starting.

If we don't have an accountdb from bookkeeper:

1. Generate a deposit chain event for every confirmed UTXO.
2. Generate an open chain event for every open, confirmed channel.
3. Generate a push/lease event if necessary.
4. Generate a fixup "journal" entry if balance is different from initial.

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

What changed, and why it matters

This commit finishes a previously-stubbed database migration that invents historical accounting records ('coin movements') for nodes that never ran the optional bookkeeper plugin. It does not change how funds are secured on the blockchain; it only backfills internal ledger entries so balances displayed by the accounting plugin look correct after an upgrade. There is no obvious way for an external attacker to exploit it, but any migration that writes made-up ledger entries carries a risk of miscounting funds or confusing downstream tools if the invented numbers are wrong.

Recommended action

Treat this as a data-integrity migration rather than an active vulnerability. Operators upgrading without a bookkeeper accountdb should verify that bkpr-listaccountevents and channel balances look reasonable after first startup, and report discrepancies before relying on the migrated records for accounting or tax purposes. Developers should review the synthetic journal-entry arithmetic and edge cases around closed channels, lease fees, and push amounts.

Security signals we found

01

Migration writes synthetic accounting records derived from existing on-chain/channel state

02

Use of abort() on arithmetic overflow/underflow in balance calculations

03

New generalized constructors accept explicit channel_id and timestamp, changing assumptions previously tied to live channel objects

04

Previously stubbed migration function now executes automatically at startup when no bookkeeper db exists

Risk score

Why this scored 22/100

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