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
This commit extends the specification with a new commitment format that
adds two anchor outputs to the commitment transaction. Anchor outputs
are a safety feature that allows a channel party to unilaterally increase
the fee of the commitment transaction using CPFP and ensure timely
confirmation on the chain. There is no cooperation required from the
remote party.
Copy file name to clipboardExpand all lines: 02-peer-protocol.md
+23-11Lines changed: 23 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -378,10 +378,10 @@ This message introduces the `channel_id` to identify the channel. It's derived f
378
378
#### Requirements
379
379
380
380
Both peers:
381
-
- if `option_static_remotekey` was negotiated:
382
-
-`option_static_remotekey` applies to all commitment transactions
381
+
- if `option_static_remotekey`or `option_anchor_outputs`was negotiated:
382
+
-`option_static_remotekey`or `option_anchor_outputs`applies to all commitment transactions
383
383
- otherwise:
384
-
-`option_static_remotekey` does not apply to any commitment transactions
384
+
-`option_static_remotekey`or `option_anchor_outputs`does not apply to any commitment transactions
385
385
386
386
The sender MUST set:
387
387
-`channel_id` by exclusive-OR of the `funding_txid` and the `funding_output_index` from the `funding_created` message.
@@ -396,9 +396,10 @@ The recipient:
396
396
397
397
#### Rationale
398
398
399
-
We decide on `option_static_remotekey` at this point when we first have to generate the commitment
400
-
transaction. Even if a later reconnection does not negotiate this parameter, this channel will continue to use `option_static_remotekey`; we don't support "downgrading".
401
-
This simplifies channel state, particularly penalty transaction handling.
399
+
We decide on `option_static_remotekey` or `option_anchor_outputs` at this point when we first have to generate the commitment
400
+
transaction. The feature bits that were communicated in the `init` message exchange for the current connection determine
401
+
the channel commitment format for the total lifetime of the channel. Even if a later reconnection does not negotiate this parameter,
402
+
this channel will continue to use `option_static_remotekey` or `option_anchor_outputs`; we don't support "downgrading".
402
403
403
404
### The `funding_locked` Message
404
405
@@ -811,6 +812,10 @@ A sending node:
811
812
transaction, it cannot pay the fee for either the local or remote commitment
812
813
transaction at the current `feerate_per_kw` while maintaining its channel
813
814
reserve (see [Updating Fees](#updating-fees-update_fee)).
815
+
- if `option_anchor_outputs` applies to this commitment transaction and the sending
816
+
node is the funder:
817
+
- MUST be able to additionally pay for `to_local_anchor` and
818
+
`to_remote_anchor` above its reserve.
814
819
- SHOULD NOT offer `amount_msat` if, after adding that HTLC to its commitment
815
820
transaction, its remaining balance doesn't allow it to pay the commitment
816
821
transaction fee when receiving or sending a future additional non-dust HTLC
@@ -843,7 +848,7 @@ been received). It MUST continue incrementing instead.
843
848
A receiving node:
844
849
- receiving an `amount_msat` equal to 0, OR less than its own `htlc_minimum_msat`:
845
850
- SHOULD fail the channel.
846
-
- receiving an `amount_msat` that the sending node cannot afford at the current `feerate_per_kw` (while maintaining its channel reserve):
851
+
- receiving an `amount_msat` that the sending node cannot afford at the current `feerate_per_kw` (while maintaining its channel reserve and any `to_local_anchor` and `to_remote_anchor` costs):
847
852
- SHOULD fail the channel.
848
853
- if a sending node adds more than receiver `max_accepted_htlcs` HTLCs to
849
854
its local commitment transaction, OR adds more than receiver `max_htlc_value_in_flight_msat` worth of offered HTLCs to its local commitment transaction:
@@ -1034,6 +1039,8 @@ output HTLCs are fully resolved.
1034
1039
1035
1040
Note that the `htlc_signature` implicitly enforces the time-lock mechanism in the case of offered HTLCs being timed out or received HTLCs being spent. This is done to reduce fees by creating smaller scripts compared to explicitly stating time-locks on HTLC outputs.
1036
1041
1042
+
The `option_anchor_outputs` allows HTLC transactions to "bring their own fees" by attaching other inputs and outputs, hence the modified signature flags.
1043
+
1037
1044
### Completing the Transition to the Updated State: `revoke_and_ack`
1038
1045
1039
1046
Once the recipient of `commitment_signed` checks the signature and knows
@@ -1118,13 +1125,18 @@ A receiving node:
1118
1125
1119
1126
#### Rationale
1120
1127
1121
-
Bitcoin fees are required for unilateral closes to be effective —
1122
-
particularly since there is no general method for the broadcasting node to use
1123
-
child-pays-for-parent to increase its effective fee.
1128
+
Bitcoin fees are required for unilateral closes to be effective.
1129
+
With `option_anchor_outputs`, `feerate_per_kw` is not as critical anymore to
1130
+
guarantee confirmation as it was in the legacy commitment format, but it still
1131
+
needs to be enough to be able to enter the mempool (satisfy min relay fee and
1132
+
mempool min fee).
1133
+
1134
+
For the legacy commitment format, there is no general method for the
1135
+
broadcasting node to use child-pays-for-parent to increase its effective fee.
1124
1136
1125
1137
Given the variance in fees, and the fact that the transaction may be
1126
1138
spent in the future, it's a good idea for the fee payer to keep a good
1127
-
margin (say 5x the expected fee requirement); but, due to differing methods of
1139
+
margin (say 5x the expected fee requirement) for legacy commitment txes; but, due to differing methods of
1128
1140
fee estimation, an exact value is not specified.
1129
1141
1130
1142
Since the fees are currently one-sided (the party which requested the
0 commit comments