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

Liquidity Ads #561

Merged
merged 15 commits into from
Dec 13, 2023
Merged

Liquidity Ads #561

merged 15 commits into from
Dec 13, 2023

Conversation

t-bast
Copy link
Member

@t-bast t-bast commented Nov 29, 2023

Implement a prototype for liquidity ads, compatible with ACINQ/eclair#2550
Note that we only implement the buyer side, which limits testing.
The specification is available here: lightning/bolts#878

We currently don't add CLTV locks to the commitment transactions, for simplicity's sake.
We thus don't store yet the lease in the commitments (to be defined where we should store it, and what data we need).

Use temporary tag 1337 until we have a final agreement on the spec.
The seller signs a commitment to the lease parameters.
It provides the buyer with a way to prove if the seller later cheats.
We allow purchasing inbound liquidity by initiating an empty splice,
similar to what we do for CPFP. If the remote doesn't fund, or its rates
are too expensive,  we immediately abort the splice attempt.
Those rates are sent in `node_announcement` and `init`. We select the
rate in the remote `init` message for a lease duration of `0` (no strict
lease enforcement through CLTV in the commitment transaction).

This matches the proposal in lightning/bolts#878 (comment)
We store liquidity purchases as on-chain outgoing payments, like what we
do for splice-outs and splice-cpfp.
We know beforehand that the interactive-tx session will fail if our current
balance is too low to pay the fees to the requested liquidity.
We use a dedicated discriminator to allow replacing this data entirely
in future versions without backwards-compatibility issues.
Copy link
Member

@pm47 pm47 left a comment

Choose a reason for hiding this comment

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

Nice! Some nits

@t-bast t-bast marked this pull request as ready for review December 13, 2023 15:15
Copy link
Member

@dpad85 dpad85 left a comment

Choose a reason for hiding this comment

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

LGTM 🥳 Successfully tested on Phoenix.

@pm47 pm47 merged commit 1912e97 into master Dec 13, 2023
2 checks passed
@pm47 pm47 deleted the liquidity-ads branch December 13, 2023 18:27
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.

None yet

3 participants