Skip to content

Expose BOLT12 asynchronous receive APIs - #325

Open
elnafateh wants to merge 1 commit into
lightningdevkit:mainfrom
elnafateh:feat/bolt12-async-receive
Open

elnafateh wants to merge 1 commit into
lightningdevkit:mainfrom
elnafateh:feat/bolt12-async-receive

Conversation

@elnafateh

Copy link
Copy Markdown
Contributor

Closes #324.

Exposes LDK Node’s experimental BOLT12 async receive APIs through gRPC, the client, CLI, and MCP. Requires async server configuration.

@ldk-reviews-bot

ldk-reviews-bot commented Nov 2, 2026 •

Copy link
Copy Markdown

I've assigned @benthecarman as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

Comment thread docs/api-guide.md
| `Bolt12ReceiveRefund` | Request an incoming payment for a BOLT12 refund |
| `Bolt12CreatePayerProof` | Create a BOLT 12 payer proof from a successful payment |

Async receive is experimental and requires the node's async-payments role to be set to `Server`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I believe this is the wrong role for two of the three RPCs. In ldk-node :

  • Bolt12ReceiveAsync and Bolt12SetPathsToStaticInvoiceServer are for the often-offline recipient, i.e. AsyncPaymentsRole::Client (ldk-node's doc says "paths we use as an async recipient", and AsyncPaymentsRole::Client is the role that asks peers to hold HTLCs "so that it can go offline").
  • Only Bolt12BlindedPathsForAsyncRecipient needs Server: blinded_paths_for_async_recipient_internal returns AsyncPaymentServicesDisabled unless the role is Server.

Someone following this sentence and configuring server would hit an error on Bolt12ReceiveAsync and Bolt12SetPathsToStaticInvoiceServer. Could we say per RPC which role is needed, e.g. a small table (Client: set paths, receive async; Server: blinded paths for async recipient)?

}

// Retrieve an offer for receiving payments while this node is offline.
// Async payments support is experimental and requires the node to be configured as an async server

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same role mix-up as in the docs: receive_async needs the client role (and paths to a static invoice server to be set, then the server has to finish building the static invoice), not the async server role. Please fix here and regenerate api.rs (the doc comment is mirrored there).

tool_spec(
"bolt12_receive_async",
BOLT12_RECEIVE_ASYNC_PATH,
"Retrieve the BOLT12 offer for receiving payments while this node is offline; requires async server configuration and static invoice server paths",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"requires async server configuration" is misleading for this tool: bolt12_receive_async needs the client role, plus paths to a static invoice server (see bolt12_set_paths_to_static_invoice_server). Only bolt12_blinded_paths_for_async_recipient needs the server role. Since agents will read this description, it would be worth being precise.

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.

3 participants