Electrolysis for hydrogen production