Why do magic mushrooms turn blue when they are cut? Chemists have now unravelled this decade-old mystery, in the process revealing that the dark blue pigments at the centre of the mystery are similar to indigo, the dye used to produce blue jeans.

Magic mushrooms or Psilocybe are fungi producing the psychotropic compounds psilocybin and psilocin. They are one of several species that instantly develop a blue coloration when they are cut or bruised. In Boletales mushrooms, oxidised gyrocyanin or pulvinic acid are the source of the blue colour. But that isn’t the case in Psilocybe mushrooms.

Previous research had established that the blue colour was caused by oxidised psilocybin, but the nature of the pigment and the biochemical pathway producing it had remained elusive.

Dirk Hoffmeister from the Leibniz Institute for Natural Product Research and Infection Biology, Germany and his team had been working with Psilocybe cubensis for several years. Growing the mushrooms in their lab, they had seen the mysterious blueing reaction countless times. ‘We were just curious and tried to solve a phenomenon that’s been known for decades,’ Hoffmeister says.

But when they tried to extract and purify the blue compound, they failed. ‘It puzzled and challenged us,’ says Hoffmeister. ‘This is where previous researchers – very talented people – had to give up, and that’s where we went one step further with unconventional analytical methods.’

The researchers dug deep into the analytical toolbox with liquid chromatography–mass spectrometry, Maldi mass spectrometry, infrared spectroscopy, as well as time-resolved nuclear magnetic resonance spectroscopy to observe the compounds as they form.

The pigment, as it turns out, is not just a single compound but a complex mixture of linked psilocybin oxidation products. Most of them are quinoid psilocyl oligomers – compounds not unlike indigo, a deep blue pigment used to dye jeans. ‘[The blue compounds and indigo] share structural similarities in the indole core, and in both the basis for the colour is a quinoid,’ says the study’s lead author Claudius Lenz.

All of the six mushroom pigments the team identified are products of a cascade reaction starting with psilocybin. A phosphatase enzyme takes off its phosphate group, converting it into psilocin. An oxidising laccase then creates psilocyl radicals, which combine to form C-5 coupled subunits and then further polymerise via C-7. ‘I think they did a beautiful job of showing the cascade reaction,’ says Jaclyn Winter, who studies natural product biosynthesis in bacteria and fungi at the University of Utah, US.

What exactly the blue pigments do, however, remains a mystery. ‘Our hypothesis – and we don’t have any evidence for this yet – is that it might serve a protective role, like an on-demand repellent against predators,’ says Hoffmeister. The compounds might produce reactive oxygen species, which are toxic to any insect nibbling on the mushrooms. ‘I think we’re going to see a lot of follow-up studies on the true ecological role of these molecules,’ Winter says.

Hoffmeister hopes that his study not only inspires others to study fungi from a chemistry perspective but also changes people’s mind about psilocybin. ‘Psilocybin is looked at as this illegal, recreational drug, but it has a fantastic potential as a medication for therapy resistant depression,’ he says.

Winter agrees. ‘There’s quite a few groups who are studying psilocybin, and especially because it’s been legalised in the US in various states, and because it’s in clinical trials,’ she says. ‘I think [this study] is going to have a huge impact in the field.’