Skip to content

Conversation

@dangeross
Copy link

This PR introduces introduction_node as an optional parameter when creating a BlindedPaymentPath. The reason for this change is to allow the introduction node to be configured as a DirectedShortChannelId.

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Apr 30, 2025

I've assigned @TheBlueMatt as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@jkczyz
Copy link
Contributor

jkczyz commented Apr 30, 2025

Could you expand upon why this is necessary? Invoices don't have a human-readable format, so QR size shouldn't be an issue.

@dangeross
Copy link
Author

Could you expand upon why this is necessary?

Sure. We should be able to reference a short channel id as the channel leading to the introduction node, as in the spec.

Invoices don't have a human-readable format, so QR size shouldn't be an issue.

I'm sure how this is related?

@jkczyz
Copy link
Contributor

jkczyz commented Apr 30, 2025

Could you expand upon why this is necessary?

Sure. We should be able to reference a short channel id as the channel leading to the introduction node, as in the spec.

Invoices don't have a human-readable format, so QR size shouldn't be an issue.

I'm sure how this is related?

The reason for allowing an SCID instead of a pubkey is to reduce the size of offer QR codes. Since BlindedPaymentPath is used in Bolt12Invoice but not in Offer, there is no need to create the compact representation.

If we are to allow it, we should use the same approach as BlindedMessagePath unless there is a good reason not to.

pub fn use_compact_introduction_node(&mut self, network_graph: &ReadOnlyNetworkGraph) {

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

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

Wait, are we sure the spec allows for it? I thought the spec similarly only allowed it in message paths precisely for the reasons @jkczyz lays out.

@ldk-reviews-bot
Copy link

👋 The first review has been submitted!

Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer.

@jkczyz
Copy link
Contributor

jkczyz commented Apr 30, 2025

Wait, are we sure the spec allows for it? I thought the spec similarly only allowed it in message paths precisely for the reasons @jkczyz lays out.

The spec really doesn't differentiate the two. We support sending a payment to one with a compact introduction node. We just don't create them.

@dangeross
Copy link
Author

Thanks for the feedback @jkczyz @TheBlueMatt

The motivation is similar to how Boltz adds a specific scid as a routing hop hint to a BOLT11 invoice to denote that there is a direct payment alternative (Magic Routing Hint). Similarly for the BOLT12 implementation we would also like to include this specific scid as the introduction node scid in the BOLT12 invoice.

Would an alternative option be to set the DirectedShortChannelId as part of the BlindedMessagePath in the offer and then this path then be copied to the invoice? Can you propose any other options?

@jkczyz
Copy link
Contributor

jkczyz commented Apr 30, 2025

The messages are extensible with TLVs, so a custom TLV setting along with a feature bit in the invoice would be the typical way of achieving this.

@dangeross
Copy link
Author

We've gone a different route. Thanks for your feedback

@dangeross dangeross closed this May 2, 2025
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.

4 participants