Expand description

Onion Messages: sending, receiving, forwarding, and ancillary utilities live here

Onion messages are multi-purpose messages sent between peers over the lightning network. In the near future, they will be used to communicate invoices for offers, unlocking use cases such as static invoices, refunds and proof of payer. Further, you will be able to accept payments without revealing your node id through the use of blinded routes.

LDK sends and receives onion messages via the OnionMessenger. See its documentation for more information on its usage.

Structs

Used to construct the blinded hops portion of a blinded route. These hops cannot be identified by outside observers and thus can be used to hide the identity of the recipient.
Onion messages can be sent and received to blinded routes, which serve to hide the identity of the recipient.
A sender, receiver and forwarder of onion messages. In upcoming releases, this object will be used to retrieve invoices and fulfill invoice requests from offers. Currently, only sending and receiving custom onion messages is supported.

Enums

The destination of an onion message.
The contents of an onion message. In the context of offers, this would be the invoice, invoice request, or invoice error.
Errors that may occur when sending an onion message.

Traits

The contents of a custom onion message. Must implement MaybeReadableArgs<u64> where the u64 is the custom TLV type attempting to be read, and return Ok(None) if the TLV type is unknown.
Handler for custom onion messages. If you are using SimpleArcOnionMessenger, SimpleRefOnionMessenger, or prefer to ignore inbound custom onion messages, IgnoringMessageHandler must be provided to OnionMessenger::new. Otherwise, a custom implementation of this trait must be provided, with CustomMessage specifying the supported message types.

Type Definitions

Useful for simplifying the parameters of SimpleArcChannelManager and SimpleArcPeerManager. See their docs for more details.
Useful for simplifying the parameters of SimpleRefChannelManager and SimpleRefPeerManager. See their docs for more details.