Skip to content
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

Extensible Liquidity Ads #1153

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Oct 10, 2024

  1. Extensible liquidity ads rates

    Add the ability to advertise rates at which nodes wish to sell their
    liquidity. Buyers can then connect to sellers and request liquidity,
    at one of the advertised rates.
    
    This can be used when creating a dual-funded channel, where both
    participants contribute to the funding transaction, and one of them
    is paid for (some of) their contribution. This can also be used to
    splice additional liquidity into existing channels, when splicing is
    supported.
    
    We introduce an extensible `payment_type` field to control how the
    funding fees are paid. The only `payment_type` currently defined pays
    funding fees from the buyer's channel balance during the interactive-tx
    session, but it is easy to introduce different `payment_type`s (to pay
    the fees using HTLCs for example).
    
    We don't add any constraints to the commitment transactions. Sellers
    should keep the channel open for at least a month, but there is no way
    to guarantee that. The seller could immediately close the channel, or
    splice funds out. It is up to the buyer to then blacklist that seller.
    
    Credits to @niftynei for the original design.
    t-bast committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    767b46f View commit details
    Browse the repository at this point in the history
  2. Add channel_creation_fee_sat to funding rate

    Creating a new channel has an additional cost compared to adding
    liquidity to an existing channel: the channel will be closed in the
    future, which will require paying on-chain fees. Node operators can
    include some `channel_creation_fee_sat` to their liquidity ads to
    cover some of that future cost.
    t-bast committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    69aca14 View commit details
    Browse the repository at this point in the history
  3. Add liquidity ads TLVs to RBF messages

    Every RBF attempts provided the opportunity to modify the liquidity
    purchase: we thus must explicitly state whether we're purchasing
    liquidity in `tx_init_rbf`.
    
    We also update the TLV tags to prevent a conflict with the released
    version of `cln` which already uses those TLVs with an experimental
    format. This will make the migration to the new TLVs easier for them
    without disrupting existing users.
    t-bast committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    910c070 View commit details
    Browse the repository at this point in the history