Skip to content

Commit 80509b5

Browse files
Add config for paths to a static invoice server
As part of being an async recipient, we need to support interactively building an offer and static invoice with an always-online node that will serve static invoices on our behalf. Add a config field containing blinded message paths that async recipients can use to request blinded paths that will be included in their offer. Payers will forward invoice requests over the paths returned by the server, and receive a static invoice in response if the recipient is offline.
1 parent b8673f3 commit 80509b5

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lightning/src/util/config.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
//! Various user-configurable channel limits and settings which ChannelManager
1111
//! applies for you.
1212
13+
use crate::blinded_path::message::BlindedMessagePath;
1314
use crate::ln::channel::MAX_FUNDING_SATOSHIS_NO_WUMBO;
1415
use crate::ln::channelmanager::{BREAKDOWN_TIMEOUT, MAX_LOCAL_BREAKDOWN_TIMEOUT};
16+
use crate::prelude::*;
1517

1618
#[cfg(fuzzing)]
1719
use crate::util::ser::Readable;
@@ -923,6 +925,14 @@ pub struct UserConfig {
923925
///
924926
/// Default value: `false`
925927
pub enable_dual_funded_channels: bool,
928+
/// [`BlindedMessagePath`]s to reach an always-online node that will serve [`StaticInvoice`]s on
929+
/// our behalf. Useful if we are an often-offline recipient that wants to receive async payments.
930+
/// Payers will send [`InvoiceRequest`]s over these paths, and receive a [`StaticInvoice`] in
931+
/// response from the always-online node.
932+
///
933+
/// [`StaticInvoice`]: crate::offers::static_invoice::StaticInvoice
934+
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
935+
pub paths_to_static_invoice_server: Vec<BlindedMessagePath>,
926936
}
927937

928938
impl Default for UserConfig {
@@ -937,6 +947,7 @@ impl Default for UserConfig {
937947
accept_intercept_htlcs: false,
938948
manually_handle_bolt12_invoices: false,
939949
enable_dual_funded_channels: false,
950+
paths_to_static_invoice_server: Vec::new(),
940951
}
941952
}
942953
}
@@ -957,6 +968,7 @@ impl Readable for UserConfig {
957968
accept_intercept_htlcs: Readable::read(reader)?,
958969
manually_handle_bolt12_invoices: Readable::read(reader)?,
959970
enable_dual_funded_channels: Readable::read(reader)?,
971+
paths_to_static_invoice_server: Vec::new(),
960972
})
961973
}
962974
}

lightning/src/util/ser.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,7 @@ impl_for_vec!(crate::chain::channelmonitor::ChannelMonitorUpdate);
10801080
impl_for_vec!(crate::ln::channelmanager::MonitorUpdateCompletionAction);
10811081
impl_for_vec!(crate::ln::channelmanager::PaymentClaimDetails);
10821082
impl_for_vec!(crate::ln::msgs::SocketAddress);
1083+
impl_for_vec!(crate::blinded_path::message::BlindedMessagePath);
10831084
impl_for_vec!((A, B), A, B);
10841085
impl_for_vec!(SerialId);
10851086
impl_for_vec!(InteractiveTxInput);

0 commit comments

Comments
 (0)