An electrolyte must either be molten or an aqueous solution. When an aqueous solution is electrolysed, there will be hydrogen ions and hydroxide ions at the nodes as well as the ions from the ionic compounds. At the cathode, if the metal from the ionic compound is more reactive than hydrogen, hydrogen gas will be produced. If the metal is less reactive than hydrogen, a solid layer of the pure metal will be produced. At the anode, if halide ions and hydroxide ions are present, chlorine, bromine or iodine will be formed. If no halides are present then the hydroxide ions are discharged and oxygen gas is formed.