You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As highlighted by @tankyleo, the rules for setting the anchor amount
were incorrect, and wouldn't result in a 0-fee transaction if there
was millisatoshi rounding.
We fix the spec, fix the existing test vectors, and add a new related
test vector.
Copy file name to clipboardExpand all lines: 03-transactions.md
+8-16Lines changed: 8 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -180,17 +180,18 @@ After 16 blocks, anyone can sweep the anchor with witness:
180
180
181
181
This output can be spent by anyone to provide incentive to mine the transaction, using child-pays-for-parent.
182
182
This output is only added when the commitment transaction is using version 3 (`zero_fee_commitments`) and prevents pinning attacks on the commitment transaction.
183
+
183
184
It is using the following standard P2A (pay-to-anchor) script:
184
185
185
186
OP_1 <0x4e73>
186
187
187
188
The standard dust limit for this type of script is `240 sat`.
188
189
However, if the parent transaction doesn't pay any on-chain fees, using values below this dust limit is allowed under the "ephemeral dust" rule.
189
190
190
-
We set the amount of this `shared_anchor` based on the [trimmed outputs](#trimmed-outputs) of the commitment transaction.
191
-
When there are no trimmed outputs, it is set to `0 sat`.
192
-
When there are trimmed outputs, their amount is added to this `shared_anchor` until it reaches `240 sats`: the remaining amount (if any) is not added
193
-
to any output and thus directly contributes to the transaction's mining fees (which is standard since the `shared_anchor` has reached its dust limit).
191
+
If the difference between the commitment transaction input and the sum of all other commitment transaction outputs is smaller than `240 sat`, we set the anchor amount to this value.
192
+
This ensures that the commitment transaction doesn't pay any on-chain fees whenever the anchor amount is smaller than `240 sat`.
193
+
194
+
Otherwise, we set the anchor amount to `240 sat`, and the remaining difference between the commitment transaction input and its outputs directly contributes to the transaction's mining fees (which is standard since the `shared_anchor` has reached its dust limit).
194
195
195
196
Spending of the output requires the following (empty) witness:
196
197
@@ -329,37 +330,28 @@ The commitment transaction:
329
330
- if the amount of the commitment transaction `to_local` output would be
330
331
less than `dust_limit_satoshis` set by the transaction owner:
331
332
- MUST NOT contain that output.
332
-
- if `zero_fee_commitments` applies:
333
-
- MUST add this amount to the `shared_anchor` output as detailed in
0 commit comments