Skip to content

xpay BIP353 support - #8467

Merged
rustyrussell merged 3 commits into
ElementsProject:masterfrom
rustyrussell:guilt/xpay-just-do-it
Aug 18, 2025
Merged

rustyrussell merged 3 commits into
ElementsProject:masterfrom
rustyrussell:guilt/xpay-just-do-it

Conversation

@rustyrussell

@rustyrussell rustyrussell commented Aug 17, 2025 •

Copy link
Copy Markdown
Collaborator
$ lightning-cli xpay ₿rusty@rustcorp.com.au 1000sat

FTW.

And:
Closes #7632

@rustyrussell rustyrussell added this to the v25.09 milestone Aug 17, 2025
@rustyrussell
rustyrussell requested a review from cdecker as a code owner August 17, 2025 23:40
@rustyrussell
rustyrussell requested a review from sangbida August 17, 2025 23:51
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell
rustyrussell force-pushed the guilt/xpay-just-do-it branch from 139a344 to 6d50311 Compare August 18, 2025 01:10
fetchinvoice is still good for detailed diagnostics and handling
recurring invoices and alternate currencies, but this covers the
"throw some sats" case well.

Changelog-Added: JSON-RPC: `xpay` can now pay a simple offer directly, rather than requiring fetchinvoice first.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `xpay` can now directly pay a BIP353 address, like `₿rusty@rustcorp.com.au`.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell
rustyrussell force-pushed the guilt/xpay-just-do-it branch from 6d50311 to 1145cbb Compare August 18, 2025 01:31
@rustyrussell
rustyrussell merged commit 6799dbe into ElementsProject:master Aug 18, 2025
Comment thread doc/schemas/xpay.json Resolved
"type": "string",
"description": [
"bolt11 or bolt12 invoice, or a bolt12 (non-recursive) offer. If it's an offer, the invoice is fetch using `fetchinvoice` automatically."
"bolt11 or bolt12 invoice, a bolt12 (non-recursive) offer or a BIP353 name. If it's a bip353 name, an offer is fetched with `fetchbip353` if available. If it's an offer, the invoice is fetched using `fetchinvoice` automatically."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: extra spaces

Comment thread plugins/xpay/xpay.c

instructions = json_get_member(buf, result, "instructions");
json_for_each_arr(i, t, instructions) {
offertok = json_get_member(buf, t, "offer");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

why are we iterating through the offers but only picking the very first one?

@Sjors

Sjors commented Aug 19, 2025

Copy link
Copy Markdown
Contributor

Nice!

@hMsats

hMsats commented Aug 27, 2025

Copy link
Copy Markdown
Contributor

It's not working for me yet. Am I missing something? Obviously fetchbip353

v25.09rc3

lightning-cli xpay ₿rusty@rustcorp.com.au 1000sat
{
   "code": -32601,
   "message": "Unknown command 'fetchbip353'"
}

@daywalker90

Copy link
Copy Markdown
Collaborator

It's not working for me yet. Am I missing something? Obviously fetchbip353

v25.09rc3

lightning-cli xpay ₿rusty@rustcorp.com.au 1000sat
{
   "code": -32601,
   "message": "Unknown command 'fetchbip353'"
}

you need to build with rust since fetchbip353 comes from a rust plugin

@hMsats

hMsats commented Aug 27, 2025 •

Copy link
Copy Markdown
Contributor

@daywalker90 ah, thanks. Then I prefer to wait for a proper implementation in C or is this the new normal that we also have to build with rust?

@daywalker90

Copy link
Copy Markdown
Collaborator

@daywalker90 ah, thanks. Then I prefer to wait for a proper implementation in C or is this the new normal that we also have to build with rust?

You don't have to but you will miss some functionality like this, a rest interface, a grpc interface, the wss-proxy, lsps. I'm not aware of any C implementation being planned for fetchbip353.

@hMsats

hMsats commented Aug 27, 2025

Copy link
Copy Markdown
Contributor

@daywalker90 thanks, I've got it working now but I can't say I'm very happy with this rust complication for xpay and won't use it (for now).

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.

Have pay just pay a bolt12 offer

5 participants