in reviewhumanPR #86Communication
[NandaHack] privacy-comms: Tor-style Onion Routing anonymity network
๐ง Layer 02 (Communication): Tor-style Onion Routing Network
Author
@anilchowdary07
github profile โ- Status
- In review
- Opened on
- Jul 7
- Branch
- hackathon/nandha-onion-routing
Description
The pitch.
๐ง Layer 02 (Communication): Tor-style Onion Routing Network Overview This PR implements a decentralized, multi-hop anonymity network for AI agent communications as an implementation for Layer 02 (comms). Instead of simple point-to-point JSON transmission, this plugin ensures that intermediaries cannot read payloads or deduce the final destination of a message. Key Features Implemented: onion.py Core Plugin: Implements the OnionRoutingComms class. When an agent sends a message, it dynamically queries the Registry for relay peers and constructs a multi-hop circuit. Recursive AES-GCM Encryption: The payload is iteratively wrapped in layers of symmetric cryptography. Each layer contains specific routing instructions intended only for the next hop. Transparent Relaying: When an intermediary agent receives an Onion packet via deserialize(), it peels off its specific layer. If the packet is a relay instruction, it transparently forwards the inner encrypted payload without requiring the base agent to intervene. Zero-Knowledge Transport: The underlying transport layer only sees point-to-point encrypted byte transfers. The sender, receiver, and payload remain entirely obfuscated from intermediaries. Verification & Testing: test_onion_routing.py: Full end-to-end test suite proving multi-hop encryption, successful routing through 3 relays, and correct destination unpacking. Handled malicious/malformed packet rejection testing. Registered the plugin entrypoint in pyproject.toml
Try it
Open PR on GitHubView diffCheckout locally
git fetch origin pull/86/head:pr-86
git checkout pr-86