Biocompatible perovskite quantum dots with superior water resistance enable long-term monitoring of the H2S level in vivo.