Does a Tor Middle Relay Know Your IP Address?

A Tor middle relay does not know your original IP address under any standard operating condition. Tor achieves strong user anonymity through a technique known as onion routing, which wraps internet traffic in multiple layers of encryption and routes it through a three-node circuit: the guard (entry) relay, the middle relay, and the exit relay. Because of how these cryptographic layers are structured, each relay in the path only learns the identity of the node directly preceding it and the node directly following it, ensuring the middle relay remains completely blind to your actual identity and your final destination.

When your Tor client builds a circuit, it negotiates unique encryption keys with all three relays separately. Your client encrypts your data three times—first for the exit relay, then for the middle relay, and finally for the guard relay.

As your traffic moves through the circuit, each relay performs a specific role:

The primary purpose of the middle relay is to act as a buffer. Even if an adversary compromises or operates a malicious exit relay, they cannot simply trace the connection back one hop to find you, because the preceding node is merely the middle relay. Likewise, a compromised guard relay cannot confirm which exit node or destination you are accessing, because it only connects to the middle relay.

Because the middle relay sits isolated between the guard and exit nodes, your original IP address is never transmitted to it, maintaining your anonymity throughout the browsing session.