The US government funded research into breaking the online anonymity service Tor, court documents have revealed.

Carnegie Mellon University carried out the research, funded by the US Department of Defense, which attempted to reveal the identities of the users of the service.

Once the researchers reported success, some of the information, including the IP address of a user alleged to be on the staff of an online black market called Silk Road 2, was then subpoenaed by the FBI for use in an investigation into the market.

Adding a further wrinkle to the case is the fact that Tor is itself funded by the US government. The service, which works by encrypting communications and then relaying them between multiple users in its network in order to baffle outside surveillance and hide the identity of the two ends of the connection from the other, was initially developed by the US Naval Research Laboratory, and still receives money from the US Department of State and National Science Foundation.

That funding goes to ensuring the security of the service, even as the Department of Defense funds research aimed at undermining it.

The Carnegie Mellon research was first revealed in July 2014, when the two leads were due to present a paper at the Black Hat hacking conference on how to unmask the IP addresses of Tor users. But that presentation was cancelled without explanation in the weeks leading up to the conference.

At the time, many speculated that the research was related to an attack on the network that had been noticed in the run-up to its disclosure: in the first half of 2014, a large number of nodes on the Tor network were apparently trying to deanonymise users.

The Tor project warned that the relays “joined the network on 30 January 2014, and we removed them from the network on 4 July”.

It continued: “While we don’t know when they started doing the attack, users who operated or accessed hidden services from early February through 4 July should assume they were affected” – but added that it was unclear what “affected” actually entailed.

The documents released in the Silk Road 2 court case confirm that Carnegie Mellon was behind the attack, and that information gained in the attack was accessed by the FBI via subpoena. Vice’s Motherboard reports that neither the FBI nor Carnegie Mellon have explained how the FBI knew the research project even existed, in order to subpoena for the information in the first place.

Carnegie Mellon stands by a statement made in November, when it said: “Carnegie Mellon University includes the Software Engineering Institute, which is a federally funded research and development centre (FFRDC) established specifically to focus on software-related security and engineering issues.

“One of the missions of the SEI’s CERT division is to research and identify vulnerabilities in software and computing networks so that they may be corrected. In the course of its work, the university from time to time is served with subpoenas requesting information about research it has performed. The university abides by the rule of law, complies with lawfully issued subpoenas and receives no funding for its compliance.”

The information was unveiled in response to requests by the lawyers of Brian Farrell, the American accused of being a staff member on Silk Road 2. The lawyers were attempting to uncover the methods by which Farrell’s IP address was discovered.

Although judge Richard Jones partially revealed the facts of the case, he also declined to fully publish the university’s methods, and ruled that the IP address of an internet user cannot be deemed private information, even if that user is running anonymity software like Tor.

“It is the Court’s understanding that in order for a prospective user to use the Tor network they must disclose information, including their IP addresses, to unknown individuals running Tor nodes, so that their communications can be directed toward their destinations. Under such a system, an individual would necessarily be disclosing his identifying information to complete strangers,” wrote Judge Jones.

“Again, according to the parties’ submissions, such a submission is made despite the understanding communicated by the Tor Project that the Tor network has vulnerabilities and that users might not remain anonymous. Under these circumstances Tor users clearly lack a reasonable expectation of privacy in their IP addresses while using the Tor network. In other words, they are taking a significant gamble on any real expectation of privacy under these circumstances.”