The origin and chemical composition of the earth's core