Skip to content

contractcourt: validate HTLC resolver spends - #11113

Draft
yyforyongyu wants to merge 8 commits into
lightningnetwork:masterfrom
yyforyongyu:fix-htlc-spend-validation
Draft

contractcourt: validate HTLC resolver spends#11113
yyforyongyu wants to merge 8 commits into
lightningnetwork:masterfrom
yyforyongyu:fix-htlc-spend-validation

Conversation

@yyforyongyu

Copy link
Copy Markdown
Member

Summary

Follow up on #10869 by closing the remaining resolver spend-validation gaps
identified while addressing #10840.

Change Description

  • Validate notifier-selected inputs against the resolver's watched outpoint
    before recording a successful claim.
  • Derive the claim transaction ID from the validated spending transaction.
  • Authenticate Taproot success scripts, leaf versions, and control proofs
    against the authoritative HTLC output before accepting a preimage.
  • Preserve timeout handling for valid auxiliary and key-path spends.

Validate notifier spend data against the second-level outpoint before
updating resolver reports. Derive the claim transaction ID from the
validated transaction instead of trusting notifier metadata.
Select the stored commitment output script for local and remote Taproot
HTLCs instead of deriving it from control proofs. Add shared realistic
tree fixtures covering auxiliary and duplicate leaves.
Hash trusted timeout scripts independently of candidate spends. Treat a
verified timeout proof sibling as optional so duplicate leaves cannot
turn valid success spends into persistent classification errors.
Authenticate revealed tapscripts against the authoritative HTLC
commitment output before accepting a preimage. Handle auxiliary,
duplicate-leaf, key-path, annex, and malformed spend cases without
changing legacy witness classification.
Register local Taproot commitment spends with the independently
stored HTLC output script. Avoid reconstructing notifier targets from
stored timeout proofs that can select duplicate leaves.
Route every timeout spend decision through authenticated Taproot
classification. Propagate malformed spends before cleanup and preserve
the existing timeout path for valid non-success and legacy spends.
Authenticate cached and live contest spends before claiming a
preimage. Hand valid auxiliary and key-path spends to the embedded
timeout resolver without marking or checkpointing contest success.
Link the spend-validation follow-up from the existing HTLC success
resolver entries in both active release-note series.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant