Early chemical history of the solar system