-
Notifications
You must be signed in to change notification settings - Fork 492
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
Error decryption - adopt requirement also for new tlv package format. #1125
Comments
I believe that's just a leftover that we should remove from the spec, feel free to open a PR! We should loop until we've exhausted the shared secrets (which matches the number of hops we actually used for the payment path), not until a specific hard-coded value. |
Isn't the fixed number of decryptions needed to prevent any intermediate nodes from learning the source/destination via timing? If so, it would make more sense to increase the hard-coded value to 27 instead of removing it. |
Maybe we're not talking about the same steps in the onion process. I thought @ziggie1984 meant what is done by the sender of a payment when it receives an |
Yeah the spec just refers to the origin node in this part:
https://github.com/lightning/bolts/blob/master/04-onion-routing.md#returning-errors So I think we can remove it. |
I am also confused about the last part: I am not sure what is meant by obfuscate, because the origin node only cares about de-obfuscating, the ammag and um keys are locked in at this point for the routing hops (defined when building the route?). So not sure why this is important. I thought the erring nodes decides the size of the And not sure about the first requirement as well:
Should we really require this, it's up to the sender to decide whether he wants to keep the data or not, I think relay protection is not really relevant for the Erring Messages? |
I believe @morehouse is right, those 3 requirements were added to be somewhat "constant-time" on the sender side when decrypting an I believe all of this is useless (timing leaks are dominated by network latency in retries), so we have not implemented this in eclair and we instead stop as soon as we get the decrypted message. Those requirements are only a |
Ok now I understand, it specifically relates to the case where we would try the same payment via a different route and if we do not account for timing we would kind of reveal to the nodes in the path at which position they are probably in. So I think 20 seems like good enough. I think it probably makes sense to add more context (Rationale) to this part of the requirement I can add a PR describing it if we want that or even increase the hop size to 27? |
Currently the spec restrict the error decryption to 20 (hops):
SHOULD continue decrypting, until the loop has been repeated 20 times.
I think this springs from the old legacy format which had a maximum of 20 hops in a path. I think the new tlv package format can have up to 27 hops, so I wonder if this was kept deliberately or whether we should adopt this to the new tlv package structure ?
How I came to 27:
https://github.com/lightningnetwork/lightning-onion/blob/06182b1d7d2f9bd15ba1ebb404d026604758e78b/path.go#L10-L20
The text was updated successfully, but these errors were encountered: