Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.

Add Single-Use Reply Block (SURB) Functionality (exit ≠ destination)#50

Open
AkshayaMani wants to merge 2 commits intomix-waku-integfrom
mix-waku-surb
Open

Add Single-Use Reply Block (SURB) Functionality (exit ≠ destination)#50
AkshayaMani wants to merge 2 commits intomix-waku-integfrom
mix-waku-surb

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant