The nakhlite meteorites are clinopyroxenites that are derived from a ~1300 million year old sill or lava flow on Mars. Most members of the group contain veins of iddingsite whose main component is a fine-grained and hydrous Fe- and Mg-rich silicate. Siderite is present in the majority of veins, where it straddles or cross-cuts the Fe-Mg silicate. This carbonate also contains patches of ferric (oxy)hydroxide. Despite 40 years of investigation, the mineralogy and origins of the Fe-Mg silicate is poorly understood, as is the paragenesis of the iddingsite veins. Nanometer-scale analysis of Fe-Mg silicate in the Nakhla meteorite by electron and X-ray imaging and spectroscopy reveals that its principal constituents are nanoparticles of opal-A. This hydrous and amorphous phase precipitated from acidic solutions that had become supersaturated with respect to silica by dissolution of olivine. Each opal-A nanoparticle is enclosed within a ferrihydrite shell that formed by oxidation of iron that had also been liberated from the olivine. Siderite crystallized subsequently and from solutions that were alkaline and reducing, and replaced both the nanoparticles and olivine. The fluids that formed both the opal-A/ferrihydrite and the siderite were sourced from one or more reservoirs in contact with the Martian atmosphere. The last event recorded by the veins was alteration of the carbonate to a ferric (oxy)hydroxide that probably took place on Mars, although a terrestrial origin remains possible. These results support findings from orbiter- and rover-based spectroscopy that opaline silica was a common product of aqueous alteration of the Martian crust.