Based on radiometric dating analyses of moon rocks and meteorites, the Earth is believed to be about 4.5 billion years old. Many scientists believe that the Earth originated as a cold, undifferentiated body that internally heated up from the energy released through giant impacts, radioactive isotope decay, and the mass of the Earth itself. Once the appropriate melting temperatures were reached, heavy metallic elements sank to the planet's center of gravity, as lighter elements were displaced upward toward the surface. This process may have taken place in as little as 50 million years. It is fairly certain that the present core-mantle-crust structure was in place by 4 billion years ago.
Earth's core consists of both solid and liquid metal, presumably of nickel-iron composition. The outer, liquid metallic core revolves around the inner, solid metallic core and, in the process, generates an electric current. This electric current is responsible for the Earth's magnetic field. Sandwiched between