News in this year's Global Drugs Survey that internet drug dealing was on the rise will have alarmed, surprised or intrigued many people. But the very first thing bought and sold on the net was a bag of marijuana – over 40 years ago.

In John Markoff 's 2005 book What the Dormouse Said: How the Sixties Counterculture Shaped the Personal Computer Industry (even the book's title is from a hoary old Jefferson Airplane track) he reveals that the world's first online transaction was a drug deal:

In 1971 or 1972, Stanford students using Arpanet accounts at Stanford University's Artificial Intelligence Laboratory engaged in a commercial transaction with their counterparts at Massachussetts Institute of Technology. Before Amazon, before eBay, the seminal act of e-commerce was a drug deal. The students used the network to quietly arrange the sale of an undetermined amount of marijuana.

Since then it has been, as the Grateful Dead might put it, a long strange trip, and drug users have, with the help of chemistry and neuropharmacology and telecommunications, stayed several steps ahead of the law.

Through the 70s, 80s and 90s, all manner of drugs, both legal and illegal have been sold online. In 2013, some people are asking: why even break the law when you could just commission a Chinese lab to synthesise a synthetic marijuana substance (technically, a cannabinoid receptor agonist) that's shown in laboratory conditions to have some of the same effects as marijuana? The law has struggled to keep up.

That question is also being asked by unscrupulous dealers, who are happy to import and sell these untested, rare compounds of unknown purity, dissolve them in acetone and spray them on an inert herbal carrier material which they sell online to anyone with a credit card. They have little regard for the consumers of these untested drugs, which were never even designed to be drugs in the first place. They can lead to sickness, high blood pressure, and even kidney damage.

Last year researchers found 73 new drugs on the market, sold by almost 700 websites in Europe. But what are they? Most people over the age of 30 will remember when the drug menu was limited to marijuana, LSD, amphetamines, cocaine and heroin. Today, the pharmacopeia is bafflingly novel and in many cases legal.

By simply examining drug laws, it is child's play, one clandestine chemist told me, to work around those strictures and create a legal drug: one that is chemically similar to a banned substance but is not itself proscribed. Even easier is to examine published medical research papers for anything showing increased locomotor activity, or activity at the serotonin or dopamine receptors, since they will be likely to work, in some way or other, as drugs.

And if they've only been tested on rats, who cares? Young people are queuing up to be guinea pigs.

Of the 73 new chemicals that were discovered last year 50 were cannabinoid receptor agonists, often developed for use in legitimate pharmaceutical research known as "structure-activity relationship" tests. The endogenous cannabinoid system has profound effects on mood, appetite, blood pressure and many more essential functions. Firms such as Stirling Winthrop and the labs of John William Huffman at Clemson University in the US produced hundreds of these drugs in their legitimate search for non-steroidal anti-inflammatories. But they escaped into the grey markets in 2008 and a moral panic began – guaranteeing their increased use.

The first batch of legislation banning new cannabinoid receptor agonists came in 2010, when the mephedrone (also known as M-cat or meow meow) craze was in full flow. About 170 were banned in technically complex legislation, outlawing entire chemical families and ring substitutions. Even the most recent legislation in February failed to prevent innovation. In fact, it fostered it. No sooner was one batch banned than dozens more were on sale – the very same day.

Today, the number of new drugs available is accelerating at such a rate that police and toxicologists can't even identify what they are, because they have no reference samples available to compare them with. And all across the net, there are millions of drug deals taking place.

As William Gibson said: "The future is already here – it's just not very evenly distributed."

Mike Power is the author of Drugs 2.0: The Web Revolution That's Changing How the World Gets High, published on 2 May by Portobello