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

contractcourt: implement production taproot witness selection

Public commit record

What the developer wrote

Authored by Olaoluwa Osuntokun

73/100 · Adequate
contractcourt: implement production taproot witness selection

This commit implements the core logic for selecting appropriate witness types
based on channel type in the contract resolution system. The commit sweep
resolver, HTLC timeout resolver, and HTLC success resolver have been updated
to use production taproot witness types when handling final taproot channels.

For each resolver, the witness type selection follows a consistent three-way
pattern: production taproot channels use Final witness types, staging taproot
channels use the existing taproot witness types, and legacy channels continue
to use their established witness types. This ensures that each channel type
uses the appropriate script structure and witness generation logic.

The HTLC success resolver required the addition of a new production input
constructor to properly handle direct HTLC sweeps on remote commitments with
production taproot channels. The HTLC timeout resolver was updated to handle
both second-level timeout transactions and direct timeout sweeps with the
correct production witness types.

These changes ensure that production taproot channels benefit from the
optimized script structure using OP_CHECKSIGVERIFY while maintaining full
backward compatibility with staging taproot and legacy channel types.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context
The short version

What changed, and why it matters

This commit updates part of LND's on-chain dispute-resolution code so that a new 'final' taproot channel type uses its own dedicated witness types when spending commitment outputs. It is a feature-completion change that adds the correct script/witness selection for production taproot channels while keeping older channel types on their existing paths. There is no direct evidence in the commit that this fixes an active security vulnerability; it appears to be correctness and compatibility work for a new channel type.

Recommended action

Treat as a normal feature/correctness commit. Review the related HTLC resolver and input constructor changes mentioned in the commit message to confirm the full witness-selection matrix is consistent. Run or verify taproot channel sweep tests, especially for final vs. staging channel types, before deploying in production.

Security signals we found

01

Witness-type selection logic for commitment output sweeps

02

New channel feature flag (IsTaprootFinal) introduced in selection path

03

Maintains backward-compatible fall-through for staging taproot and legacy channels

04

Commit message frames change as production taproot correctness, not a vulnerability fix

Risk score

Why this scored 32/100

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