1
0
Fork 0
mirror of https://github.com/lightning/bolts.git synced 2025-02-20 13:34:43 +01:00

Clarify the sighash types for HTLC Success and Timeout transactions (#954)

This commit is contained in:
Ken Sedgwick 2022-01-31 12:05:20 -08:00 committed by GitHub
parent 29db92f334
commit d975de1ba5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -328,7 +328,7 @@ These HTLC transactions are almost identical, except the HTLC-timeout transactio
* txout count: 1
* `txout[0]` amount: the HTLC amount minus fees (see [Fee Calculation](#fee-calculation))
* `txout[0]` script: version-0 P2WSH with witness script as shown below
* if `option_anchors` applies to this commitment transaction, `SIGHASH_SINGLE|SIGHASH_ANYONECANPAY` is used.
* if `option_anchors` applies to this commitment transaction, `SIGHASH_SINGLE|SIGHASH_ANYONECANPAY` is used as described in [BOLT #5](05-onchain.md#generation-of-htlc-transactions).
The witness script for the output is:

View file

@ -594,8 +594,8 @@ If `option_anchors` does not apply to the commitment transaction, then
HTLC-timeout and HTLC-success transactions are complete transactions with
(hopefully!) reasonable fees and must be used directly.
Otherwise, the use of `SIGHASH_SINGLE|SIGHASH_ANYONECANPAY` on the HTLC
signatures received from the peer allows HTLC transactions to be combined with
Otherwise, `SIGHASH_SINGLE|SIGHASH_ANYONECANPAY` MUST be used on the
HTLC signatures received from the peer, as this allows HTLC transactions to be combined with
other transactions. The local signature MUST use `SIGHASH_ALL`, otherwise
anyone can attach additional inputs and outputs to the tx.