The NSA isn't the only three-letter agency that's been quietly collecting Americans' data on a mind-boggling scale. The country learned this week that the Drug Enforcement Agency spied on all of us first, and with even fewer privacy protections by some measures. But if anyone is surprised that the DEA’s mass surveillance programs have been just as aggressive as the NSA’s, they shouldn’t be. The early targets that signal shifts in America's domestic surveillance techniques aren't activists and political dissidents, as some privacy advocates argue—or terrorists, as national security hawks would claim. They're drug dealers.

The DEA’s newly revealed bulk collection of billions of American phone records on calls to 116 countries preceded the NSA's similar program by years and may have even helped to inspire it, as reported in USA Today's story Wednesday. And the program serves as a reminder that most of the legal battles between government surveillance efforts and the Fourth Amendment’s privacy protections over the last decades have played out first on the front lines of America's War on Drugs. Every surveillance test case in recent history, from beepers to cell phones to GPS tracking to drones—and now the feds’ attempts to puncture the bubble of cryptographic anonymity around Dark Web sites like the Silk Road—began with a narcotics investigation.

"If you asked me last week who was doing this [kind of mass surveillance] other than the NSA, the DEA would be my first guess," says Chris Soghoian, the lead technologist with the American Civil Liberties Union. "The War on Drugs and the surveillance state are joined at the hip."

In 2013, a staggering 88 percent of Department of Justice's reported wiretap warrants were for narcotics.

It's no secret that drug cases overwhelmingly dominate American law enforcement's use of surveillance techniques. The Department of Justice annually reports to the judiciary how many wiretaps it seeks warrants for, broken down by the type of crime being investigated. In 2013, the last such report, a staggering 88 percent of the 3,576 reported wiretaps were for narcotics. That's compared to just 132 wiretaps for homicide and assault combined, for instance, and a mere eight for corruption cases.

A chart of reported wiretaps for various crimes in 2013, showing that drugs investigations dwarfed all others. A chart of reported law enforcement wiretaps from 2013, showing that wiretaps for suspected narcotics trafficking dwarfed all other crimes.

One reason drug cases dwarf other crimes in terms of law enforcement's surveillance, Soghoian says, is that narcotics sales require long-term conspiring within criminal organizations. That provides plenty of internal communications to tap compared to a one-off murder or robbery.

But Soghoian also argues that the use of surveillance to bust drug dealers feeds on itself. Cops or DEA agents who take down a narcotics trafficking group often seize millions of dollars in assets. "When agencies bust a drug dealer and get $5 million and a kilo of coke, they keep the money," Soghoian says. "Surveillance is expensive...In many ways, the drug cases subsidize the surveillance technology used by law enforcement."

The DEA likely isn't pushing the technological limits of surveillance, but it does push the legal limits of that spying.

That gives drug investigators both the mandate and the incentives to constantly advance their surveillance techniques. To be clear, the DEA and local drug-fighting cops likely aren't pushing the technological limits of surveillance as much as the NSA, intercepting router shipments to plant bugs, or secretly rewriting the hard drive firmware of their spying targets. But drug-related surveillance, which is far more domestic in its focus, does push the legal limits of that spying. Again and again, says Electronic Frontier Foundation defense attorney Hanni Fakhoury, it's drug investigations that cross into the realm of unconstitutional search and seizure, and it's these cases that result in the judicial system setting new legal precedents for Americans' privacy protections—both for the better and for the worse. "If you go back and look at just about every major Fourth Amendment case in the last 30 years, it’s been a drug case," says Fakhoury.

Here are just a few of the cases Fakhoury cites from those 30 years of drug investigation precedents:

US vs. Knotts, 1983: Minnesota cops planted a beeper in a five-gallon can of chloroform—one of the ingredients they believed their suspects intended to use to make methamphetamine—and tracked the device to a secret drug laboratory. The Supreme Court ruled that form of tracking constitutional, so long as it was equivalent to visually tracking a car through the streets. But in a similar case in 1984, United States vs. Karo, found that using a beeper for more extensive tracking violated the fourth amendment.

US vs. Ciraolo, 1986: Cops used a private plane to spy on a marijuana growing operation in the suspect's backyard. The Supreme Court ruled that the defendant had no expectation of privacy from aerial observation, a precedent that's used today to justify warrantless drone surveillance.

US vs. Kyllo, 2001: Agents from the US Department of Interior used thermal imaging cameras to see heat lamps inside a marijuana grower's home without a warrant. The Supreme Court ruled that the technique constituted an unconstitutional search.

US vs. Jones, 2012: FBI agents used a GPS device attached to the underside of a suspected cocaine dealer's car to track him. Though they had a warrant, the tracking exceeded that warrant's time limits. The Supreme Court ruled that the warrantless period of tracking constituted an illegal search.

US vs. Wurie, 2014: Police watched a suspected drug dealer make a sale, arrested him, and seized his cell phone. On the phone they used his contact list to find his home address, and discovered crack-cocaine and marijuana there. The Supreme Court ruled in Wurie's case and in a simultaneous murder case that police can't search a phone taken from a suspect at the time of arrest without a warrant.

The DEA's bulk collection of Americans' phone metadata fits squarely into a long history of drug investigators using and abusing their surveillance powers.

Today the same question of where to draw the line against illegal searches has moved to the Dark Web, the collection of sites that use anonymity tools like Tor, I2P, and bitcoin to flummox spies and law enforcement. So far, the investigations that took down bustling Dark Web drug markets like the Silk Road and the Silk Road 2 have just as thoroughly probed the edges of what constitutes a legal search online.

In the investigation of the original Silk Road, the FBI cracked the case when it somehow identified the site's server in Iceland despite its use of Tor to hide its location. The FBI has never fully explained how it pulled off that trick, merely telling a judge that an agent entered "miscellaneous characters" into a field on the site's homepage until it revealed its IP address. When asked for more information, prosecutors cagily switched their argument to claim that it doesn't matter how it identified the Silk Road server since it was in a foreign country. (Never mind that the server contained the information of plenty of Americans.) They also argued that its owner, Ross Ulbricht, never claimed privacy rights to the machine, a tricky Catch-22 given that doing so would have incriminated him. The judge agreed, throwing out any arguments about Fourth Amendment violations.

In the case of the reborn Silk Road 2 drug market that launched a month after the first site's bust, a combined team of FBI and Europol investigators somehow cut through the anonymity protections of the site, along with dozens of other Tor hidden services, in November of last year. None of those cases have gone to trial, and it's still a mystery how, or even if, the feds broke Tor. Many suspect that they used a Tor vulnerability that was scheduled to be presented by Carnegie Mellon researchers at the Black Hat security conference last summer, but was later pulled from the conference.

With all those cases in mind, the DEA's now-defunct bulk collection of Americans' phone metadata fits squarely into a long and storied history of drug investigators using and abusing their surveillance powers. That doesn't make privacy advocates like it any better. The Electronic Frontier Foundation and Human Rights Watch filed a lawsuit earlier this week to make sure that the program is completely terminated rather than merely hidden or suspended, considering the 20-year secrecy around the DEA's phone metadata collection.

But given that the DEA's phone surveillance program stretched back to 1992 with no public oversight, there's little doubt that drug investigators have since adopted plenty of other stealthy surveillance techniques to stay a step ahead in the War on Drugs. As in any war without an end, there's always a budget for new weapons, and plenty of foot soldiers ready to use them.