Skip to content

Custom blinded paths for invoices #8041

Open
@Lagrang3

Description

@Lagrang3

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions