Earth
is estimated to have formed 4.54 billion years ago from the solar nebula, along with the Sun and other planets.[11] The moon formed roughly 20 million years later. Initially molten, the outer layer of the Earth cooled, resulting in the solid crust. Outgassing and volcanic activity produced the primordial atmosphere. Condensingwater vapor, most or all of which came from ice delivered by comets, produced the oceans and other water sources.[12] The highly energetic chemistry is believed to have produced a self-replicating molecule around 4 billion years ago.[13