Psilocybin mushrooms, the “magic” fungi famous for giving users hallucinations and spiritual insight, may not actually be supernatural, but they come pretty close. A growing body of research suggests they might help treat a range of mental disorders, and there’s little evidence that they’re addictive.

But the world of magic mushrooms extends far beyond psilocybin. Though they may not have intended it, these fungal chemical factories are synthesizing chemicals that just so happen to carry beneficial properties for humans, as well.

Mushroom 101

From Agaricus bisporus (portobello) to Amanita phalloides, the aptly-named, very lethal death cap toadstool, mushrooms come in all manner of sizes, colors, and flavors. They’re part of the fungi kingdom, along with molds and yeasts. Some are microscopic; another can be considered the largest living organism on Earth. With only around 100,000 species described, out of an estimated 5.1 million, fungi make ideal candidates for bioprospecting, or extracting useful compounds for pharmaceuticals and other things from nature.

Mushrooms are actually just the above-ground portion of certain fungi. Some species grow a root-like system called a mycelium, which sprout into mushrooms when they reach the surface. They sprinkle spores, the fungal equivalent of a seed, so the cycle can begin again. It sounds suspiciously plant-like, but mushrooms are actually closer genetically to animals than to plants.

You might be most familiar with the mushrooms in your food, but the chemicals they’ve evolved to produce over time have turned out to have a wide range of uses for our bodies, as well. And when you hear “chemicals and mushrooms”, you’re probably thinking psilocybin.

There are nearly 200 species of psilocybin mushrooms, but why the fungi evolved this psychedelic chemical in the first place is still a mystery. The effects on humansare far from mysterious, though, given the decades of amateur experimentation by budding psychonauts. Visual hallucinations are common, as well as feelings of euphoria and a sense of oneness with others or the world at large. Less inviting results include disorientation, paranoia and anxiety.

Research interest in psilocybin has trended upwards in recent years, and researchers have begun to test its potential for treating things like depression and PTSD. Early results are positive, and indicate that it could likely help treat a range of mental disorders.

How, and why, the mushrooms actually make the drug is still largely unknown, though.

Two studies released this year aimed to answer this question. The first, published in Evolution Letters, says it may be used as an insecticidal defense against pests. However, a recently published study on the preprint server bioRxiv (meaning it’s not yet peer-reviewed) suggested psilocybin may be used to attract bugs, not repel them, serving as an “insect-vectored spore dispersal” i.e. spreading spores like birds scatter seeds.

To test this, scientists from the United Kingdom gathered and washed Psilocybe cyanescens, a psilocybin mushroom, that had been covered in dark-winged fungus gnats. Days later they watched as maggots emerged and grew into flies.

“It was a very simple, non-replicated experiment that showed flies can live in and emerge from these mushrooms,” says Bryn Dentinger, the study’s lead author and mycology curator at the Natural History Museum of Utah. “So I don’t think that, the insecticidal property, we can’t rule it out entirely, but it’s clearly not a black-and-white scenario.”

It’s a reminder that for all its psychedelic properties, psilocybin wasn’t made for humans. It and other chemicals derived from mushrooms are the result of evolutionary tinkering over the course of millions of years aimed at helping the fungi survive. The trippy properties of shrooms are just a side effect of an evolutionary arms race — though that doesn’t mean we can’t benefit from it.

Fungal Serotonin

Humans may be separated from fungi by millions of years, but there are still surprising similarities between us.

For example, one genus of mushrooms, Panaeolus, produces serotonin — an important neurotransmitter in our brains, thought to regulate moods like depression. Psilocybin is actually quite close chemically to serotonin, so it’s not that surprising. There’s even reason to think that the mushrooms could be using these chemicals to communicate between cells like we do.

The serotonin system is very ancient evolutionarily, Dentinger explains, and mushrooms could have receptors on their cell membranes for this neurotransmitter. But, to his knowledge, it’s never been tested.

“There’s reason to expect that it was in the common ancestor of animals and fungi,” he says. “It wouldn’t surprise me at all to find out that these molecules like psilocybin may in fact be about mediating interactions either between cells within individual fungal organisms or between fungal organisms.”

Dentinger is quick to point out that it doesn’t mean mushrooms are conscious, though. “It’s just that they may be mediating communication in a way that may be analogous to neurocommunication in our own brains,” he says.

While we’re still understanding why mushrooms produce serotonin-related chemicals, Panaeolus is far from unique.

Inocybe aeruginascens, a tobacco-colored species with greenish stains and blue bruises produces three serotonin-like chemicals. Found widely across central Europe, it contains an almost equal amount of three hallucinogenic compounds: psilocybin, baeocystin, and aeruginascin. I. aeruginascens is the only fungus known to produce aeruginascin, and there are hints it could be a better option for therapeutic use than psilocybin is.

No uncomfortable, terrifying trips have been reported with I. aeruginascensmushrooms, even in cases of accidental ingestion, according to Jochen Gartz, a German mycologist and chemist, who first discovered and named aeruginascin in the ‘80s. For more than 20 years, he’s looked for the molecule in other mushroom species. He hasn’t found it.

“I know of about 50 experiences with Inocybe aeruginascens and half are intoxications in the field where people at the beginning thought that they have mistaken an edible and common species with [an] unknown toxic mushroom,” Gartz, author of Magic Mushrooms Around the World, says in an email. But instead of freaking out about dying, Gartz says, these accidental fungus eaters usually have calm, euphoric episodes, often with “colorful mystical experiences.”

That’s why Gartz thinks this mushroom may be a better candidate for treating mental health disorders like depression, as well as for migraines and cluster headaches. Due to its chemical structure, it’s unlikely to cross the blood-brain barrier. That means it could help to moderate the effects of psilocybin, perhaps by blocking receptors elsewhere in the body, Gartz says. Damping down on psychedelic side effects is an important consideration if such compounds are ever to see therapeutic use.

But Richard Hartnell, an analyst at the cannabis testing center EVIO Labs, isn’t so sure.

“I’m skeptical of the notion that aeruginascin would significantly modulate the effects of a psilocybin trip, but it’s possible. I’d be very surprised if any controlled, blinded studies have been done of this,” Hartnell says in an email. “That research almost certainly hasn’t been done yet, and it’s likely that we won’t know the therapeutic applications of most or all of these compounds until we de-schedule psilocybin and its analogs.”

As with many mushrooms of potential pharmacological interest, the literature on I.aeruginascens is scant. This means that we still don’t know how it could potentially help us, and neither do we know what the dangers might be. That’s not true for every mushroom, though.

The Mighty Toadstool

With appearances ranging from Alice in Wonderland to Super Mario, no psychoactive fungus is as iconic as Amanita muscaria, the fly agaric mushroom. These archetypal red-and-white toadstools don’t contain a drop of psilocybin, yet they’re wildly mind-bending.

Although not as deadly as popularly believed, fly agarics contain two hallucinogenic compounds — muscimol and ibotenic acid — that are notorious for producing a delirious, dream-like trip. The shrooms can produce euphoria, and more rarely, muscle spasms, coma, and Lilliputian and Gulliverian hallucinations — feelings of shrinking or growing. (Lewis Carroll knew his stuff.)

Dentinger says that the two compounds are probably used by the mushrooms to keep bugs and other pests away — there’s a history of them being used to kill house flies, he says.

There are no known medical uses for these two drugs, but they’ve helped advance research nonetheless. For example, small injections of ibotenic acid, which is a potent neurotoxin, turn out to be a very precise means of creating brain lesions.

Removing or damaging a section of the brain helps scientists observe what might stop working, providing insights in the functions of different brain regions. This highly targeted technique has shed light on mechanisms related to visual motion processing, spatial learning, and neural pathways linked to Alzheimer’s.

