-
Notifications
You must be signed in to change notification settings - Fork 521
Add details for post-anchor dust_limit_satoshis
#1301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -281,11 +281,15 @@ To redeem the HTLC, the HTLC-success transaction is used as detailed below. This | |
| ### Trimmed Outputs | ||
|
|
||
| Each peer specifies a `dust_limit_satoshis` below which outputs should | ||
| not be produced; these outputs that are not produced are termed "trimmed". A trimmed output is | ||
| considered too small to be worth creating and is instead added | ||
| to the commitment transaction fee. For HTLCs, it needs to be taken into | ||
| account that the second-stage HTLC transaction may also be below the | ||
| limit. | ||
| not be produced; these outputs that are not produced are termed "trimmed". | ||
| A trimmed output is considered too small to be worth creating: it is instead | ||
| either added to the commitment transaction fee. | ||
|
|
||
| For HTLCs, it needs to be taken into account that the second-stage HTLC | ||
| transaction may also be below the limit. Note that when using `option_anchors`, | ||
| HTLC transactions don't include a fee and thus don't contribute to trimming: | ||
| setting a higher `dust_limit_satoshis` makes sense for those channels to ensure | ||
| that outputs are economical to spend. | ||
|
|
||
| #### Requirements | ||
|
|
||
|
|
@@ -551,6 +555,7 @@ Bitcoin Core defines the following dust thresholds: | |
| - 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 | ||
| - unknown segwit versions: 354 satoshis | ||
| - `OP_RETURN` outputs: these are never dust | ||
|
|
||
|
|
@@ -560,6 +565,15 @@ is explained in the following sections. | |
| In all these sections, the calculations are done with a feerate of 3000 sat/kB | ||
| as per Bitcoin Core's implementation. | ||
|
|
||
| Note that since the introduction of `option_anchors`, the second-stage HTLC | ||
| transaction's weight is not taken into account when deciding whether outputs | ||
| should be included in the commitment transaction or not. It thus makes sense | ||
| to use a `dust_limit_satoshis` that takes into account the cost of those | ||
| 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. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in 68c6544 |
||
|
|
||
| ### Pay to pubkey hash (p2pkh) | ||
|
|
||
| A p2pkh output is 34 bytes: | ||
|
|
||
There was a problem hiding this comment.
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
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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
p2shin lightning, but we do list it here for reference.