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
Note that we refer to the "base fee" for a commitment transaction in the requirements below, which is what the funder pays. The actual fee may be higher than the amount calculated here, due to rounding and trimmed outputs.
246
246
247
247
#### Requirements
248
248
249
249
The fee for an HTLC-timeout transaction MUST BE calculated to match:
250
250
251
-
1. Multiply `feerate-per-kw` by 634 and divide by 1000 (rounding down).
251
+
1. Multiply `feerate-per-kw` by 635 and divide by 1000 (rounding down).
252
252
253
253
The fee for an HTLC-success transaction MUST BE calculated to match:
254
254
255
-
1. Multiply `feerate-per-kw` by 671 and divide by 1000 (rounding down).
255
+
1. Multiply `feerate-per-kw` by 673 and divide by 1000 (rounding down).
256
256
257
257
The base fee for a commitment transaction MUST BE calculated to match:
258
258
@@ -269,26 +269,26 @@ For example, suppose that we have a `feerate-per-kw` of 5000, a `dust-limit-sato
269
269
* 2 offered HTLCs of 5000000 and 1000000 millisatoshis (5000 and 1000 satoshis)
270
270
* 2 received HTLCs of 7000000 and 800000 millisatoshis (7000 and 800 satoshis)
271
271
272
-
The HTLC timeout transaction weight is 634, thus fee would be 3170 satoshis.
273
-
The HTLC success transaction weight is 671, thus fee would be 3355 satoshis
272
+
The HTLC timeout transaction weight is 635, thus fee would be 3175 satoshis.
273
+
The HTLC success transaction weight is 673, thus fee would be 3365 satoshis
274
274
275
275
The commitment transaction weight would be calculated as follows:
276
276
277
277
* weight starts at 724.
278
278
279
-
* The offered HTLC of 5000 satoshis is above 546 + 3170 and would result in:
279
+
* The offered HTLC of 5000 satoshis is above 546 + 3175 and would result in:
280
280
* an output of 5000 satoshi in the commitment transaction
281
-
* a HTLC timeout transaction of 5000 - 3170 satoshis which spends this output
281
+
* a HTLC timeout transaction of 5000 - 3175 satoshis which spends this output
282
282
* weight increases to 896
283
283
284
-
* The offered HTLC of 1000 satoshis is below 546 + 3710, so would be trimmed.
284
+
* The offered HTLC of 1000 satoshis is below 546 + 3175, so would be trimmed.
285
285
286
-
* The received HTLC of 7000 satoshis is above 546 + 3355 and would result in:
286
+
* The received HTLC of 7000 satoshis is above 546 + 3365 and would result in:
287
287
* an output of 7000 satoshi in the commitment transaction
288
-
* a HTLC success transaction of 7000 - 3355 satoshis which spends this output
288
+
* a HTLC success transaction of 7000 - 3365 satoshis which spends this output
289
289
* weight increases to 1068
290
290
291
-
* The received HTLC of 800 satoshis is below 546 + 3355 so would be trimmed.
291
+
* The received HTLC of 800 satoshis is below 546 + 3365 so would be trimmed.
292
292
293
293
The base commitment transaction fee would be 5340 satoshi; the actual
294
294
fee (adding the 1000 and 800 satoshi HTLCs which would have made dust
@@ -588,11 +588,12 @@ Multiplying non-witness data by 4, this gives a weight of:
588
588
589
589
The *expected weight* of an HTLC transaction is calculated as follows:
590
590
591
-
accepted_htlc_script: 109 bytes
591
+
accepted_htlc_script: 111 bytes
592
592
- OP_DATA: 1 byte (remotekey length)
593
593
- remotekey: 33 bytes
594
594
- OP_SWAP: 1 byte
595
595
- OP_SIZE: 1 byte
596
+
- OP_DATA: 1 byte (32 length)
596
597
- 32: 1 byte
597
598
- OP_EQUAL: 1 byte
598
599
- OP_IF: 1 byte
@@ -608,18 +609,19 @@ The *expected weight* of an HTLC transaction is calculated as follows:
608
609
- OP_CHECKMULTISIG: 1 byte
609
610
- OP_ELSE: 1 byte
610
611
- OP_DROP: 1 byte
611
-
- OP_PUSHDATA2: 1 byte (locktime length)
612
-
- locktime: 2 bytes
612
+
- OP_DATA: 1 byte (locktime length)
613
+
- locktime: 3 bytes
613
614
- OP_CHECKLOCKTIMEVERIFY: 1 byte
614
615
- OP_DROP: 1 byte
615
616
- OP_CHECKSIG: 1 byte
616
617
- OP_ENDIF: 1 byte
617
618
618
-
offered_htlc_script: 104 bytes
619
+
offered_htlc_script: 105 bytes
619
620
- OP_DATA: 1 byte (remotekey length)
620
621
- remotekey: 33 bytes
621
622
- OP_SWAP: 1 byte
622
623
- OP_SIZE: 1 byte
624
+
- OP_DATA: 1 byte (32 length)
623
625
- 32: 1 byte
624
626
- OP_EQUAL: 1 byte
625
627
- OP_NOTIF: 1 byte
@@ -638,7 +640,7 @@ The *expected weight* of an HTLC transaction is calculated as follows:
638
640
- OP_CHECKSIG: 1 byte
639
641
- OP_ENDIF: 1 byte
640
642
641
-
timeout_witness: 256 bytes
643
+
timeout_witness: 257 bytes
642
644
- number_of_witness_elements: 1 byte
643
645
- nil_length: 1 byte
644
646
- sig_alice_length: 1 byte
@@ -649,7 +651,7 @@ The *expected weight* of an HTLC transaction is calculated as follows:
649
651
- witness_script_length: 1 byte
650
652
- witness_script (offered_htlc_script)
651
653
652
-
success_witness: 293 bytes
654
+
success_witness: 295 bytes
653
655
- number_of_witness_elements: 1 byte
654
656
- nil_length: 1 byte
655
657
- sig_alice_length: 1 byte
@@ -687,11 +689,11 @@ The *expected weight* of an HTLC transaction is calculated as follows:
687
689
- lock_time: 4 bytes
688
690
689
691
Multiplying non-witness data by 4, this gives a weight of 376. Adding
690
-
the witness data for each case (256 + 2 for HTLC-timeout, 293 + 2 for
692
+
the witness data for each case (257 + 2 for HTLC-timeout, 295 + 2 for
0 commit comments