Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Improve privacy for Blinded Message Paths using Dummy Hops #3726
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
base: main
Are you sure you want to change the base?
Improve privacy for Blinded Message Paths using Dummy Hops #3726
Changes from all commits
463cc94
58a0c13
4506256
14e1e0d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked up the bolt spec and read
"MAY add additional "dummy" hops at the end of the path (which it will ignore on receipt) to obscure the path length."
What does ignore mean exactly? It seems in the next commit that it means to keep peeling? Using the recipient node id for all the dummy hops isn't really described in the bolt I think. Maybe mistaking.
Also a mention of padding is made:
"The padding field can be used to ensure that all encrypted_recipient_data have the same length. It's particularly useful when adding dummy hops at the end of a blinded route, to prevent the sender from figuring out which node is the final recipient"
Not sure if that is done now too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thinking behind this approach was that if dummy hops were added after the
ReceiveTlvs
, it could open up timing-based attacks—where an attacker might estimate the position of the actual recipient based on how quickly a response is returned.To avoid that, I added the dummy hops just before the final node. This way, even after receiving a dummy hop (with
ForwardTlvs
directed to self), the node still has to keep peeling until it reaches the actualReceiveTlvs
. This helps make response timing more uniform and avoids leaking information about path length.Yes! In PR #3177, we added support for padding in both
BlindedMessagePaths
andBlindedPaymentPaths
, ensuring all payloads are a multiple ofPADDING_ROUND_OFF
.Since the
MESSAGE_PADDING_ROUND_OFF
buffer is large enough, every payload—whether it's aForwardTlvs
, dummy hop, orReceiveTlvs
—ends up with the same total length. This helps prevent the sender from inferring the number of hops based on packet size.I've also updated the padding tests to use
new_with_dummy_hops
, so we make sure even dummy hops are padded the same way as real ones.Thanks so much again for the super helpful feedback!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is strictly better, it could be worth a PR to the bolt spec? At the minimum it might get you some feedback on this line of thinking.
I am not sure if the timing attack is avoided though, and worth the extra complexity. Peeling seems to be so much faster than an actual hop with network latency etc. Some random delay might be more effective?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code also still works for blinded paths where dummy hops are added after the ReceiveTlvs right? Just making sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There shouldn't be a need to support that because we only support receiving to blinded paths that we create.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The timing attack does seem like a potential issue though. Not sure how to address that without adding some kind of
ProcessPendingHtlcsForwardable
event for onion messages, which seems like overkill. I think we can maybe document it on the issue and push to follow-up? @TheBlueMatt do you have any thoughts on how to simulate a fake onion message forward when processing dummy hops?