Skip to content

xpay BIP353 support#8467

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

xpay BIP353 support#8467
rustyrussell merged 3 commits intoElementsProject:masterfrom
rustyrussell:guilt/xpay-just-do-it

Conversation

@rustyrussell
Copy link
Contributor

@rustyrussell rustyrussell commented Aug 17, 2025

$ lightning-cli xpay ₿[email protected] 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
@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 <[email protected]>
Changelog-Added: JSON-RPC: `xpay` can now directly pay a BIP353 address, like `₿[email protected]`.
Signed-off-by: Rusty Russell <[email protected]>
@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
74 of 78 checks passed
"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
Collaborator

Choose a reason for hiding this comment

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

nit: extra spaces


instructions = json_get_member(buf, result, "instructions");
json_for_each_arr(i, t, instructions) {
offertok = json_get_member(buf, t, "offer");
Copy link
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
Copy link
Contributor

Sjors commented Aug 19, 2025

Nice!

@hMsats
Copy link
Contributor

hMsats commented Aug 27, 2025

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

v25.09rc3

lightning-cli xpay ₿[email protected] 1000sat
{
   "code": -32601,
   "message": "Unknown command 'fetchbip353'"
}

@daywalker90
Copy link
Collaborator

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

v25.09rc3

lightning-cli xpay ₿[email protected] 1000sat
{
   "code": -32601,
   "message": "Unknown command 'fetchbip353'"
}

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

@hMsats
Copy link
Contributor

hMsats commented Aug 27, 2025

@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
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
Copy link
Contributor

hMsats commented Aug 27, 2025

@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