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

blip-0041: channel funding fee credit #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

t-bast
Copy link
Contributor

@t-bast t-bast commented Jul 10, 2024

Onboarding users to the lightning network is hard, because opening a channel requires paying on-chain fees and allocating capital, hoping that it will be used to earn routing fees. It is not economical nor sustainable to open channels for users that receive a tiny amount and may not use the network frequently enough.

Wallet providers usually work around this issue by requiring users to receive a large enough first payment to pay on-chain fees for their channel.

However, a collection of unrelated tiny payments received over a period of time may be enough to justify creating a channel. We thus introduce a funding fee credit, that lets users prepay for future channel(s) by proactively revealing htlc preimages for small payments. When that fee credit reaches a sufficient amount, it is used by the remote node to cover the on-chain costs of opening a channel or splicing additional liquidity.

Onboarding users to the lightning network is hard, because opening a
channel requires paying on-chain fees and allocating capital, hoping
that it will be used to earn routing fees. It is not economical nor
sustainable to open channels for users that receive a tiny amount and
may not use the network frequently enough.

Wallet providers usually work around this issue by requiring users to
receive a large enough first payment to pay on-chain fees for their
channel.

However, a collection of unrelated tiny payments received over a period
of time may be enough to justify creating a channel. We thus introduce
a funding fee credit, that lets users prepay for future channel(s) by
proactively revealing htlc preimages for small payments. When that fee
credit reaches a sufficient amount, it is used by the remote node to
cover the on-chain costs of opening a channel or splicing additional
liquidity.
@t-bast t-bast force-pushed the funding-fee-credit branch from 6b72ee5 to 043b698 Compare July 11, 2024 08:50
types. We collect fees from the fee credit first, which ensures that it
converges to 0.

The node sending `add_fee_credit` is trusting its peer to correctly keep track
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can those that accept the free credit use it to make future payments with the credit without an on chain channel? I guess with that it starts to resemble the old "hosted channels" concept.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess with that it starts to resemble the old "hosted channels" concept.

That's why we don't want to go down that road...if you need this, just use a custodial wallet. Here we only introduce purchasing on-chain fees in advance, this is purposefully much more restricted to limit the additional trust required.

@TheBlueMatt
Copy link
Contributor

There's a lot here, but it seems like we could instead just have a 0conf channel with a fake/unbroadcasted funding transaction, then when the "channel" gets enough funds to pay for the open, the fundee simply sends the funder an HTLC back with the required amount and the funder dual-funding-"RBF"'s the original funding to actually fund the channel. That would avoid ~all the new messages, no?

@t-bast
Copy link
Contributor Author

t-bast commented Jul 19, 2024

There's a lot here, but it seems like we could instead just have a 0conf channel with a fake/unbroadcasted funding transaction,

It's not just for channel open, this will happen for splices as well. But I did try what you're proposing first after our discussion from the Tuscany Lightning Summit, and once you get down to the nitty-gritty details, it's actually very complex (much more complex IMO than what I'm proposing here).

I'd be happy to be proven wrong, but someone needs to fully implement and specify this alternative protocol to prove that it's simpler and better, and I failed when trying that 😅

pm47 added a commit to ACINQ/phoenixd that referenced this pull request Oct 3, 2024
Adds support for liquidity-ads based protocol for on-the-fly liquidity as specified in lightning/blips#36 and lightning/blips#41, implemented respectively in ACINQ/lightning-kmp#649  and ACINQ/lightning-kmp#660.

### Lightning-kmp update

Phoenixd now uses the main branch of `lightning-kmp` (v1.8.0).

### Database update

- `LiquidityAds.Lease` is replaced by `LiquidityAds.Purchase`, so we need to update the liquidity table.
- the `receivedWith` data have been updated in lightning-kmp, and we need a new `Part.Htlc.V1` object that may contain a `LiquidityAds.FundingFee`.

With the `Lease->Purchase` change, we've updated our pattern for versioning database objects. We now have `asDb()` & `asCanonical()` mapping methods and store the type of the db object inside the json (which means we don't need the `type` column anymore, except for convenience).

---------

Co-authored-by: pm47 <[email protected]>
vincenzopalazzo pushed a commit to vincenzopalazzo/phoenixd that referenced this pull request Nov 7, 2024
Adds support for liquidity-ads based protocol for on-the-fly liquidity as specified in lightning/blips#36 and lightning/blips#41, implemented respectively in ACINQ/lightning-kmp#649  and ACINQ/lightning-kmp#660.

### Lightning-kmp update

Phoenixd now uses the main branch of `lightning-kmp` (v1.8.0).

### Database update

- `LiquidityAds.Lease` is replaced by `LiquidityAds.Purchase`, so we need to update the liquidity table.
- the `receivedWith` data have been updated in lightning-kmp, and we need a new `Part.Htlc.V1` object that may contain a `LiquidityAds.FundingFee`.

With the `Lease->Purchase` change, we've updated our pattern for versioning database objects. We now have `asDb()` & `asCanonical()` mapping methods and store the type of the db object inside the json (which means we don't need the `type` column anymore, except for convenience).

---------

Co-authored-by: pm47 <[email protected]>
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

Successfully merging this pull request may close these issues.

3 participants