Fix SURB: only hand out the innermost payload key, not every hop's - #105
Draft
aniampio wants to merge 1 commit into
Draft
Fix SURB: only hand out the innermost payload key, not every hop's #105aniampio wants to merge 1 commit into
aniampio wants to merge 1 commit into
Conversation
Contributor
Author
|
As discussed with @jstuczyn this cannot currently be integrated into nym-client or deployed because we first need to move the removal of the final Sphinx layer from the last gateway to the client. Otherwise, the gateway does not hold the necessary cryptographic information to derive the plaintext (as it does for all forward packets). |
aniampio
marked this pull request as draft
August 17, 2026 08:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
the route (up to 5). Whoever used the SURB to send a reply (
SURB::use_surb) wouldlayer-encrypt the payload with all of them - i.e. they computed every layer of
encryption themselves, exactly like a normal forward packet's original sender.
exist at every point along the reply route. If they collude with the last mix node,
that node can match the ciphertext it sees against what it was told to expect,
confirming this packet belongs to this specific reply route - deanonymizing which
original (anonymous) sender the reply is going back to.
route (the innermost encryption layer).
use_surbadds exactly one layer instead oflooping over all of them.
unwrap()one layer with their own key regardless of packet type, andencrypt/decrypt with a given key are true inverses of each other regardless of what
other layers are nested around them. So the transit-added layers can be undone later by
whoever holds every hop's key (the SURB's original creator) - that "designated
receiver" logic is tracked as separate follow-up work, not part of this PR.
Note: