Clever Chinese manufacturer with links to NZ just one of the chemical masterminds outwitting authorities.
When a worldwide shortage of MDMA disrupted the manufacture of Ecstasy, party goers didn't have to wait long for their fix.
Chemists simply experimented to create a substitute called mephedrone, a chemical similar in structure to methcathinone (an illegal drug that itself is similar to methamphetamine).
The recipe for the legal drug was posted on the internet and mephedrone, later called Meow Meow, became the new Ecstasy in the UK and Europe.
Eventually, the drug was banned. So scientists created another new drug. And another.
The chemists were using analogues, the chemical term for a molecular compound which may differ only fractionally from its parent but is technically regarded as a new substance.
As soon as one analogue is identified and outlawed, the manufacturers tweak the design to stay one step ahead of the lawmakers.
As the synthetic drugs trade has exploded worldwide, the number of new psychoactive substances identified by the European Monitoring Centre for Drugs and Drug Addiction has rocketed from 13 in 2008 to 57 last year - more than one new drug each week. Ten years ago, there were none.
The annual European Union drugs report says the boom has been driven by online retailers, and most of the psychoactive substances sold as legal highs are made in China.
Inquiries by the Herald have found one manufacturer in China, CEC Chemicals, has been linked with the arrest of 10 people in New Zealand.
The company was one of the biggest exporters of mephedrone to Britain until it was outlawed there, and its website still has a long list of designer drug compounds which can be ordered online.
Many are explicitly listed as legal alternatives to Class A drugs such as methamphetamine and cocaine.
Chief executive Eric Chang did not respond to Herald messages. But in emails to British journalists who posed as potential buyers in 2010, he promised to supply "new legal stuff for the UK".
"It falls outside all laws currently regarding research chemicals ... sorry, we cannot disclose the ingredient now. This is our technical know-how," the Daily Mail quoted Mr Chang as saying.
"It can't possibly be banned yet because it was only invented a few months ago."
Mr Chang is described as a rich young man who wears designer clothes, drives an expensive SUV and lives in a luxury villa.
He has been named in court hearings in New Zealand, in which police have said a covert inquiry uncovered evidence of a group importing powders to be pressed into hundreds of thousands of pills.
Millions of dollars in cash was shifted overseas.
Drugs that were identified include compounds the police say are "substantially similar" to Ecstasy and can therefore be classified as analogues and Class C controlled substances.
However, defence lawyer Ron Mansfield, who is representing several of those accused of involvement in the syndicate, has told the court that the legal definition of an analogue is unclear.
He said none of the drugs found was specifically listed under the Misuse of Drugs Act and the police charges will be defended.
"There is no [legal] authority as to what is and isn't an analogue," said Mr Mansfield. "This case will turn on whether the substances are, in fact, analogues and could therefore be defined as a Class C controlled drug."
He said one of his clients even sought chemical and legal advice before embarking on his "legal high" enterprise.
Once overseas experts were engaged and the methods of the Institute of Environmental Science and Research (ESR) analysed, Mr Mansfield said, the error would become apparent - a defence which he has made no secret of to the police.
The case has been described by one judge as the "battleground for the legal high industry".
But even if the defence is successful, the victory will be short-lived, following the introduction of the Psychoactive Substances Bill.
From August, all psychoactive substances will be banned unless approved after costly and lengthy testing involving human clinical trials under a strict new regime. The application fee will cost about $180,000 and testing up to $2 million.
The Ministry of Health regulators will look at toxicity, adverse effects and mental health effects before any new products are approved.
Under the new controls, legal high manufacturers will have to prove their products are safe, and failure to do so could result in manufacturers being jailed for up to eight years.
In effect, the legislation will create the world's first legal synthetic drugs market.
British journalist Mike Power predicts this strict regulation is likely to seize control of the uncontrolled "research chemicals" market from the Chinese laboratories and profit-driven entrepreneurs.
"A proactive and evidence-based harm reduction model such as this should, at a stroke, reduce the number of new drugs coming on the market in New Zealand," Power wrote in his new book Drugs 2.0: The web revolution that's changing how the world gets high.
"It depoliticises the debate and delivers responsibility for regulating the trade to those best qualified to assess the undoubted harms some drugs can do: expert scientists and experienced doctors."
NZ drug experts and legal high industry figures are divided over whether the law change will create a genuine market for legalised drugs.
Some believe that no current synthetic drug manufacturers will have the money or expertise to pass the safety tests, which will be based on those used for medical drugs.
Alcohol and tobacco companies the Herald spoke to said they had no interest in entering the market.
China the source of most synthetics
A real danger is the consumers of these evolving substances who ... could be taking untested and possibly deadly products being sold as Ecstasy.
Mark Day, Customs investigations manager China is where most of the drug analogues or synthetic cannabis seized by Customs comes from.
More than 200 packages have been intercepted through mail or freight since February, or up to 15 each week, according to investigations manager Mark Day.
"The drugs can be difficult to detect in white powder form and testing shows their structures are continually changing.
"A real danger is the consumers of these evolving substances who, either knowingly or unknowingly, could be taking untested and possibly deadly products being sold as Ecstasy."
This means they may not be classified or listed under the Temporary Class Drug Notice and must be released eventually as they are legal - until the Psychoactive Substances Bill becomes law later in the year.
The Herald understands that one package intercepted by Customs was 6kg of 4-MEC which originated from "research chemical" company CEC Ltd in China.
Customs confirmed to the Herald that China is the source of most of the powders but would not comment on CEC Ltd.
"Customs is not able to provide this information," a spokeswoman said.
Other packages were listed as coming from Hong Kong, Singapore, Britain, Spain, Germany, the Netherlands, the United States and Hungary.
However, this indicated the country of export - not necessarily the country of origin.
Customs also released a list of the seized substances, many of which are advertised on the CEC Ltd website.
There were 10 types of synthetic cannabis and 12 types of drug analogues.