Upon injury, psychotropic psilocybin-producing mushrooms instantly develop an intense blue color, the chemical basis and mode of formation of which has remained elusive.We report two enzymes from Psilocybe cubensis that carry out a two-step cascade to prepare psilocybin for oxidative oligomerization that leads to blue products.The phosphatase PsiP removes the 4-O-phosphate group to yield psilocin, while PsiL oxidizes its 4-hydroxygroup.The PsiL reaction was monitored by in situ 13CNMR spectroscopy, which indicated that oxidative coupling of psilocyl residues occurs primarily via C-5. MS and IR spectroscopy indicated the formation of a heterogeneous mixture of preferentially psilocyl 3- to 13-isomers and suggest multiple oligomerization routes, depending on oxidative power and substrate concentration. The results also imply that phosphate ester of psilocybin serves a reversible protective function.