Experiments on the interaction of Mg, Ca-carbonate and iron, modeling processes at the contact of oxidized subducted material and reduced mantle rocks, were performed. Found that due to the ƒO2 gradient in experiments a redox front is formed. Behind the front, under oxidizing conditions, generation of carbonate melt, enriched in Ca, occurs, which is both the crystallization medium and carbon source of diamonds with high nitrogen (1000-1500 ppm) content. Ahead of the front, under reducing conditions, diamond synthesis realizes only in Fe-C melt, and the resulting diamond is characterized by a low content of nitrogen (100-200 ppm). Thus, diamonds, which common source of carbon is carbonate, is found to be significantly different in composition of inclusions, isotope ratios of carbon and nitrogen content, and allow understanding the nature of the heterogeneity and diversity of diamonds in the Earth\'s mantle.