Echinopsis pachanoi, or better known as the San Pedro Cactus is a the tall cactus in the mid-foreground, in its natural habitat in Peru. Echinopsis pachanoi has a long history of being used in Andean traditional medicine and rituals. Archeological studies have found evidence of use going back two thousand years, to Moche culture and others, although Roman Catholic church authorities after the Spanish conquest attempted to suppress its use, for unknown reasons, they failed, as shown by the Christian element in the common name “San Pedro cactus” Saint Peter cactus. The name is attributed to the belief that just as St Peter holds the keys to heaven, the effects of the cactus allow us “to reach heaven while we still on earth.”
The San Pedro cactus contains a number of alkaloids , including the well-studied chemical mescaline (0.21–1.8%), and also 3,4-dimethoxyphenethylamine , 4-hydroxy-3-methoxyphenethylamine , 3-hydroxy-4,5-dimethoxyphenethylamine , 4-hydroxy-3,5-dimethoxyphenethylamine , anhalonidine, anhalinine, hordenine, tyramine , and 3-methoxytyramine .
Is a psychedelic drug and entheogen, which is also found in some other species of genus Echinopsis (i.e. Echinopsis lageniformis , Echinopsis peruviana , and Echinopsis scopulicola) and the species Lophophora williamsii ( peyote ).
Anecdotal evidence suggests that the highest concentration of active substances is found in the layer of green photosynthetic tissue just beneath the skin.
There are various mescaline extraction techniques, simple (simmering in water 5 to 7 hours) and complex (such as an acid-base extraction ), the latter technique yielding a material with a significantly higher concentration of mescaline.
Mescaline, or 3,4,5-trimethoxyphenethylamine, is a substituted phenethylamine featuring a phenyl ring bound to an amino -NH 2 group through an ethyl chain. Mescaline contains three methoxy functional groups CH3 O- which are attached to carbons R 3 , R 4, and R 5 of the phenyl ring.
3,4- Dimethoxyphenethylamine ( DMPEA)
Is a chemical compound of the phenethylamine class. It is an analogue of the major human neurotransmitter dopamine where the 3- and 4-position hydroxy groups have been replaced with methoxy groups. It is also closely related to mescaline which is 3,4,5-trimethoxyphenethylamine.
One of the earliest syntheses of DMPEA (then referred to as “homoveratrylamine”) was that of Pictet and Finkelstein, who made it in a multi-step sequence starting from vanillin .  A similar sequence was subsequently reported by Buck and Perkin,  as follows:
3,4-Dimethoxybenzaldehyde (veratraldehyde) → 3,4-Dimethoxycinnamic acid → 3,4-Dimethoxyphenylpropionic acid → 3,4-Dimethoxyphenylpropionamide → 3,4-Dimethoxyphenethylamine