ElementsProject / ElementsProject/lightning

Custom blinded paths for invoices

Open
#8,041 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
3.1k
Forks
1k
Avg merge
4d 10h
Merged PRs (30d)
13

Description

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
```python
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.