Skip to content

Conversation

@AkshayaMani
Copy link
Collaborator

@AkshayaMani AkshayaMani commented Jul 4, 2025

Description

This PR introduces Single-Use Reply Blocks (SURB) functionality to the Mix protocol for the case where the exit node is not the destination.

Summary of changes

  • Added SURB implementation functions:

    • createSURB: Creates a single-use reply block.
    • useSURB: Encrypts a reply message, attaches a given SURB to it, and creates a response Sphinx packet.
    • processReply: Decrypts and extracts the message from a reply payload.
  • Refactored Sphinx packet construction logic:

    • Split computeBetaGammaDelta into computeBetaGamma and computeDelta for modularity and reuse across SURB operations.
  • Added comprehensive unit tests:

    • Tests covering end-to-end SURB creation, use, and processing across multiple hops.
    • Tests for empty public keys, invalid MAC handling, duplicate tag detection, and variable message sizes to ensure correctness.

Motivation

SURBs enable anonymous replies and ACKs in the Mix protocol without revealing sender identity.


Target branch: Waku branch
Related: Core SURB integration, Issue #41, and PR #51

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.

2 participants