  The origin of water on the Earth is a long-standing mystery, requiring a
comprehensive search for hydrous compounds, stable at conditions of the deep
Earth and made of Earth-abundant elements. Previous studies usually focused on
the current range of pressure-temperature conditions in the Earth's mantle and
ignored a possible difference in the past, such as the stage of the core-mantle
separation. Here, using ab initio evolutionary structure prediction, we find
that only two magnesium hydrosilicate phases are stable at megabar pressures,
$\alpha$-Mg$_2$SiO$_5$H$_2$ and $\beta$-Mg$_2$SiO$_5$H$_2$, stable at 262-338
GPa and >338 GPa,respectively (all these pressures now lie within the Earth's
iron core). Both are superionic conductors with quasi-one-dimensional proton
diffusion at relevant conditions. In the first 30 million years of Earth's
history, before the Earth's core was formed, these must have existed in the
Earth, hosting much of Earth's water. As dense iron alloys segregated to form
the Earth's core, Mg$_2$SiO$_5$H$_2$ phases decomposed and released water.
Thus, now-extinct Mg$_2$SiO$_5$H$_2$ phases have likely contributed in a major
way to the evolution of our planet.
