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

wallet: warn against accidental unsafe older() import

Public commit record

What the developer wrote

Authored by Sjors Provoost

73/100 · Adequate
wallet: warn against accidental unsafe older() import

BIP 379 allows height and time locks that have no consensus meaning in BIP 68 / BIP 112.
This is used by some protocols like Lightning to encode extra data, but is unsafe when
used unintentionally. E.g. older(65536) is equivalent to older(1).

This commit emits a warning when importing such a descriptor.

It introduces a helper ForEachNode to traverse all miniscript nodes.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This change adds a warning when users import a Bitcoin wallet descriptor containing an 'older()' time or block lock that looks safe but actually has no consensus effect. Because of how Bitcoin encodes relative locktimes, values above 65535 silently wrap around: older(65536) behaves like older(1). Someone could accidentally create a wallet that unlocks far sooner than they think. The patch does not block the import; it only warns.

Recommended action

Treat this as a useful hardening change, not a critical vulnerability fix. Users who previously imported miniscript descriptors with older() should review them for values >65535 (height) or >(65535*512) seconds (time). Wallet software relying on Bitcoin Core descriptors should surface these warnings to users and consider rejecting unsafe imports explicitly if policy requires it.

Security signals we found

01

New warning path for unsafe miniscript older() values

02

Consensus encoding ambiguity in BIP 68 nSequence relative locktimes

03

Advisory-only mitigation; import is not rejected

04

Tests added covering safe boundary, unsafe height, unsafe time, and after() non-warning

Risk score

Why this scored 38/100

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