Elon Musk's space company SpaceX has secured a $2.9 billion (roughly Rs. 21,616 crores) contract from NASA to build a spacecraft to bring astronauts to the moon as early as 2024, the space agency said on Friday, picking it over Jeff Bezos' Blue Origin and defense contractor Dynetics.