Scientists are exploring a new way to turn wastewater into valuable resources, paving the way for more sustainable materials.