Skip to content

Commit 0374aec

Browse files
author
Antoine Riard
committed
Require to claim revoked local output in its own penalty tx post-anchor
If `option_anchor_outputs` applies, the cheating node can pin spends of its HTLC-timeout/HTLC-success outputs thanks to SIGHASH_SINGLE malleability. Using a single penalty transaction for all revoked outputs is thus unsafe as it could be blocked to propagate long enough for the `_local node's main output_ 's relative timelock to expire and the cheating party escaping the penalty on this output.
1 parent 7e8c478 commit 0374aec

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

05-onchain.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,15 @@ A local node:
513513
using the revocation private key.
514514
- SHOULD extract the payment preimage from the transaction input witness, if
515515
it's not already known.
516-
- MAY use a single transaction to *resolve* all the outputs.
516+
- if `option_anchor_outputs` applies:
517+
- MAY use a single transaction to *resolve* all the outputs.
518+
- if confirmation doesn't happen before reaching `security_delay` blocks from
519+
expiry:
520+
- MUST *resolve* revoked outputs in their own, separate penalty transactions. A previous
521+
penalty transaction claiming multiple revoked outputs at once may be blocked from confirming
522+
because of a transaction pinning attack.
523+
- otherwise:
524+
- MAY use a single transaction to *resolve* all the outputs.
517525
- MUST handle its transactions being invalidated by HTLC transactions.
518526

519527
## Rationale
@@ -522,10 +530,19 @@ A single transaction that resolves all the outputs will be under the
522530
standard size limit because of the 483 HTLC-per-party limit (see
523531
[BOLT #2](02-peer-protocol.md#the-open_channel-message)).
524532

525-
Note: if a single transaction is used, it may be invalidated if the remote node
526-
refuses to broadcast the HTLC-timeout and HTLC-success transactions in a timely
527-
manner. Although, the requirement of persistence until all outputs are
528-
irrevocably resolved, should still protect against this happening. [ FIXME: May have to divide and conquer here, since the remote node may be able to delay the local node long enough to avoid a successful penalty spend? ]
533+
Note: if `option_anchor_outputs` applies, the cheating node can pin spends of its
534+
HTLC-timeout/HTLC-success outputs thanks to SIGHASH_SINGLE malleability.
535+
Using a single penalty transaction for all revoked outputs is thus unsafe as it
536+
could be blocked to propagate long enough for the _local node's `to_local` output_ 's
537+
relative locktime to expire and the cheating party escaping the penalty on this
538+
output. Though this situation doesn't prevent faithful punishment of the second-level
539+
revoked output if the pinning transaction confirms.
540+
541+
The `security_delay` is a fixed-point relative to the absolute expiration of
542+
the revoked output at which the punishing node must broadcast a single-spend
543+
transaction for the revoked output and actively fee-bump it until its confirmation.
544+
The exact value of `security_delay` is left as a matter of node policy, though we
545+
recommend 18 blocks (similar to incoming HTLC deadline).
529546

530547
## Penalty Transactions Weight Calculation
531548

0 commit comments

Comments
 (0)