@@ -609,7 +609,6 @@ the `channel_ready` message, the channel is established and can begin
609609normal operation. The ` channel_ready ` message includes information
610610that will be used to construct channel authentication proofs.
611611
612-
613612 +-------+ +-------+
614613 | |--(1)--- open_channel ----->| |
615614 | |<-(2)-- accept_channel -----| |
@@ -745,6 +744,7 @@ affect the channel operation).
745744The currently defined basic types are:
746745 - ` option_static_remotekey ` (bit 12)
747746 - ` option_anchors ` and ` option_static_remotekey ` (bits 22 and 12)
747+ - ` zero_fee_commitments ` (bit 40)
748748
749749Each basic type has the following variations allowed:
750750 - ` option_scid_alias ` (bit 46)
@@ -774,14 +774,19 @@ The sending node:
774774 - MUST set it to a defined type representing the type it wants.
775775 - MUST use the smallest bitmap possible to represent the channel type.
776776 - SHOULD NOT set it to a type containing a feature which was not negotiated.
777+ - if ` channel_type ` includes ` zero_fee_commitments ` :
778+ - MUST set ` feerate_per_kw ` to ` 0 ` .
777779 - if ` announce_channel ` is ` true ` (not ` 0 ` ):
778780 - MUST NOT send ` channel_type ` with the ` option_scid_alias ` bit set.
779781
780782The sending node SHOULD:
781783 - set ` to_self_delay ` sufficient to ensure the sender can irreversibly spend a commitment transaction output, in case of misbehavior by the receiver.
782- - set ` feerate_per_kw ` to at least the rate it estimates would cause the transaction to be immediately included in a block.
783- - set ` dust_limit_satoshis ` to a sufficient value to allow commitment transactions to propagate through the Bitcoin network.
784784 - set ` htlc_minimum_msat ` to the minimum value HTLC it's willing to accept from this peer.
785+ - when using ` zero_fee_commitments ` or ` option_anchors ` :
786+ - set ` dust_limit_satoshis ` to a sufficient value to ensure that it is economical to spend, taking the cost of HTLC transactions into account.
787+ - otherwise (not using ` zero_fee_commitments ` or ` option_anchors ` ):
788+ - set ` feerate_per_kw ` to at least the rate it estimates would cause the transaction to be immediately included in a block.
789+ - set ` dust_limit_satoshis ` to a sufficient value to allow commitment transactions to propagate through the Bitcoin network.
785790
786791The receiving node MUST:
787792 - ignore undefined bits in ` channel_flags ` .
@@ -807,8 +812,12 @@ The receiving node MUST fail the channel if:
807812 - the ` chain_hash ` value is set to a hash of a chain that is unknown to the receiver.
808813 - ` push_msat ` is greater than ` funding_satoshis ` * 1000.
809814 - ` to_self_delay ` is unreasonably large.
810- - ` max_accepted_htlcs ` is greater than 483.
811- - it considers ` feerate_per_kw ` too small for timely processing or unreasonably large.
815+ - ` channel_type ` includes ` zero_fee_commitments ` and:
816+ - ` max_accepted_htlcs ` is greater than 114.
817+ - ` feerate_per_kw ` is not ` 0 ` .
818+ - ` channel_type ` does not include ` zero_fee_commitments ` and:
819+ - ` max_accepted_htlcs ` is greater than 483.
820+ - it considers ` feerate_per_kw ` too small for timely processing or unreasonably large.
812821 - ` funding_pubkey ` , ` revocation_basepoint ` , ` htlc_basepoint ` , ` payment_basepoint ` , or ` delayed_payment_basepoint `
813822are not valid secp256k1 pubkeys in compressed format.
814823 - ` dust_limit_satoshis ` is greater than ` channel_reserve_satoshis ` .
@@ -1161,6 +1170,8 @@ If nodes have negotiated `option_dual_fund`:
11611170The sending node:
11621171 - MUST set ` channel_type `
11631172 - MUST set ` funding_feerate_perkw ` to the feerate for this transaction
1173+ - if ` channel_type ` includes ` zero_fee_commitments ` :
1174+ - MUST set ` commitment_feerate_perkw ` to ` 0 ` .
11641175 - If it requires the receiving node to only use confirmed inputs:
11651176 - MUST set ` require_confirmed_inputs `
11661177
@@ -1169,6 +1180,7 @@ The receiving node:
11691180 - the ` locktime ` is unacceptable
11701181 - the ` funding_feerate_perkw ` is unacceptable
11711182 - MUST fail the negotiation if:
1183+ - ` channel_type ` includes ` zero_fee_commitments ` and ` commitment_feerate_perkw ` is not ` 0 ` .
11721184 - ` require_confirmed_inputs ` is set but it cannot provide confirmed inputs
11731185 - ` channel_type ` is not set
11741186
@@ -2208,9 +2220,9 @@ A node:
22082220The ` max_dust_htlc_exposure_msat ` is an upper bound on the trimmed balance from
22092221dust exposure. The exact value used is a matter of node policy.
22102222
2211- For channels that don't use ` option_anchors ` , an increase of
2212- the ` feerate_per_kw ` may trim multiple htlcs from commitment transactions,
2213- which could create a large increase in dust exposure.
2223+ For channels that don't use ` zero_fee_commitments ` or ` option_anchors ` , an
2224+ increase of the ` feerate_per_kw ` may trim multiple htlcs from commitment
2225+ transactions, which could create a large increase in dust exposure.
22142226
22152227### Adding an HTLC: ` update_add_htlc `
22162228
@@ -2241,26 +2253,27 @@ is destined, is described in [BOLT #4](04-onion-routing.md).
22412253#### Requirements
22422254
22432255A sending node:
2244- - if it is _ responsible_ for paying the Bitcoin fee:
2245- - MUST NOT offer ` amount_msat ` if, after adding that HTLC to its commitment
2246- transaction, it cannot pay the fee for either the local or remote commitment
2247- transaction at the current ` feerate_per_kw ` while maintaining its channel
2248- reserve (see [ Updating Fees] ( #updating-fees-update_fee ) ).
2249- - if ` option_anchors ` applies to this commitment transaction and the sending
2250- node is the funder:
2251- - MUST be able to additionally pay for ` to_local_anchor ` and
2252- ` to_remote_anchor ` above its reserve.
2253- - SHOULD NOT offer ` amount_msat ` if, after adding that HTLC to its commitment
2254- transaction, its remaining balance doesn't allow it to pay the commitment
2255- transaction fee when receiving or sending a future additional non-dust HTLC
2256- while maintaining its channel reserve. It is recommended that this "fee spike
2257- buffer" can handle twice the current ` feerate_per_kw ` to ensure predictability
2258- between implementations.
2259- - if it is _ not responsible_ for paying the Bitcoin fee:
2260- - SHOULD NOT offer ` amount_msat ` if, once the remote node adds that HTLC to
2261- its commitment transaction, it cannot pay the fee for the updated local or
2262- remote transaction at the current ` feerate_per_kw ` while maintaining its
2263- channel reserve.
2256+ - if ` zero_fees_commitments ` has not been negotiated:
2257+ - if it is _ responsible_ for paying the Bitcoin fee:
2258+ - MUST NOT offer ` amount_msat ` if, after adding that HTLC to its commitment
2259+ transaction, it cannot pay the fee for either the local or remote commitment
2260+ transaction at the current ` feerate_per_kw ` while maintaining its channel
2261+ reserve (see [ Updating Fees] ( #updating-fees-update_fee ) ).
2262+ - if ` option_anchors ` applies to this commitment transaction and the sending
2263+ node is the funder:
2264+ - MUST be able to additionally pay for ` to_local_anchor ` and
2265+ ` to_remote_anchor ` above its reserve.
2266+ - SHOULD NOT offer ` amount_msat ` if, after adding that HTLC to its commitment
2267+ transaction, its remaining balance doesn't allow it to pay the commitment
2268+ transaction fee when receiving or sending a future additional non-dust HTLC
2269+ while maintaining its channel reserve. It is recommended that this "fee spike
2270+ buffer" can handle twice the current ` feerate_per_kw ` to ensure predictability
2271+ between implementations.
2272+ - if it is _ not responsible_ for paying the Bitcoin fee:
2273+ - SHOULD NOT offer ` amount_msat ` if, once the remote node adds that HTLC to
2274+ its commitment transaction, it cannot pay the fee for the updated local or
2275+ remote transaction at the current ` feerate_per_kw ` while maintaining its
2276+ channel reserve.
22642277 - MUST offer ` amount_msat ` greater than 0.
22652278 - MUST NOT offer ` amount_msat ` below the receiving node's ` htlc_minimum_msat `
22662279 - MUST set ` cltv_expiry ` less than 500000000.
@@ -2329,12 +2342,16 @@ sides send the maximum number of HTLCs, the `commitment_signed` message will
23292342still be under the maximum message size. It also ensures that
23302343a single penalty transaction can spend the entire commitment transaction,
23312344as calculated in [ BOLT #5 ] ( 05-onchain.md#penalty-transaction-weight-calculation ) .
2345+ When using ` zero_fee_commitments ` , we further limit ` max_accepted_htlcs ` to
2346+ 114 because v3 transactions are limited to 10kvB, which decreases the number
2347+ of outputs the commitment transaction can have.
23322348
23332349` cltv_expiry ` values equal to or greater than 500000000 would indicate a time in
23342350seconds, and the protocol only supports an expiry in blocks.
23352351
2336- The node _ responsible_ for paying the Bitcoin fee should maintain a "fee
2337- spike buffer" on top of its reserve to accommodate a future fee increase.
2352+ When ` zero_fee_commitments ` is not used, the node _ responsible_ for paying
2353+ the Bitcoin fee should maintain a "fee spike buffer" on top of its reserve
2354+ to accommodate a future fee increase.
23382355Without this buffer, the node _ responsible_ for paying the Bitcoin fee may
23392356reach a state where it is unable to send or receive any non-dust HTLC while
23402357maintaining its channel reserve (because of the increased weight of the
@@ -2504,9 +2521,6 @@ the case of offered HTLCs being timed out or received HTLCs being spent. This
25042521is done to reduce fees by creating smaller scripts compared to explicitly
25052522stating time-locks on HTLC outputs.
25062523
2507- The ` option_anchors ` allows HTLC transactions to "bring their own fees" by
2508- attaching other inputs and outputs, hence the modified signature flags.
2509-
25102524### Completing the Transition to the Updated State: ` revoke_and_ack `
25112525
25122526Once the recipient of ` commitment_signed ` checks the signature and knows
@@ -2551,8 +2565,9 @@ A node:
25512565
25522566### Updating Fees: ` update_fee `
25532567
2554- An ` update_fee ` message is sent by the node which is paying the
2555- Bitcoin fee. Like any update, it's first committed to the receiver's
2568+ For channels that don't use ` zero_fee_commitments ` , an ` update_fee `
2569+ message is sent by the node which is paying the Bitcoin fee.
2570+ Like any update, it's first committed to the receiver's
25562571commitment transaction and then (once acknowledged) committed to the
25572572sender's. Unlike an HTLC, ` update_fee ` is never closed but simply
25582573replaced.
@@ -2573,6 +2588,9 @@ given in [BOLT #3](03-transactions.md#fee-calculation).
25732588
25742589#### Requirements
25752590
2591+ When using ` zero_fee_commitments ` , nodes:
2592+ - MUST NOT send ` update_fee ` .
2593+
25762594The node _ responsible_ for paying the Bitcoin fee:
25772595 - SHOULD send ` update_fee ` to ensure the current fee rate is sufficient (by a
25782596 significant margin) for timely processing of the commitment transaction.
@@ -2591,6 +2609,9 @@ A sending node:
25912609 - MAY fail the channel
25922610
25932611A receiving node:
2612+ - if ` zero_fee_commitments ` is used:
2613+ - MUST ignore the message.
2614+ - SHOULD send a ` warning ` and disconnect.
25942615 - if the ` update_fee ` is too low for timely processing, OR is unreasonably large:
25952616 - MUST send a ` warning ` and close the connection, or send an
25962617 ` error ` and fail the channel.
@@ -2615,7 +2636,9 @@ Bitcoin fees are required for unilateral closes to be effective.
26152636With ` option_anchors ` , ` feerate_per_kw ` is not as critical anymore to guarantee
26162637confirmation as it was in the legacy commitment format, but it still needs to
26172638be enough to be able to enter the mempool (satisfy min relay fee and mempool
2618- min fee).
2639+ min fee). With ` zero_fee_commitments ` , transactions can enter the mempool
2640+ as a package with a child transaction paying the fees: channel transactions
2641+ thus don't need to directly include a fee, so this message isn't used.
26192642
26202643For the legacy commitment format, there is no general method for the
26212644broadcasting node to use child-pays-for-parent to increase its effective fee.
0 commit comments