Made famous through Silk Road, the deep web or dark net can function as a virtual black market, delivering all kinds of illegal contraband to your front door—if you can access it, that is. Gaining entry through TOR or similar P2P networks, anonymous users buy and sell everything from child pornography to passports to an almost endless variety of illegal drugs. For the industrious, it can be a veritable Amazon.com of narcotics. But how are quality-conscious buyers to learn what their dark net drugs have been cut with? Anonymous transactions aren’t really known for their accountability. That’s where Dr. X comes in.

Dr. Fernando Caudevilla practices family medicine in Madrid’s upscale Barrio de las Letras neighborhood. Yet with his close-cropped hair, single gold hoop earring and pseudo-military fatigues, he looks more like an Ibiza DJ than a general practitioner. Caudevilla’s renegade demeanor transfers over to his out-of-office activities, where he moonlights as “Dr. X,” testing the purity of illicit drugs that users on encrypted deep web browsers send him. Vocativ monitors the sale of illegal drugs on Tor, a dark net eBay of sorts. In a sea of anonymous avatars, we came across Dr. X, one of the few participants willing to show their face.

After reaching out to him, we decided to visit his lab in Madrid and watch him in action.

“This is speed, this is cocaine, this is MDMA, this is ketamine,” he says in a thick Spanish accent, showing us an assortment of tiny baggies containing white powders.

In his lab, Dr. X uses layer-chromatography and gas-chromatography devices to test drug samples. It allows him to identify the adulterants and measure the purity of a substance in percentages. “We just try to give objective, scientific information to people so they can make their own decisions with liberty and responsibility,” Dr. X says.

As a proponent for responsible drug use, Dr. X is also a member of Energy Control—a volunteer group that does on-the-spot drug testing at places like raves, parties and festivals. “We do colorimetric tests—very easy to do,” says Dr. X. “They tell you if within a sample there is or there is not a drug.” We headed to a local rave and witnessed Energy Control perform an on-site purity test for MDMA. Almost instantly, the results showed that the raver’s supply did not contain a single trace of MDMA, amphetamine or 2CB (a newcomer to the party scene and hallucinogenic relative of ecstasy).

In Spain, the private consumption of drugs is legal, providing a lawful loophole for drug testing. Speaking globally, Dr. X says, “If people had access to reliable information and to scientific information, maybe there would not be so many problems. Human drug use is like any other activity [that] involves risk and pleasure.”

But when asked if he himself did drugs, Dr. X smirked, morphed back into Caudevilla and declined to comment on his personal life.