Water trapped in rocks on the moon's surface probably originated mostly from streams of energetic particles blasted from the sun and not from cosmic impacts from comets, researchers say.

For years, scientists argued over whether the moon harbored water or not. Recent findings confirmed that water does exist on the moon, although its surface remains drier than any desert on Earth. NASA officials have suggested this water could one day help support colonies on the moon and missions to Mars and beyond.

It remained uncertain where all of this water came from. One possibility is that it was delivered by impacts from carbonaceous chondrites — meteorites that can be rich in water — and from comets. Another is that water formed on the moon after exposure to the solar wind — streams of high-energy particles from the sun. Atoms of hydrogen in the solar wind can react with oxygen trapped in moon rocks to form water. [Water on the Moon: The Search in Photos]

To help find out where lunar water came from, scientists analyzed 45 microscopic grains of dust that astronauts on NASA's Apollo 16 and 17 missions brought from the moon. They focused on levels of different isotopes of elements within these dust grains. Isotopes differ from each other in how many neutrons there are in their atoms — for instance, normal hydrogen atoms do not have any neutrons, while atoms of deuterium, an isotope of hydrogen, each possess one neutron. Water can be made with deuterium as well as with normal hydrogen.

The sun is naturally low in deuterium because its nuclear reactions quickly consume the isotope. All other bodies in the solar system possess relatively high levels of deuterium, remnants that existed in the nebula of gas and dust that gave birth to the solar system. By analyzing the ratio of deuterium to hydrogen in the water in moon dust, the researchers could deduce whether the water originated from the sun or elsewhere, such as chondrites.

One complicating factor in this analysis is that cosmic rays — high-energy particles from deep space — can generate deuterium when they slam into the moon. To account for how cosmic rays can influence deuterium levels on the moon, the scientists also looked at levels of lithium-6, an isotope of lithium that cosmic rays would also generate when they hit the moon. By examining the ratio of lithium-6 to normal lithium, the researchers deduced how often cosmic rays struck the moon and generated deuterium as well as lithium-6.

The researchers expected to find water from chondrites in the interiors of the lunar dust grains and water from both chondrites and the solar wind in the exteriors or rims of these grains. Surprisingly, the water in both the interiors and exteriors of these dust grains apparently originated mainly from the solar wind.

"We do not find any chondritic signature," lead study author Alice Stephant, a cosmochemist at the National Museum of Natural History in Paris, told Space.com.

These findings suggest that any water that cosmic impacts bring to the moon is not retained much. At most, an average of 15 percent of the hydrogen in lunar soil may come from chondritic water, the researchers said.

Stephant and her colleague, François Robert, detailed their findings online Oct. 6 in the journal Proceedings of the National Academy of Sciences.