pub fn create_phantom_invoice<Signer: Sign, K: Deref>(
    amt_msat: Option<u64>,
    description: String,
    payment_hash: PaymentHash,
    payment_secret: PaymentSecret,
    phantom_route_hints: Vec<PhantomRouteHints>,
    keys_manager: K,
    network: Currency
) -> Result<Invoice, SignOrCreationError<()>> where
    K::Target: KeysInterface
This is supported on crate feature std only.
Expand description

Utility to create an invoice that can be paid to one of multiple nodes, or a “phantom invoice.” See PhantomKeysManager for more information on phantom node payments.

phantom_route_hints parameter:

  • Contains channel info for all nodes participating in the phantom invoice
  • Entries are retrieved from a call to ChannelManager::get_phantom_route_hints on each participating node
  • It is fine to cache phantom_route_hints and reuse it across invoices, as long as the data is updated when a channel becomes disabled or closes
  • Note that if too many channels are included in PhantomRouteHints::channels, the invoice may be too long for QR code scanning. To fix this, PhantomRouteHints::channels may be pared down

payment_hash and payment_secret come from ChannelManager::create_inbound_payment or ChannelManager::create_inbound_payment_for_hash. These values can be retrieved from any participating node.

Note that the provided keys_manager’s KeysInterface implementation must support phantom invoices in its sign_invoice implementation (PhantomKeysManager satisfies this requirement).