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

Blinded paths with unannounced introduction nodes #3132

Merged
merged 8 commits into from
Jun 19, 2024

Conversation

jkczyz
Copy link
Contributor

@jkczyz jkczyz commented Jun 17, 2024

When creating blinded paths for receiving onion messages or payments, allow using the recipient's only peer as the introduction node when the recipient is unannounced. This allows for sending messages or payments without going through an intermediary, which is useful for testing or when only connected to an LSP with an empty NetworkGraph.

Also add support for paying through a BlindedPath where we are the introduction node.

Fixes #2952.

@jkczyz jkczyz requested review from TheBlueMatt and tnull June 17, 2024 21:06
jkczyz added 8 commits June 18, 2024 09:26
When creating blinded paths for receiving onion messages, allow using
the recipient's only peer as the introduction node when the recipient is
unannounced. This allows for sending messages without going through an
intermediary, which is useful for testing or when only connected to an
LSP with an empty NetworkGraph.
When creating blinded paths for receiving onion payments, allow using
the recipient's only peer as the introduction node when the recipient is
unannounced. This allows for sending payments without going through an
intermediary, which is useful for testing or when only connected to an
LSP with an empty NetworkGraph.
When using advance_path_by_one when we are the introduction node, any
error will result having the first hop of the input blinded path
removed. Instead, only remove the first hop on success. Otherwise, the
path will be invalid.
Similar to blinded paths for onion messages, if given a blinded payment
path where we are the introduction node, the path must be advanced by
one in order to use it.
DefaultRouter will ignore blinded paths where the sender is the
introduction node. Similar to message paths, advance such paths by one
so that payments may be sent to them.
When creating blinded paths, introduction nodes are limited to peers
with at least three channels to prevent easily guessing the recipient.
Relax this check when the recipient is unannounced since they won't be
in the NetworkGraph.
@jkczyz jkczyz force-pushed the 2024-06-bolt12-unannounced branch from 2046b4a to c1eda4b Compare June 18, 2024 14:26
.map(|details| details.counterparty.node_id)
.map(|node_id| first_hops
.iter()
.skip(1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you dont need to skip this its always equal :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why I'm skipping it :)

Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tnull tnull merged commit f45a840 into lightningdevkit:main Jun 19, 2024
14 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider allowing for BOLT12 payments over unannounced channels
3 participants