t-bast / lightning-docs

Some in-depth articles about the Lightning Network
Apache License 2.0
177 stars 33 forks source link

question about ptlc second stage tx #22

Open antonilol opened 2 years ago

antonilol commented 2 years ago

from https://github.com/t-bast/lightning-docs/blob/master/taproot-updates.md:

claiming successful PTLCs from the remote peer's commitment now requires using RBF and sighash flags similar to anchor outputs HTLC transactions (sighash_single | sighash_anyonecanpay trick)

in the case where the funds from a ptlc success/timeout are not sent to the local delayed pubkey (claiming from the remote commitment), a sighash none | anyone can pay can be used on the adaptor, of course the local signature will use sighash all to prevent malleability with this, all n ptlcs can be swept in one transaction with n inputs and 1 output

is this right or am i missing something?

t-bast commented 2 years ago

Using sighash_none is generally quite dangerous, so it's likely not a good idea (I haven't looked into it in details though). Especially considering that sweeping multiple htlcs or ptlcs in a single transaction is generally not a good idea (it's more dangerous than sweeping them independently), I don't think this change would be useful. But take this with a grain of salt, I haven't looked into it much, as again this isn't the goal of this article, this discussion will make sense on the bolts repo when taproot gets specified.