Skip to content

Commit d5c0a29

Browse files
committed
Expose BOLT 12 payer proofs
Add payer-proof creation to the gRPC, CLI, and MCP interfaces. Include the preimage and invoice in successful-payment events because stateless proof creation requires both values. AI assistance: OpenAI Codex was used to rebase and verify this change.
1 parent d29c51b commit d5c0a29

19 files changed

Lines changed: 411 additions & 38 deletions

File tree

docs/api-guide.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,9 @@ when the invoice is paid.
130130

131131
| RPC | Description |
132132
|-----------------|-------------------------------------------------------------------------|
133-
| `Bolt12Receive` | Create a BOLT12 offer (fixed or variable amount) |
134-
| `Bolt12Send` | Pay a BOLT12 offer (with optional quantity, payer note, routing config) |
133+
| `Bolt12Receive` | Create a BOLT12 offer (fixed or variable amount) |
134+
| `Bolt12Send` | Pay a BOLT12 offer (with optional quantity, payer note, routing config) |
135+
| `Bolt12CreatePayerProof` | Create a BOLT 12 payer proof from a successful payment |
135136

136137
### Spontaneous and Unified Send
137138

e2e-tests/tests/e2e.rs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,55 @@ async fn test_cli_bolt12_send() {
995995
assert!(!output["payment_id"].as_str().unwrap().is_empty());
996996
}
997997

