Electrodeposition and speciation processes of multivalent metals for next generation batteries