Nature Water, Published online: 30 July 2026; doi:10.1038/s44221-026-00689-8 Industrial wastewater contains both dissolved salts and valuable metals, yet existing technologies rarely achieve water reuse and resource recovery simultaneously. Programming electrode potential can direct the fate of dissolved ions, enabling desalination and selective metal recovery within a single electrochemical platform.