In electrolysis, an external voltage is applied to drive a nonspontaneous reaction. Electrolysis can also be used to produce \(H_2\) and \(O_2\) from water. Electroplating is the process by which a second metal is deposited on a metal surface. The amount of material consumed or produced in a reaction can be calculated from the stoichiometry of an electrolysis reaction, the amount of current passed, and the duration of the electrolytic reaction.