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:
- Guard (Entry) Relay: The guard relay receives the encrypted packet directly from your device, so it sees your original IP address. However, it only knows the identity of the middle relay. It cannot read the payload or see the final destination.
- Middle Relay: The guard relay forwards the data to the middle relay. The middle relay peels off its layer of encryption to reveal instructions to forward the remaining encrypted payload to the exit relay. The middle relay only sees the IP address of the guard relay (where the packet came from) and the IP address of the exit relay (where the packet is going). It never interacts with or receives packets directly from your device.
- Exit Relay: The exit relay decrypts the final layer and sends the request to the target website or server. It sees the destination IP address, but it only knows the IP address of the middle relay that forwarded the request.
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.