-
Notifications
You must be signed in to change notification settings - Fork 421
Closed
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_commitmentsfeature 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_kwto zero - Receiver: MUST fail if
max_accepted_htlcs> 114 - Receiver: MUST fail if
feerate_per_kw!= 0
- Sender: MUST set
-
open_channel_v2ifchannel_typeincludeszero_fee_commitments:- Sender: MUST set
commitment_feerate_per_kwto 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_commitmentsif it was negotiated
- If no channel type was negotiated assume it to be
Note: channel type does not include static_remote_key.
Dependency TxBuilder
- Depend on new
TxBuildertrait in [Custom Transactions] AddTxBuildertrait, support fixed additional outputs ย #3775 to build new commitment transaction format.
Fee Handling
-
update_fee:- Sender: MUST NOT send
update_fee - Receiver: MUST ignore the message
- Receiver: SHOULD send a warning
- Sender: MUST NOT send
- Fee paying node for
zero_fee_commitmentchannels:- 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
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_localof tx owner < holder'sdust_limit_satoshisMUST add toshared_anchor - If
to_remoteof tx owner < holder'sdust_limit_satoshisMUST 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|ACPsighash 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_anchoron broadcast to incentivize mining
Enable
- Negotiation available (outside of tests)
- Update docs to have proper code references (can't be done behind test flag)
Spec
- Test vectors
- Eclair interop
- Use real feature bit once specification is finalized
TheBlueMatt and benthecarman
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done