While Alessandro Volta is credited with inventing the voltaic pile in 1800, it was Nicholson and Carlisle who first used it to demonstrate the principle of electrolysis.
It's important to note that Jan Rudolph Deiman and Paets van Troostwijk had previously decomposed water using electrostatic discharge in 1789. However, their work wasn't widely recognized, and the experiments of Nicholson and Carlisle are considered the defining moment in the discovery of electrolysis.