It must obey not only the laws of physics, but of equal importance , make economic sense---
It's called electrolysis, and is relatively basic, it just requires an electrical current. As we know, electricity can come from a number of sources already. And it's more like the laws of chemistry.