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

BOLT12: fetchinvoice refuses to talk to ourselves #7477

Closed
farscapian opened this issue Jul 18, 2024 · 3 comments
Closed

BOLT12: fetchinvoice refuses to talk to ourselves #7477

farscapian opened this issue Jul 18, 2024 · 3 comments
Assignees
Milestone

Comments

@farscapian
Copy link

farscapian commented Jul 18, 2024

I'm trying to implement what I call "Explicit Pay-to-Self" in the BOLT12-prism plugin to enable local composability of prisms. I want to follow the same BOLT12 semantics of fetchinvoice/pay for offers generated by the same node.

When I run fetchinvoice with an offer issued by the local node, I get the following output:

 ./lightning-cli.sh fetchinvoice lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrc2q36x2um5zcss9awqc39zslj8mzngsyuvfxkrzjk2z5a0wpvjh3ehzcfur8quevrc 100000
{
   "code": 205,
   "message": "Refusing to talk to ourselves"
}

CLN currently supports paying to a BOLT11 invoice issued by the local node, but I need BOLT12 semantics so I can simply track the static offer in the Prism definition.

@farscapian
Copy link
Author

cc @vincenzopalazzo

@vincenzopalazzo
Copy link
Collaborator

Yep, I have a branch for this and I think I will resurrect when I we are done with the bolt12 update, thanks to remember me :)

@vincenzopalazzo vincenzopalazzo self-assigned this Jul 19, 2024
@vincenzopalazzo vincenzopalazzo added this to the v24.08 milestone Jul 19, 2024
@rustyrussell
Copy link
Contributor

This is already fixed in the upcoming release! Here's the test:

def test_offer_selfpay(node_factory):
    """We can fetch an pay our own offer"""
    l1 = node_factory.get_node(options={'experimental-offers': None})

    offer = l1.rpc.offer(amount='2msat', description='test_offer_path_self')['bolt12']
    inv = l1.rpc.fetchinvoice(offer)['invoice']
    l1.rpc.pay(inv)

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

3 participants