Here is how to convert mda into mdma
SYNTHESIS: (from MDA) A solution of 6.55 g of 3,4-methylenedioxyamphetamine (MDA) as the free base and 2.8 mL formic acid in 150 mL benzene was held at reflux under a Dean Stark trap until no further H2O was generated (about 20 h was sufficient, and 1.4 mL H2O was collected). Removal of the solvent gave an 8.8 g of an amber oil which was dissolved in 100 mL CH2Cl2, washed first with dilute HCl, then with dilute NaOH, and finally once again with dilute acid. The solvent was removed under vacuum giving 7.7 g of an amber oil that, on standing, formed crystals of N-formyl-3,4-methylenedioxyamphetamine. An alternate process for the synthesis of this amide involved holding at reflux for 16 h a solution of 10 g of MDA as the free base in 20 mL fresh ethyl formate. Removal of the volatiles yielded an oil that set up to white crystals, weighing 7.8 g.
A solution of 7.7 g N-formyl-3,4-methylenedioxyamphetamine in 25 mL anhydrous THF was added dropwise to a well stirred and refluxing solution of 7.4 g LAH in 600 mL anhydrous THF under an inert atmosphere. The reaction mixture was held at reflux for 4 days. After being brought to room temperature, the excess hydride was destroyed with 7.4 mL H2O in an equal volume of THF, followed by 7.4 mL of 15% NaOH and then another 22 mL H2O. The solids were removed by filtration, and the filter cake washed with additional THF. The combined filtrate and washes were stripped of solvent under vacuum, and the residue dissolved in 200 mL CH2Cl2. This solution was extracted with 3x100 mL dilute HCl, and these extracts pooled and made basic with 25% NaOH. Extraction with 3x75 mL CH2Cl2 removed the product, and the pooled extracts were stripped of solvent under vacuum. There was obtained 6.5 g of a nearly white residue which was distilled at 100-110 ° C at 0.4 mm/Hg to give 5.0 g of a colorless oil. This was dissolved in 25 mL IPA, neutralized with concentrated HCl, followed by the addition of sufficient anhydrous Et2O to produce a lasting turbidity. On continued stirring, there was the deposition of fine white crystals of 3,4-methylenedioxy-N-methylamphetamine hydrochloride (MDMA) which were removed by filtration, washed with Et2O, and air dried, giving a final weight of 4.8 g.