I can get the current with this stem code.

from stem import CircStatus
from stem.control import Controller

with Controller.from_port(port = 9051) as controller:

    for circ in sorted(controller.get_circuits()):
        if circ.status != CircStatus.BUILT:
    print("Circuit %s" % (circ.id))

How would you list all tor circuits that have ever been established from the moment that tor has been started?

To make things clear, instead of listing the current circuit only (say number 7) I want to list all c

  • Tor doesn't keep that data.
    – cacahuatl
    Jan 10, 2017 at 17:33
  • Also, that python code is wrong, the print statement is happening outside of the for loop.
    – cacahuatl
    Jan 10, 2017 at 17:55
  • Millions of users use Tor and directory authority servers get requests for sending the list of active relays , the client chooses 3 relays and makes the overlay circuit. Circuits are renewed but since a few years , the guard node remains the same. If , at a given time , a consensus is studied and there are N total relays , the total possible circuits becomes " [1 * (N-1)C1 * (N-2)C1] * total number of clients ".
    – Mithrandir
    Apr 15, 2017 at 12:30

1 Answer 1


There's no log for this kind of information - and for a good reason: it can hurt the privacy and anonymity of Tor. You can - technically - poll Tor regulary through Stem and keep the log for yourself, but anyway - it's a bad idea IMHO.

Can you please put some more details about what do you need it for? Maybe this task can be solved in another way?

  • It's not possible to create such a log, if I understand tor correctly. A particular circuit cannot be known by a node not in the circuit. But IF each client were reporting its circuits to some logging host, it would be a heck of a long list. Approximately XYZ where X=number of entry nodes, Y=relay nodes; Z=exit nodes.
    – WGroleau
    Jan 11, 2017 at 23:08
  • Correct. My understanding of this question is that it's a task to log all the circuits made by this very particular local tor node. Of course, the task of knowing other circuits is unimplementable - that fact would render Tor totally useless if it will be possible
    – Alexey Vesnin
    Jan 11, 2017 at 23:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .