Skip to content

Conversation

@t-bast
Copy link
Collaborator

@t-bast t-bast commented Nov 19, 2025

Since the introduction of option_anchors, pre-signed HTLC transactions don't include any fees, and thus don't contribute to trimming. This results in HTLC outputs in the commitment transactions that may be forever uneconomical to spend, and will pollute the utxo set.

We should use a dust_limit_satoshis that is higher than Bitcoin Core's standard values to take into account the cost of these second-stage txs at a reasonable (TM) feerate. If we want for example to be able to claim HTLC outputs at 20 sat/byte, we need a dust_limit_satoshis of around 4 000 sats.

Since the introduction of `option_anchors`, pre-signed HTLC transactions
don't include any fees, and thus don't contribute to trimming. This
results in HTLC outputs in the commitment transactions that may be
forever uneconomical to spend, and will pollute the utxo set.

We should use a `dust_limit_satoshis` that is higher than Bitcoin Core's
standard values to take into account the cost of these second-stage txs
at a reasonable (TM) feerate.
Copy link
Contributor

@ziggie1984 ziggie1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, had some minor comments.

- pay to script hash (p2sh): 540 satoshis
- pay to witness pubkey hash (p2wpkh): 294 satoshis
- pay to witness script hash (p2wsh): 330 satoshis
- pay to anchor (p2a): 240 satoshis
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: should probably be part of: #1228

Copy link
Collaborator Author

@t-bast t-bast Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather have it here since we "mirror" the dust limits set by Bitcoin Core, even for output types we don't use. For example, we don't use p2sh in lightning, but we do list it here for reference.

second-stage HTLC transactions, to ensure that outputs added to the commitment
transaction can actually be claimed on-chain, otherwise they may pollute the
utxo set indefinitely. At a minimum, nodes should allow their peer to use a
`dust_limit_satoshis` that is higher than the values defined by Bitcoin Core.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you maybe also add a note describing that it can basically not be perfect, if the transaction fee of the base-layer stays for example very high for a long period of time HTLCs will be unspendable and on the other hand the dust limit cannot be too high because of the griefing attacks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 68c6544

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.

2 participants