Atomistic theory of electrolytic nucleation: I