-
Notifications
You must be signed in to change notification settings - Fork 913
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
renepay: Support for BOLT12 #7985
Open
Lagrang3
wants to merge
19
commits into
ElementsProject:master
Choose a base branch
from
Lagrang3:renepay-bolt12
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+1,430
−525
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
Lagrang3
force-pushed
the
renepay-bolt12
branch
6 times, most recently
from
January 17, 2025 11:47
5668dfc
to
94be50d
Compare
Lagrang3
force-pushed
the
renepay-bolt12
branch
5 times, most recently
from
January 20, 2025 18:29
55ca735
to
4dff4a8
Compare
A first step towards supporting bolt12 invoices and blinded paths. Changelog-None Signed-off-by: Lagrang3 <[email protected]>
Enable routing through blinded paths using fake channels in local gossmods. Changelog-None Signed-off-by: Lagrang3 <[email protected]>
Add an rpc to renepay that is similar to sendpay that handles BOLT11 and BOLT12 payments. This is not the most elegant solution but it is a workaround until we implement it into lightningd which has more development friction. Changelog-None. Signed-off-by: Lagrang3 <[email protected]>
Changing route.amount to route.amount_deliver for clarity. This variable hold the value that the route delivers to destination. Changelog-None Signed-off-by: Lagrang3 <[email protected]>
Use renesendpay to send the payment allowing to pay to BOLT12 invoices from a higher level interface. Changelog-Add: renepay: Add support for BOLT12 payments Signed-off-by: Lagrang3 <[email protected]>
Lagrang3
force-pushed
the
renepay-bolt12
branch
3 times, most recently
from
January 27, 2025 09:19
081bfeb
to
895652e
Compare
Fix error handling since we moved from sendpay to sendonion rpc. With sendonion once a route fails we don't get the scid and node_id that failed along the route, so we have to deduce those from our own internal data. Changelog-None Signed-off-by: Lagrang3 <[email protected]>
sendonion RPC does not allow to set the total amount in lightningd's wallet, therefore it mixing sendpay and sendonion payment parts would not work. That means for the time being we cannot complete a payment initialized with sendpay until we add a total_amount parameter to sendonion. Changelog-None. Signed-off-by: Lagrang3 <[email protected]>
Changelog-None. Signed-off-by: Lagrang3 <[email protected]>
Refactor create_onion function, now we could use the same function to build onions for sendonion and injectpaymentonion. Changelog-None. Signed-off-by: Lagrang3 <[email protected]>
Changelog-None. Signed-off-by: Lagrang3 <[email protected]>
Collect the shared secrets when making a payment request. We would need this if we use injectpaymentonion instead of sendonion. Changelog-None. Signed-off-by: Lagrang3 <[email protected]>
Changelog-None. Signed-off-by: Lagrang3 <[email protected]>
Changelog-None. Signed-off-by: Lagrang3 <[email protected]>
Changelog-None. Signed-off-by: Lagrang3 <[email protected]>
Changelog-None. Signed-off-by: Lagrang3 <[email protected]>
Use injectpaymentonion for payments with |routes|=0, ie. self-payments and blinded paths where our node is the first node in the blinded path. Changelog-None. Signed-off-by: Lagrang3 <[email protected]>
Always use a fake destination node, the self-payments are no longer a corner case for the routing problem in this way. Also it is ok for get_routes to return routes with zero length. Changelog-None. Signed-off-by: Lagrang3 <[email protected]>
When paying with injectpaymentonion we need to manually decode the error from the onion. Changelog-None. Signed-off-by: Lagrang3 <[email protected]>
Lagrang3
force-pushed
the
renepay-bolt12
branch
from
January 29, 2025 08:21
895652e
to
8147933
Compare
Changelog-None. Signed-off-by: Lagrang3 <[email protected]>
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.
Adding support for BOLT12 in renepay.
Closes #6609
We compute routes to blinded paths by using a fake node as destination and then linking the entry point of every blinded path to the destination with a fake channel that represents the use of that blinded path. The same way that xpay does.
To send the payment we had to change from sendpay to sendonion. We could have used injectpaymentonion but since the injectpaymentonion does not yet support passing
shared_secrets
nor thedestination
id we preferred sendonion, also sendonion is more in tune with renepay design of sending the onions and wait for responses in a notification as opposed to xpay that reacts as soon as injectpaymentonion returns with success or failure.