-
Notifications
You must be signed in to change notification settings - Fork 24
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
Liquidity Ads #561
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pm47
reviewed
Dec 1, 2023
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.
t-bast
force-pushed
the
liquidity-ads
branch
from
December 11, 2023 14:14
91d6c2c
to
bb36627
Compare
pm47
reviewed
Dec 11, 2023
pm47
reviewed
Dec 12, 2023
src/commonMain/kotlin/fr/acinq/lightning/serialization/v4/Serialization.kt
Show resolved
Hide resolved
pm47
reviewed
Dec 12, 2023
src/commonMain/kotlin/fr/acinq/lightning/serialization/v4/Deserialization.kt
Outdated
Show resolved
Hide resolved
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.
pm47
reviewed
Dec 12, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Some nits
src/commonMain/kotlin/fr/acinq/lightning/channel/states/Normal.kt
Outdated
Show resolved
Hide resolved
src/commonMain/kotlin/fr/acinq/lightning/serialization/v4/Serialization.kt
Outdated
Show resolved
Hide resolved
src/commonMain/kotlin/fr/acinq/lightning/serialization/v4/Deserialization.kt
Outdated
Show resolved
Hide resolved
pm47
reviewed
Dec 12, 2023
dpad85
approved these changes
Dec 13, 2023
There was a problem hiding this 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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).