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?