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

maintain a verified block header store anchored at the pinned checkpoints, refreshing affected wallets on a reorg

Public commit record

What the developer wrote

Authored by Craig Raw

50/100 · Thin
maintain a verified block header store anchored at the pinned checkpoints, refreshing affected wallets on a reorg
✓ Specific, descriptive subject✓ Names a concrete action or component! No meaningful explanatory body
The short version

What changed, and why it matters

This commit adds a verified block-header store to the Sparrow Bitcoin wallet. It keeps a local copy of block headers above the built-in checkpoints, checks that each new header really links to the previous one, and automatically rewinds and refreshes wallet history if the Bitcoin chain reorganizes (a 'reorg'). The goal is to stop a malicious or buggy Electrum server from fooling the wallet with fake transaction confirmations.

Recommended action

Review the new HeaderStore and ElectrumServer header-sync paths for concurrency and error-handling correctness; exercise the reorg and deep-fork test scenarios; ensure the MAX_REORG_DEPTH choice and the 'equal work is adopted' policy are acceptable for the threat model. No immediate patch is indicated by the diff itself.

Security signals we found

01

Adds local verification of block headers against compiled-in checkpoints and proof-of-work rules

02

Handles chain reorgs by rewinding the header store and refreshing wallet history above the fork

03

Pairs block height and header together to prevent race conditions where height and header come from different blocks

04

Serializes header sync with headerSyncLock to prevent concurrent fetches from an honest server being misread as a fork

05

Distinguishes server refusal (VerificationException -> disable verification) from transport failure (ServerException) and unsupported method (UnsupportedMethodException)

06

Stores header cache in a network-specific, owner-only directory under the application cache

Risk score

Why this scored 61/100

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