Today, the Moon is about as inhospitable to life as it gets. The little water that’s there is trapped in ice or rock. It’s otherwise dry and airless, fluctuating in temperature by hundreds of degrees anywhere the sun shines. But long ago? That’s an entirely different story.New research published in Astrobiology suggests that the Moon may have been shockingly habitable in the past during at least two periods — shortly after the Moon formed, and when volcanic activity was at its highest.The key to it all is heat and lots of energy. The Moon formed after a collision between Earth and a proto-planet astronomers call Theia. And just after the smash up, there was lots of water vapor — enough that the Moon could’ve had a fairly substantial atmosphere and pools of water on the ground. Volcanic activity was also high, which could have replenished the atmosphere with water vapor from deep in the interior.That all happened roughly 4 billion years ago.And by the time volcanic activity settled down some 500 million years after the collision, the atmosphere couldn’t cling on — and much like Mars, the Moon dried up.But in that 500 million-plus year span, all the ingredients for life may well have been present.That habitable era also fell during a period of frequent asteroid bombardment, so the inner solar system may have shared with the Moon ingredients to make life possible. Asteroids could have even struck early Earth and transported primitive bacteria to the surface of the Moon.The short span of lunar life didn’t really have long to evolve much beyond single-cell organisms.However, there’s abundant evidence that the early lunar water is still trapped within rock now. So, digging a little deeper under the surface of the Moon — in, say, a lunar exploration program — could yield greater evidence for lunar life, including the possibility of fossilized microbes trapped in rock.This article originally appeared on Discovermagazine.com