The biggest problem for hydrogen fuel-cell cars has been where to get a plentiful, affordable supply of hydrogen that doesn't contribute to greenhouse gas emissions.

Now scientists may have come up with what some have called the holy grail of clean transportation: a way to create hydrogen affordably from seawater.

READ THIS: 2019 Hyundai Nexo hydrogen fuel-cell vehicle pricing: Puzzling economics

The salt in seawater has been problematic for electrolyzers that separate hydrogen and oxygen atoms from water molecules, because it quickly corrodes the electrolyzer's anode. Desalinating seawater before putting it through an electrolyzer is too costly,. Most hydrogen is made by splitting methane, which results in large amounts of leftover carbon dioxide, the primary gas scientists have associated with global warming.

As in lithium batteries, the solution is in a new type of catalyst coating the anode.

MUST READ: This one 11-year-old chart explains the problem with hydrogen fuel-cell vehicles

According to a March report in the Proceedings of the National Academy of Sciences, scientists at Stanford developed a new catalyst that incorporates carbonate and sulfate molecules into the iron-nickel coating on the nickel anode. The carbonate and sulfate molecules have a high negative charge that prevents the salt from penetrating the coating and corroding the anode.

In lab tests, the electrolyzer with the coating was able to run for more than 40 days, even with three times the salt concentration of seawater.

CHECK OUT: Electric cars win on energy efficiency vs hydrogen, gasoline, diesel: analysis

Electrolyzing seawater to create hydrogen for fuel-cells solves an obvious problem with today's electrolysis: the supply of fresh water, which is already constrained in many parts of the world, often including Southern California, the home to most fuel-cell cars in the U.S.

The breakthrough doesn't solve all the challenges of hydrogen cars, such as developing a sustainable and affordable distribution network for hydrogen. But if it makes electrolysis viable using renewable energy, it could make the rest of the challenges worth solving.

The Stanford scientists used solar power to run the electrolyzer in their tests.