Skip to content

Zero Fee Commitments #3789

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 of 37 tasks
carlaKC opened this issue May 21, 2025 · 0 comments
Open
2 of 37 tasks

Zero Fee Commitments #3789

carlaKC opened this issue May 21, 2025 · 0 comments
Assignees

Comments

@carlaKC
Copy link
Contributor

carlaKC commented May 21, 2025

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

  • 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
  • open_channel_v2 if channel_type includes zero_fee_commitments:
    • Sender: MUST set commitment_feerate_per_kw to 0
    • Receiver: MUST fail if commitment_feerate_per_kw =! 0
  • funding_signed:
    • If no channel type was negotiated assume it to be zero_fee_commitments if it was negotiated
    • TODO: should zero fee commitment type include static remote key?

Fee Handling

  • update_fee:
    • Sender: MUST NOT send update_fee
  • 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's dust_limit_satoshis MUST add to shared_anchor
    • If to_remote of tx owner < holder's dust_limit_satoshis MUST add to shared_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 for txin[0]
    • Fee must be zero
  • 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)
@carlaKC carlaKC self-assigned this May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant