Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-hop BlindedPath creation interface #2781

Merged
merged 14 commits into from
Dec 15, 2023

Commits on Dec 15, 2023

  1. Re-order AnchorsZeroFeeHtlcTx in module docs/tests

    Move AnchorsZeroFeeHtlcTx after Wumbo to keep order by feature bit.
    Also, update setting order and comment in tests.
    jkczyz committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    ee026d4 View commit details
    Browse the repository at this point in the history
  2. Add RouteBlinding feature flag

    The RouteBlinding feature flag is signals support for relaying payments
    over blinded paths. It is used for paying BOLT 12 invoices, which are
    required to included at least one blinded path.
    jkczyz committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    ffb0d83 View commit details
    Browse the repository at this point in the history
  3. Add create_blinded_paths to MessageRouter

    The MessageRouter trait is used to find an OnionMessagePath to a
    Destination (e.g., to a BlindedPath). Expand the interface with a
    create_blinded_paths method for creating such paths to a recipient.
    Provide a default implementation creating two-hop blinded paths where
    the recipient's peers serve as introduction nodes.
    jkczyz committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    97049da View commit details
    Browse the repository at this point in the history
  4. Require any Router also implements MessageRouter

    ChannelManager is parameterized by a Router in order to find routes when
    sending and retrying payments. For the offers flow, it needs to be able
    to construct blinded paths (e.g., in the offer and in reply paths).
    Instead of adding yet another parameter to ChannelManager, require that
    any Router also implements MessageRouter. Implement this for
    DefaultRouter by delegating to a DefaultMessageRouter.
    jkczyz committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    bedc2c6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    c558ccd View commit details
    Browse the repository at this point in the history
  6. Use CLTV_FAR_FAR_AWAY in PaymentConstraints

    When finding a route through a blinded path, a random CLTV offset may be
    added to the path in order to preserve privacy. This needs to be
    accounted for in the blinded path's PaymentConstraints. Add
    CLTV_FAR_FAR_AWAY to the max_cltv_expiry constraint to allow for such
    offsets.
    jkczyz committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    dcd8d58 View commit details
    Browse the repository at this point in the history
  7. Multi-hop blinded paths in ChannelManager

    When constructing blinded paths for Offer and Refund, delegate to
    MessageRouter::create_blinded_paths which may produce multi-hop blinded
    paths. Fallback to one-hop blinded paths if the MessageRouter fails or
    returns no paths.
    
    Likewise, do the same for InvoiceRequest and Bolt12Invoice reply paths.
    jkczyz committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    606304a View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4da0862 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    edb5892 View commit details
    Browse the repository at this point in the history
  10. Add create_blinded_payment_paths to Router

    The Router trait is used to find a Route for paying a node. Expand the
    interface with a create_blinded_payment paths method for creating such
    paths to a recipient node.
    
    Provide an implementation for DefaultRouter that creates two-hop
    blinded paths where the recipient's peers serve as the introduction
    nodes.
    jkczyz committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    62f8669 View commit details
    Browse the repository at this point in the history
  11. Multi-hop blinded payment paths in ChannelManager

    When constructing blinded payment paths for Bolt12Invoice, delegate to
    Router::create_blinded_payment_paths which may produce multi-hop blinded
    paths. Fallback to one-hop blinded paths if the Router fails or returns
    no paths.
    jkczyz committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    827833c View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    16ee240 View commit details
    Browse the repository at this point in the history
  13. Use one-hop blinded paths only for announced nodes

    To avoid exposing a node's identity in a blinded path, only create
    one-hop blinded paths if the node has been announced, and thus has
    public channels. Otherwise, there is no way to route a payment to the
    node, exposing its identity needlessly.
    jkczyz committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    164c855 View commit details
    Browse the repository at this point in the history
  14. Fix build warning

    jkczyz committed Dec 15, 2023
    Configuration menu
    Copy the full SHA
    37319a6 View commit details
    Browse the repository at this point in the history