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

Custom blinded paths for invoices #8041

Open
Lagrang3 opened this issue Jan 29, 2025 · 0 comments
Open

Custom blinded paths for invoices #8041

Lagrang3 opened this issue Jan 29, 2025 · 0 comments

Comments

@Lagrang3
Copy link
Collaborator

Lagrang3 commented Jan 29, 2025

I noticed that I can create offers with custom blinded paths with the option dev_paths.
But I also noticed that the invoice derived from that offer does not contain the same blinded paths as the offer.
Instead I get the default (and useless) blinded path with a single hop, the destination in plain sight.

Run this tests to check

def test_offers_paths(node_factory):
    l1, l2, l3, l4 = node_factory.line_graph(4, wait_for_announce=True)
    path = [l2.info['id'],l3.info['id'],l4.info['id']]
    
    # l1 pays, outside blinded path
    offer = l4.rpc.offer(amount="21sat",description="test_offers_paths1",
        dev_paths=[path])['bolt12']
    offer_path = l1.rpc.decode(offer)['offer_paths'][0]
    assert len(offer_path['path'])==3
    assert offer_path['first_node_id']==l2.info['id']
    invoice = l1.rpc.fetchinvoice(offer)['invoice']
    invoice_path = l1.rpc.decode(invoice)['invoice_paths'][0]
    assert len(invoice_path['path'])==3
    assert invoice_path['first_node_id']==l2.info['id']

It fails at assert len(invoice_path['path'])==3 and assert invoice_path['first_node_id']==l2.info['id'].

It is ok that the invoice_paths could be different from the offer_paths, but if I specified that I wanted
to use those paths in the offer, since I have no control of the invoice generation, I would expect
those paths to be used in the invoice as well.

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

No branches or pull requests

1 participant