Been playing around with the inner workings of onion routing and I have a problem. If I wanted to send the 2nd node of a relay network an ephemeral ECC public key, it has to go through node 1, so that node 2 does not know the IP of the client. Once the shared secret is calculated, an encrypted connection from the client to node 2 that essentially proxies through node 1 can be created, so node 1 can't view the info that passes through it from the client to node 2. However, how can node 2 be sure that the ephemeral ECC key it receives from the client via node 1 is the actual key. How can the integrity be verified, to counter MITM attacks?
I dont think that signing the key with a permanent ECC key would work because then the 2nd node would have to use the clients permanent ECC public key to verify the data, and then node 2 would know what the clients IP is, as it would have to be stored together, so that the correct key can be used to verify the signature.
How can the integrity of the key exchange be verifies without using digital signatures?