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

silentpayments: flush labels before direct match

Public commit record

What the developer wrote

Authored by Lőrinc

78/100 · Adequate
silentpayments: flush labels before direct match

A direct x-only match stops scanning before a partial batch of earlier label candidates is checked.
The batch-inversion optimization can therefore return a later unlabeled output and discard label metadata for the earlier output.

Check the pending batch before accepting the direct match.
This restores the scan order from before batching, where the first matching output wins.

The regression puts a labeled `k = 0` output before its unlabeled counterpart and requires scanning to return it with the label.
✓ 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 fixes a bug in Bitcoin's silent payments scanning code. When a wallet scans a transaction for outputs it can spend, a performance shortcut could accidentally skip over a labeled output and report a plain (unlabeled) version instead. The fix makes the scanner check pending labeled candidates before accepting a direct unlabeled match, restoring the intended 'first match wins' behavior and preserving label metadata.

Recommended action

Review whether any released versions or downstream consumers of this silent payments implementation shipped with the buggy scan order, and consider whether wallet users relying on labeled outputs need guidance. The fix itself should be merged and the new regression test run in CI.

Security signals we found

01

Incorrect output attribution in wallet scanning

02

Loss of label metadata for received funds

03

Regression test demonstrates labeled output precedence failure

04

Batch-inversion optimization changes effective scan order

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.