Open
Description
High level tracking issue for implementing zero fee commitments lightning/bolts#1228.
In the interest of keeping things reviewable + maintaining velocity, I propose breaking the feature up into the parts outlined below. Checklist is a summary of the requirements outlined in the spec PR.
Add Feature Bit
Already completed in #3656.
- Support a
zero_fee_commitments
feature bit (40/41): - Allow channel type using even feature (40)
Channel Establishment
Implemented in #3792
- Negotiation available in tests
-
open_channel
:- Sender: MUST set
feerate_per_kw
to zero - Receiver: MUST fail if
max_accepted_htlcs
> 114 - Receiver: MUST fail if
feerate_per_kw
!= 0
- Sender: MUST set
-
open_channel_v2
ifchannel_type
includeszero_fee_commitments
:- Sender: MUST set
commitment_feerate_per_kw
to 0 - Receiver: MUST fail if
commitment_feerate_per_kw
=! 0
- Sender: MUST set
-
funding_signed
:- If no channel type was negotiated assume it to be
zero_fee_commitments
if it was negotiated
- If no channel type was negotiated assume it to be
Note: channel type does not include static_remote_key.
Fee Handling
-
update_fee
:- Sender: MUST NOT send
update_fee
- Sender: MUST NOT send
- Fee paying node for
zero_fee_commitment
channels:- Does not need to maintain a fee spike buffer
- Does not need to account for fees for offered htlcs
- Does not need to be able to pay for anchors
- Non-fee paying node for
zero_fee_commitments
:- Does not need to maintain a fee spike buffer
Dependency TxBuilder
Depend on new TxBuilder
trait in #3775 to build new commitment transaction format.
Commitment Transaction
- Commitment transaction:
- Set version to 3
- Add a zero value P2A output
- Fee must be zero if P2A is dust; may be non-zero if non-dust
- Can add trimmed outputs up to 240 sats to shared anchor, then goes to fees
- If
to_local
of tx owner < holder'sdust_limit_satoshis
MUST add toshared_anchor
- If
to_remote
of tx owner < holder'sdust_limit_satoshis
MUST add toshared_anchor
- Trimmed offered and received HTLCs go to
shared_anchor
- Add shared anchor last, then BIP 69 sort
- Timeout/Success txns:
- Use
SINGLE|ACP
sighash on signatures from peer - Set
sequence
= 0 fortxin[0]
- Fee must be zero
- Use
- Commitment must be paid for using CPFP (and must submitpackage)
- MUST spend
shared_anchor
on broadcast to incentivize mining
Enable
- Negotiation available (outside of tests)
Metadata
Metadata
Assignees
Labels
No labels