Muscimol, too, has proven useful. At the behest of the pharmaceutical giant Lundbeck, renowned Danish chemist Povl Krogsgaard-Larsen began developing numerous synthetic variations of muscimol in the 1970s.

Eventually he discovered gaboxadol, originally called THIP, a less toxic version of muscimol. The varied clinical life of gaboxadol included trials as a pain reliever, a treatment for anxiety, a hypnotic sleep aid, and as a treatment for a movement disorder called tardive dyskinesia.

For multiple reasons, including strange psychiatric side effects such as disorientation, dizziness,and sedation, the drug didn’t stick, and it was never approved for medical use.

But gaboxadol isn’t done yet. In 2015, Lundbeck sold biopharma company Ovid Therapeutics the rights to gaboxadol. It’s been fast-tracked by the FDA as a treatment for two rare genetic disorders, Angelman Syndrome and Fragile X Syndrome. Krogsgaard-Larsen synthesized a few other analogs of muscimol as well, those too could prove to have therapeutic uses.

And that’s just a single species of mushroom — there are potentially millions more. Amanita muscaria just happens to have been studied a little more closely than many.

Not Just LSD

Mushrooms aren’t the only fungi that contain promising compounds. The Swiss chemist Albert Hofmann is, of course, famous for developing the psychedelic LSD from ergot, a fungi in the genus Claviceps that infects grasses like tall fescue. But Hofmann is also responsible for developing other ergot-derived drugs on the market today, including methylergometrine, used to stop bleeding after childbirth;dihydroergotamine, a migraine drug; and ergoloid mesylates, a mixture of three ergot alkaloids that is prescribed for dementia. He even found 2-Bromo-LSD, a non-intoxicating drug that could treat cluster headaches without hallucinatory side effects.

Carolyn Young, an associate professor at Noble Research Institute, has been studying ergot and related fungi for many years. She’s intrigued by the extraordinary diversityof the alkaloids these fungi produce, many of which still haven’t been studied.

Why ergot produces so many compounds may have to do with an evolutionary concept called “bet hedging,” Young says. It’s a strategy that involves producing a variety of evolutionary responses to help an organism respond to a range of situations. (The same theory could apply to psilocybin mushrooms and the many serotonin-related chemicals they produce.)

It’s resulted in a range of chemical options for researchers to examine. And in ergot, the genes that produce these alkaloids are found in clusters, which Young says may make them easier for us to genetically modify.

“That helps us understand those pathways better, to manipulate, to make gene knockouts,” Young says. “There is a whole industry behind synthetic biology and getting microorganisms to create more compounds for us.”

Ergot has a symbiotic relationship with the grasses it infects, Young says, and help them to spread their seeds around. The chemicals ergot produces likely play a role in this relationship, though what that is, we don’t know.

“The plant has some selectable advantage when that fungus is in there,” she says. “Otherwise, that fungus wouldn’t be there — nature would have crossed it out already.”

Most, if not all of these fungal molecules are constructed using L-tryptophan, an essential amino acid commonly found in mushrooms that is used to build many different proteins in our bodies, as well as neurotransmitters like serotonin and melatonin. Aside from knowing that it’s important for them, Young says we don’t have a good answer for why tryptophan shows up in mushrooms, too. But, as with other therapeutic compounds in mushrooms, the coincidence could pay off for humans

Many fungal compounds remain completely unstudied — and the fact that some are still illegal makes it even more difficult to probe their secrets. Others, like aeruginascin, muscimol, and many ergot-derived compounds are open to researchers, though. The only thing standing in the way of more research is funding. If the few we have studied is any indication, the potential payoff could be large.

“Sometimes we don’t fully appreciate that ecological bioactivity of these compounds,” Young says. “Whatever it is specifically that they may be doing, we’ve got a lot to learn about it.”