Skip to content

feat: allow setting custom preimage in spontaneous-send#233

Open
f3r10 wants to merge 1 commit into
lightningdevkit:mainfrom
f3r10:feat/custom_preimage_in_spontaneous_send
Open

feat: allow setting custom preimage in spontaneous-send#233
f3r10 wants to merge 1 commit into
lightningdevkit:mainfrom
f3r10:feat/custom_preimage_in_spontaneous_send

Conversation

@f3r10

@f3r10 f3r10 commented Jun 15, 2026

Copy link
Copy Markdown

address #226

Summary

  • Adds an optional preimage field to SpontaneousSendRequest, allowing callers to supply a custom 32-byte hex preimage instead of having the node generate one randomly
  • Dispatches to the appropriate ldk-node method (send_with_preimage or send_with_preimage_and_custom_tlvs) based on whether preimage and/or custom TLVs are present
  • Exposes the flag in the CLI (--preimage) and MCP schema
  • Adds an e2e test verifying the receiver observes a payment hash equal to
    SHA256 of the provided preimage

@ldk-reviews-bot

ldk-reviews-bot commented Jun 15, 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.

@benthecarman benthecarman linked an issue Jun 15, 2026 that may be closed by this pull request
Comment thread e2e-tests/tests/e2e.rs
bolt11_invoice_description, Bolt11InvoiceDescription,
};

use ldk_server_grpc::types::payment_kind;

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: can we have a new line between the imports and const

help = "Custom TLV record to attach, format: <type_num>:<hex_value>. Repeatable. type_num must be >= 65536."
)]
custom_tlvs: Vec<(u64, Vec<u8>)>,
#[arg(long)]

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.

please add help text

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.

Allow setting custom preimage in spontaneous-send

3 participants