Resources. This answer explains well what happens at
NEWNYM request, and I also dig into the code, yet my lack of knowledge on low level networking prevents me to make a proper design decision if stream isolation is enough for me or not.
Stream Isolation. By stream isolation I mean creating new TCP connection with uname/pwd authentication to Tor's Socks5 proxy to a remote hidden service.
Context. I am working a Bitcoin privacy technology that depends on a user to have two separate identity to the server (Alice and Bob). So the server must not be able to figure out there is a connection between Alice and Bob.
Right now, whenever a change happens between Alice and Bob I send a
NEWNYMsignal to Tor, dispose all connections and build new one. This of course slow, because Tor rate limits
NEWNYMrequests for a few seconds and the existing connections are disposed, then new ones are built.
I could create a two connections with isolated streams for Alice and Bob and conduct the communication there. This would be super fast, but I am not sure if it's sufficient.
Or I could use some hybrid model, where I create two stream isolated connections for Alice and Bob, just like in point 2, however whenever an identity change happens I send a
CLEARDNSCACHE? signal to Tor and don't dispose the existing connections. I'm not sure this makes sense though.
Question. Can the server somehow learn the connection between Alice and Bob in 1. 2. and 3. alternative?
NEWNYMthen you're doing something wrong in your approach to solving the problem.
NEWNYMrate limiting means I'm doing something right:) If you take a look at this video, there is a
NEWNYMfrom ConnectionConfirmation to OutputRegistration, then another one at OutputRegistration to Signing. This Signing phase takes longer, because of rate limiting. But when multiple rounds are being conducted, which is always the case, the OutputRegistration phase will slow down from rate limiting, too to the slowest user. Stream isolation can achieve about 50% speed increase. youtube.com/watch?v=wjDUJeo4Nu8&t=495s