Thanks to a recent revival in research on psychedelics, it's become increasingly clear psilocybin, the active ingredient in magic mushrooms, is good for far more than tripping face. Research suggests even one dose can have profound effects on self-perception and personality. Alongside therapy, this perspective shift can help people deal with particularly severe addiction, anxiety, depression, or trauma. Other psychedelics may offer similar benefits, but research into psilocybin is among the furthest along.

This year may witness the start of phase three trials, the penultimate stage before the Food and Drug Administration approves a substance as a prescription drug, on its (high) potential to alleviate anxiety and depression in terminally ill cancer patients. That puts its potential date for normalization and legal accessibility just behind MDMA, which the FDA designated a potential breakthrough therapy for post-traumatic stress disorder this month.

There's just one hitch to the potentially glorious future of psilocybin-assisted therapies: Unlike other substances, like LSD or MDMA, we've never had a way to safely, cost-effectively mass-produce it. This limitation could—if psilocybin is ever approved as a prescription drug—make it too costly to be practically accessible to most, or even functionally keep it off the shelves.

However recent research could address this issue. In a paper published last week in the German academic journal Angewandte Chemie, scientists at Friedrich Schiller University announced that they'd finally figured out how psilocybin is created in magic mushrooms. Furthermore, they figured out how to easily replicate the simple process sans mushrooms. "Our results," they wrote, "may lay the foundation for [psilocybin's] biotechnological production."

If it seems weird that we've just now figured out how psilocybin is created in nature, well, it is. First identified in 1958 by Albert Hoffman, the chemist and psychedelic pioneer who introduced the world to LSD, scientists were already taking stabs at figuring out how mushrooms produced the substance in the 1960s. By 1968, a paper finally suggested a natural synthesis process, but it was long just speculative. A lack of research resources or attention may have played into the nearly half-century wait before this definitive breakthrough, which proved that old theory was dead wrong.

More from Tonic:

In those intervening decades, researchers found other ways of creating psilocybin from chemical scratch in the lab. This is what has enabled research on the substance's therapeutic potential, as it allows for the sort of quality and dosage control that magic mushrooms, which vary in potency and can be difficult to farm or genetically tinker with, cannot deliver. But as Purdue University's David Nichols, who helped develop modern from-scratch synthesis methods, says, "if psilocybin proves to have the expected antidepressant effect in humans [that trials suggest], de novo synthesis," his term for building the compound artificially and from scratch, "might not be an economical way to address the needs of millions of depressed patients."

The abovementioned limitations on the cultivation, manipulation, and quality control of magic mushrooms mean they could not be used to reliably mass source and supply patients either.

Recently, though, the team in Germany managed to firmly identify the four enzymes that together create psilocybin in magic mushrooms—starting with the (widely misunderstood) amino acid L-tryptophan. They chopped the genes that generated these enzymes out of the mushrooms, spliced them into E. coli bacteria, and studied the isolated enzymes to figure out how they acted, and how they fit together into a cohesive process. By so doing, they were also able to use their bacteria to take gobs of a type of tryptophan and bio-synthesize pure, reliable psilocybin.

As Nichols points out, it's too early to say for sure whether this process will work for mass production. The researchers will need to figure out the optimal conditions for their bacterial factory to work, and to isolate psilocybin from any byproducts. That will take time and money, and even then they'll need to evaluate the cost effectiveness of their yields. "I would have to see the comparison calculations for de novo synthesis versus [this process's] costs," says Nichols.

However, Nichols thinks it's entirely possibly the team will optimize their process and that it will be economically viable for mass production. "Many antibiotics are made that way on a large scale," he says. So long as it is functional, the process will almost certainly be more viable for drug production than de novo synthesis as well, considering that "the costs of the ingredients for the [process] would be relatively modest compared to the costs of the chemicals used to make synthetic psilocybin."

This innovation probably won't have an effect on the pace or quality of psilocybin research, for which the cost and quantity of synthetic stuff already available is sufficient. Nor will it tip the FDA in deciding whether or not psilocybin, on the strength of that research, should become a prescription drug, legal and available to the masses. But if they do—several years down the line, enough time for the German research team to refine their process—it could make a world of difference in how easy it is to bring this promising treatment to the masses, reliably and affordably.