998+
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
999+
async fn test_cli_bolt12_create_payer_proof() {
1000+
let bitcoind = TestBitcoind::new();
1001+
let server_a = LdkServerHandle::start(&bitcoind).await;
1002+
let server_b = LdkServerHandle::start(&bitcoind).await;
1003+
1004+
let mut events_a = server_a.client().subscribe_events().await.unwrap();
1005+
1006+
setup_funded_channel(&bitcoind, &server_a, &server_b, 100_000).await;
1007+
1008+
let offer_resp = server_b
1009+
.client()
1010+
.bolt12_receive(Bolt12ReceiveRequest {
1011+
description: "payer proof offer".to_string(),
1012+
amount_msat: Some(10_000_000),
1013+
expiry_secs: None,
1014+
quantity: None,
1015+
})
1016+
.await
1017+
.unwrap();
1018+
1019+
let send_output = run_cli(&server_a, &["bolt12-send", &offer_resp.offer]);
1020+
let send_payment_id = send_output["payment_id"].as_str().unwrap();
1021+
assert!(!send_payment_id.is_empty());
1022+
1023+
let event_a = wait_for_event(&mut events_a, |e| matches!(e, Event::PaymentSuccessful(_))).await;
1024+
let Some(Event::PaymentSuccessful(successful)) = &event_a.event else {
1025+
panic!("expected PaymentSuccessful");
1026+
};
1027+
assert_eq!(successful.payment_id, send_payment_id);
1028+
let payment_preimage = successful.payment_preimage.as_ref().expect("preimage");
1029+
let invoice = successful.bolt12_invoice.as_ref().expect("bolt12 invoice");
1030+
1031+
let proof_output = run_cli(
1032+
&server_a,
1033+
&[
1034+
"bolt12-create-payer-proof",
1035+
send_payment_id,
1036+
payment_preimage,
1037+
invoice,
1038+
"--include-offer-description",
1039+
"--include-invoice-amount",
1040+
"--note",
1041+
"Paid in full",
1042+
],
1043+
);
1044+
assert!(!proof_output["payer_proof"].as_str().unwrap().is_empty());
1045+
}
1046+
9981047
#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
9991048
async fn test_cli_spontaneous_send() {
10001049
let bitcoind = TestBitcoind::new();

ldk-server-cli/src/main.rs

Lines changed: 69 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,27 @@ use ldk_server_client::ldk_server_grpc::api::{
2929
Bolt11ReceiveRequest, Bolt11ReceiveResponse, Bolt11ReceiveVariableAmountViaJitChannelRequest,
3030
Bolt11ReceiveVariableAmountViaJitChannelResponse, Bolt11ReceiveViaJitChannelRequest,
3131
Bolt11ReceiveViaJitChannelResponse, Bolt11SendRequest, Bolt11SendResponse,
32-
Bolt11SendUnderpayingRequest, Bolt11SendUnderpayingResponse, Bolt12ReceiveRequest,
33-
Bolt12ReceiveResponse, Bolt12SendRequest, Bolt12SendResponse, CloseChannelRequest,
34-
CloseChannelResponse, ConnectPeerRequest, ConnectPeerResponse, DecodeInvoiceRequest,
35-
DecodeInvoiceResponse, DecodeOfferRequest, DecodeOfferResponse, DisconnectPeerRequest,
36-
DisconnectPeerResponse, ExportPathfindingScoresRequest, ForceCloseChannelRequest,
37-
ForceCloseChannelResponse, GetBalancesRequest, GetBalancesResponse, GetNodeInfoRequest,
38-
GetNodeInfoResponse, GetPaymentDetailsRequest, GetPaymentDetailsResponse,
39-
GraphGetChannelRequest, GraphGetChannelResponse, GraphGetNodeRequest, GraphGetNodeResponse,
40-
GraphListChannelsRequest, GraphListChannelsResponse, GraphListNodesRequest,
41-
GraphListNodesResponse, ListChannelsRequest, ListChannelsResponse,
42-
ListForwardedPaymentsRequest, ListPaymentsRequest, ListPeersRequest, ListPeersResponse,
43-
OnchainReceiveRequest, OnchainReceiveResponse, OnchainSendRequest, OnchainSendResponse,
44-
OpenChannelRequest, OpenChannelResponse, SignMessageRequest, SignMessageResponse,
45-
SpliceInRequest, SpliceInResponse, SpliceOutRequest, SpliceOutResponse, SpontaneousSendRequest,
46-
SpontaneousSendResponse, UnifiedSendRequest, UnifiedSendResponse, UpdateChannelConfigRequest,
47-
UpdateChannelConfigResponse, VerifySignatureRequest, VerifySignatureResponse,
32+
Bolt11SendUnderpayingRequest, Bolt11SendUnderpayingResponse, Bolt12CreatePayerProofRequest,
33+
Bolt12CreatePayerProofResponse, Bolt12ReceiveRequest, Bolt12ReceiveResponse, Bolt12SendRequest,
34+
Bolt12SendResponse, CloseChannelRequest, CloseChannelResponse, ConnectPeerRequest,
35+
ConnectPeerResponse, DecodeInvoiceRequest, DecodeInvoiceResponse, DecodeOfferRequest,
36+
DecodeOfferResponse, DisconnectPeerRequest, DisconnectPeerResponse,
37+
ExportPathfindingScoresRequest, ForceCloseChannelRequest, ForceCloseChannelResponse,
38+
GetBalancesRequest, GetBalancesResponse, GetNodeInfoRequest, GetNodeInfoResponse,
39+
GetPaymentDetailsRequest, GetPaymentDetailsResponse, GraphGetChannelRequest,
40+
GraphGetChannelResponse, GraphGetNodeRequest, GraphGetNodeResponse, GraphListChannelsRequest,
41+
GraphListChannelsResponse, GraphListNodesRequest, GraphListNodesResponse, ListChannelsRequest,
42+
ListChannelsResponse, ListForwardedPaymentsRequest, ListPaymentsRequest, ListPeersRequest,
43+
ListPeersResponse, OnchainReceiveRequest, OnchainReceiveResponse, OnchainSendRequest,
44+
OnchainSendResponse, OpenChannelRequest, OpenChannelResponse, SignMessageRequest,
45+
SignMessageResponse, SpliceInRequest, SpliceInResponse, SpliceOutRequest, SpliceOutResponse,
46+
SpontaneousSendRequest, SpontaneousSendResponse, UnifiedSendRequest, UnifiedSendResponse,
47+
UpdateChannelConfigRequest, UpdateChannelConfigResponse, VerifySignatureRequest,
48+
VerifySignatureResponse,
4849
};
4950
use ldk_server_client::ldk_server_grpc::types::{
5051
bolt11_invoice_description, Bolt11InvoiceDescription, ChannelConfig, CustomTlvRecord,
51-
PageToken, RouteParametersConfig,
52+
PageToken, PayerProofOptions, RouteParametersConfig,
5253
};
5354
use ldk_server_client::{
5455
DEFAULT_EXPIRY_SECS, DEFAULT_MAX_CHANNEL_SATURATION_POWER_OF_HALF, DEFAULT_MAX_PATH_COUNT,
@@ -315,6 +316,27 @@ enum Commands {
315316
)]
316317
max_channel_saturation_power_of_half: Option<u32>,
317318
},
319+
#[command(about = "Create a BOLT 12 payer proof for a payment this node made")]
320+
Bolt12CreatePayerProof {
321+
#[arg(help = "The hex-encoded payment id from PaymentSuccessful")]
322+
payment_id: String,
323+
#[arg(help = "The hex-encoded 32-byte payment preimage from PaymentSuccessful")]
324+
payment_preimage: String,
325+
#[arg(help = "The hex-encoded BOLT 12 invoice from PaymentSuccessful")]
326+
invoice: String,
327+
#[arg(long, help = "Optional note to attach to the payer proof")]
328+
note: Option<String>,
329+
#[arg(long, help = "Disclose the offer description in the proof")]
330+
include_offer_description: bool,
331+
#[arg(long, help = "Disclose the offer issuer in the proof")]
332+
include_offer_issuer: bool,
333+
#[arg(long, help = "Disclose the invoice amount in the proof")]
334+
include_invoice_amount: bool,
335+
#[arg(long, help = "Disclose the invoice creation timestamp in the proof")]
336+
include_invoice_created_at: bool,
337+
#[arg(long, help = "Additional TLV types to disclose")]
338+
extra_tlv_types: Vec<u64>,
339+
},
318340
#[command(about = "Send a spontaneous payment (keysend) to a node")]
319341
SpontaneousSend {
320342
#[arg(help = "The hex-encoded public key of the node to send the payment to")]
@@ -868,6 +890,36 @@ async fn main() {
868890
.await,
869891
);
870892
},
893+
Commands::Bolt12CreatePayerProof {
894+
payment_id,
895+
payment_preimage,
896+
invoice,
897+
note,
898+
include_offer_description,
899+
include_offer_issuer,
900+
include_invoice_amount,
901+
include_invoice_created_at,
902+
extra_tlv_types,
903+
} => {
904+
let options = PayerProofOptions {
905+
note,
906+
include_offer_description,
907+
include_offer_issuer,
908+
include_invoice_amount,
909+
include_invoice_created_at,
910+
extra_tlv_types,
911+
};
912+
handle_response_result::<_, Bolt12CreatePayerProofResponse>(
913+
client
914+
.bolt12_create_payer_proof(Bolt12CreatePayerProofRequest {
915+
payment_id,
916+
payment_preimage,
917+
invoice,
918+
options: Some(options),
919+
})
920+
.await,
921+
);
922+
},
871923
Commands::SpontaneousSend {
872924
node_id,
873925
amount,

ldk-server-client/src/client.rs

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@ use ldk_server_grpc::api::{
2121
Bolt11ReceiveRequest, Bolt11ReceiveResponse, Bolt11ReceiveVariableAmountViaJitChannelRequest,
2222
Bolt11ReceiveVariableAmountViaJitChannelResponse, Bolt11ReceiveViaJitChannelRequest,
2323
Bolt11ReceiveViaJitChannelResponse, Bolt11SendRequest, Bolt11SendResponse,
24-
Bolt11SendUnderpayingRequest, Bolt11SendUnderpayingResponse, Bolt12ReceiveRequest,
25-
Bolt12ReceiveResponse, Bolt12SendRequest, Bolt12SendResponse, CloseChannelRequest,
26-
CloseChannelResponse, ConnectPeerRequest, ConnectPeerResponse, DecodeInvoiceRequest,
27-
DecodeInvoiceResponse, DecodeOfferRequest, DecodeOfferResponse, DisconnectPeerRequest,
28-
DisconnectPeerResponse, ExportPathfindingScoresRequest, ExportPathfindingScoresResponse,
29-
ForceCloseChannelRequest, ForceCloseChannelResponse, GetBalancesRequest, GetBalancesResponse,
30-
GetNodeInfoRequest, GetNodeInfoResponse, GetPaymentDetailsRequest, GetPaymentDetailsResponse,
24+
Bolt11SendUnderpayingRequest, Bolt11SendUnderpayingResponse, Bolt12CreatePayerProofRequest,
25+
Bolt12CreatePayerProofResponse, Bolt12ReceiveRequest, Bolt12ReceiveResponse, Bolt12SendRequest,
26+
Bolt12SendResponse, CloseChannelRequest, CloseChannelResponse, ConnectPeerRequest,
27+
ConnectPeerResponse, DecodeInvoiceRequest, DecodeInvoiceResponse, DecodeOfferRequest,
28+
DecodeOfferResponse, DisconnectPeerRequest, DisconnectPeerResponse,
29+
ExportPathfindingScoresRequest, ExportPathfindingScoresResponse, ForceCloseChannelRequest,
30+
ForceCloseChannelResponse, GetBalancesRequest, GetBalancesResponse, GetNodeInfoRequest,
31+
GetNodeInfoResponse, GetPaymentDetailsRequest, GetPaymentDetailsResponse,
3132
GraphGetChannelRequest, GraphGetChannelResponse, GraphGetNodeRequest, GraphGetNodeResponse,
3233
GraphListChannelsRequest, GraphListChannelsResponse, GraphListNodesRequest,
3334
GraphListNodesResponse, ListChannelsRequest, ListChannelsResponse,
@@ -44,10 +45,10 @@ use ldk_server_grpc::endpoints::{
4445
BOLT11_CLAIM_FOR_ID_PATH, BOLT11_FAIL_FOR_ID_PATH, BOLT11_RECEIVE_FOR_HASH_PATH,
4546
BOLT11_RECEIVE_PATH, BOLT11_RECEIVE_VARIABLE_AMOUNT_VIA_JIT_CHANNEL_PATH,
4647
BOLT11_RECEIVE_VIA_JIT_CHANNEL_PATH, BOLT11_SEND_PATH, BOLT11_SEND_UNDERPAYING_PATH,
47-
BOLT12_RECEIVE_PATH, BOLT12_SEND_PATH, CLOSE_CHANNEL_PATH, CONNECT_PEER_PATH,
48-
DECODE_INVOICE_PATH, DECODE_OFFER_PATH, DISCONNECT_PEER_PATH, EXPORT_PATHFINDING_SCORES_PATH,
49-
FORCE_CLOSE_CHANNEL_PATH, GET_BALANCES_PATH, GET_METRICS_PATH, GET_NODE_INFO_PATH,
50-
GET_PAYMENT_DETAILS_PATH, GRAPH_GET_CHANNEL_PATH, GRAPH_GET_NODE_PATH,
48+
BOLT12_CREATE_PAYER_PROOF_PATH, BOLT12_RECEIVE_PATH, BOLT12_SEND_PATH, CLOSE_CHANNEL_PATH,
49+
CONNECT_PEER_PATH, DECODE_INVOICE_PATH, DECODE_OFFER_PATH, DISCONNECT_PEER_PATH,
50+
EXPORT_PATHFINDING_SCORES_PATH, FORCE_CLOSE_CHANNEL_PATH, GET_BALANCES_PATH, GET_METRICS_PATH,
51+
GET_NODE_INFO_PATH, GET_PAYMENT_DETAILS_PATH, GRAPH_GET_CHANNEL_PATH, GRAPH_GET_NODE_PATH,
5152
GRAPH_LIST_CHANNELS_PATH, GRAPH_LIST_NODES_PATH, GRPC_SERVICE_PREFIX, LIST_CHANNELS_PATH,
5253
LIST_FORWARDED_PAYMENTS_PATH, LIST_PAYMENTS_PATH, LIST_PEERS_PATH, ONCHAIN_RECEIVE_PATH,
5354
ONCHAIN_SEND_PATH, OPEN_CHANNEL_PATH, SIGN_MESSAGE_PATH, SPLICE_IN_PATH, SPLICE_OUT_PATH,
@@ -269,6 +270,13 @@ impl LdkServerClient {
269270
self.grpc_unary(&request, BOLT12_SEND_PATH).await
270271
}
271272

273+
/// Create a BOLT 12 payer proof for a payment this node made.
274+
pub async fn bolt12_create_payer_proof(
275+
&self, request: Bolt12CreatePayerProofRequest,
276+
) -> Result<Bolt12CreatePayerProofResponse, LdkServerError> {
277+
self.grpc_unary(&request, BOLT12_CREATE_PAYER_PROOF_PATH).await
278+
}
279+
272280
/// Creates a new outbound channel.
273281
pub async fn open_channel(
274282
&self, request: OpenChannelRequest,

ldk-server-grpc/src/api.rs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,40 @@ pub struct Bolt12SendResponse {
491491
#[prost(string, tag = "1")]
492492
pub payment_id: ::prost::alloc::string::String,
493493
}
494+
/// Create a BOLT 12 payer proof for a payment this node made.
495+
/// Inputs come from `PaymentSuccessful`: `payment_id`, `payment_preimage`, and `bolt12_invoice`.
496+
/// See more: <https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt12Payment.html#method.create_payer_proof>
497+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
498+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
499+
#[cfg_attr(feature = "serde", serde(default))]
500+
#[allow(clippy::derive_partial_eq_without_eq)]
501+
#[derive(Clone, PartialEq, ::prost::Message)]
502+
pub struct Bolt12CreatePayerProofRequest {
503+
/// The local identifier used to track the payment, in hex-encoded form.
504+
#[prost(string, tag = "1")]
505+
pub payment_id: ::prost::alloc::string::String,
506+
/// The hex-encoded 32-byte payment preimage from `PaymentSuccessful`.
507+
#[prost(string, tag = "2")]
508+
pub payment_preimage: ::prost::alloc::string::String,
509+
/// The hex-encoded BOLT 12 invoice from `PaymentSuccessful.bolt12_invoice`.
510+
/// Static invoices used for async payments cannot be proven.
511+
#[prost(string, tag = "3")]
512+
pub invoice: ::prost::alloc::string::String,
513+
/// Controls which optional invoice fields the proof discloses.
514+
#[prost(message, optional, tag = "4")]
515+
pub options: ::core::option::Option<super::types::PayerProofOptions>,
516+
}
517+
/// The response for the `Bolt12CreatePayerProof` RPC. On failure, a gRPC error status is returned.
518+
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
519+
#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]
520+
#[cfg_attr(feature = "serde", serde(default))]
521+
#[allow(clippy::derive_partial_eq_without_eq)]
522+
#[derive(Clone, PartialEq, ::prost::Message)]
523+
pub struct Bolt12CreatePayerProofResponse {
524+
/// The bech32-encoded payer proof.
525+
#[prost(string, tag = "1")]
526+
pub payer_proof: ::prost::alloc::string::String,
527+
}
494528
/// Send a spontaneous payment, also known as "keysend", to a node.
495529
/// See more: <https://docs.rs/ldk-node/latest/ldk_node/payment/struct.SpontaneousPayment.html#method.send>
496530
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]

ldk-server-grpc/src/endpoints.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ pub const BOLT11_SEND_PATH: &str = "Bolt11Send";
2525
pub const BOLT11_SEND_UNDERPAYING_PATH: &str = "Bolt11SendUnderpaying";
2626
pub const BOLT12_RECEIVE_PATH: &str = "Bolt12Receive";
2727
pub const BOLT12_SEND_PATH: &str = "Bolt12Send";
28+
pub const BOLT12_CREATE_PAYER_PROOF_PATH: &str = "Bolt12CreatePayerProof";
2829
pub const OPEN_CHANNEL_PATH: &str = "OpenChannel";
2930
pub const SPLICE_IN_PATH: &str = "SpliceIn";
3031
pub const SPLICE_OUT_PATH: &str = "SpliceOut";

ldk-server-grpc/src/events.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,13 @@ pub struct PaymentSuccessful {
170170
/// The payment details for the payment in event.
171171
#[prost(message, optional, tag = "2")]
172172
pub payment: ::core::option::Option<super::types::Payment>,
173+
/// The hex-encoded payment preimage. Needed to build a BOLT 12 payer proof.
174+
#[prost(string, optional, tag = "3")]
175+
pub payment_preimage: ::core::option::Option<::prost::alloc::string::String>,
176+
/// The hex-encoded paid BOLT 12 invoice, when the payment was for a standard BOLT 12 invoice.
177+
/// Unset for non-BOLT12 payments and for static invoices used in async payments.
178+
#[prost(string, optional, tag = "4")]
179+
pub bolt12_invoice: ::core::option::Option<::prost::alloc::string::String>,
173180
}
174181
/// PaymentFailed indicates a sent payment has failed.
175182
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]

ldk-server-grpc/src/proto/api.proto

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,30 @@ message Bolt12SendResponse {
378378
string payment_id = 1;
379379
}
380380

381+
// Create a BOLT 12 payer proof for a payment this node made.
382+
// Inputs come from `PaymentSuccessful`: `payment_id`, `payment_preimage`, and `bolt12_invoice`.
383+
// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.Bolt12Payment.html#method.create_payer_proof
384+
message Bolt12CreatePayerProofRequest {
385+
// The local identifier used to track the payment, in hex-encoded form.
386+
string payment_id = 1;
387+
388+
// The hex-encoded 32-byte payment preimage from `PaymentSuccessful`.
389+
string payment_preimage = 2;
390+
391+
// The hex-encoded BOLT 12 invoice from `PaymentSuccessful.bolt12_invoice`.
392+
// Static invoices used for async payments cannot be proven.
393+
string invoice = 3;
394+
395+
// Controls which optional invoice fields the proof discloses.
396+
optional types.PayerProofOptions options = 4;
397+
}
398+
399+
// The response for the `Bolt12CreatePayerProof` RPC. On failure, a gRPC error status is returned.
400+
message Bolt12CreatePayerProofResponse {
401+
// The bech32-encoded payer proof.
402+
string payer_proof = 1;
403+
}
404+
381405
// Send a spontaneous payment, also known as "keysend", to a node.
382406
// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.SpontaneousPayment.html#method.send
383407
message SpontaneousSendRequest {
@@ -972,6 +996,8 @@ service LightningNode {
972996
rpc Bolt12Receive(Bolt12ReceiveRequest) returns (Bolt12ReceiveResponse);
973997
// Send a payment for a BOLT12 offer.
974998
rpc Bolt12Send(Bolt12SendRequest) returns (Bolt12SendResponse);
999+
// Create a BOLT 12 payer proof for a payment this node made.
1000+
rpc Bolt12CreatePayerProof(Bolt12CreatePayerProofRequest) returns (Bolt12CreatePayerProofResponse);
9751001
// Send a spontaneous payment (keysend).
9761002
rpc SpontaneousSend(SpontaneousSendRequest) returns (SpontaneousSendResponse);
9771003
// Create a new outbound channel.

ldk-server-grpc/src/proto/events.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ message PaymentSuccessful {
108108
string payment_id = 1;
109109
// The payment details for the payment in event.
110110
types.Payment payment = 2;
111+
// The hex-encoded payment preimage. Needed to build a BOLT 12 payer proof.
112+
optional string payment_preimage = 3;
113+
// The hex-encoded paid BOLT 12 invoice, when the payment was for a standard BOLT 12 invoice.
114+
// Unset for non-BOLT12 payments and for static invoices used in async payments.
115+
optional string bolt12_invoice = 4;
111116
}
112117

113118
// PaymentFailed indicates a sent payment has failed.

ldk-server-grpc/src/proto/types.proto

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,28 @@ message Payment {
2929
uint64 latest_update_timestamp = 6;
3030
}
3131

32+
// Options that control which BOLT 12 invoice fields a payer proof discloses.
33+
// See more: https://docs.rs/ldk-node/latest/ldk_node/payment/struct.PayerProofOptions.html
34+
message PayerProofOptions {
35+
// An optional note to attach to the payer proof itself.
36+
optional string note = 1;
37+
38+
// Whether to disclose the offer description.
39+
bool include_offer_description = 2;
40+
41+
// Whether to disclose the offer issuer.
42+
bool include_offer_issuer = 3;
43+
44+
// Whether to disclose the invoice amount.
45+
bool include_invoice_amount = 4;
46+
47+
// Whether to disclose the invoice creation timestamp.
48+
bool include_invoice_created_at = 5;
49+
50+
// Additional TLV types to disclose, for fields not covered by the flags above.
51+
repeated uint64 extra_tlv_types = 6;
52+
}
53+
3254
message PaymentKind {
3355
oneof kind {
3456
Onchain onchain = 1;

0 commit comments

Comments
 (0)