Looking at the pore size distribution of thermally treated M-struvite, the mesoporous frameworks of heated Mg-and Ni-struvite differ significantly from each other. Considering the WAXS signal, the Mg-and Ni-system evolve pure amorphous phases during thermal treatment while Co-struvite transforms into crystalline Co-dittmarite (Figure ). Again, this is the reason for the absence of a stable mesoporosity in thermally treated Co-struvite. Therefore, only the Mg and Ni SAXS patterns were fitted with the model describing the mesoporosity (see Methods, ESI: Supplementary Note 1). Upon heating, Mg-struvite exhibits initially a multimodal distribution, a mesoporous population at > 38 nm pore diameter and a meso-to microporous population below 20 nm, respectively at t = 400 s (Figure , Figure , ESI: Figure ). Upon heating after t = 2000 s, the mesoporous population of large pores size with diameters of around 38 nm disappears, while the population of mesopores of small diameter below 20 nm shifts significantly from 13±3 nm to 8±1 nm in size. At the final stage at t = 5500 s, the mesoporous population becomes narrower with time, as is indicated by a decreasing width of size distributions. The final maxima (1 st , 2 nd and 3 rd maximum in Figure ) point out to an average and uniform pore size (ESI: Figure , Figure , Figure ). Although the microporous population evolves quickly already at t = 398 s, its average pore size remains similar at around 1 nm (1.3±0.3 nm at t = 400 s and 1.0±0.3 nm at t = 5500 s). In the Ni-system, beginning with a broad multimodal population in the micro-and mesoporous range at t = 2200 s with a mean pore diameter of 22±6 nm, a bimodal population of micro-and mesopores establishes itself after t = 5500 s (Figure , ESI: Figure , Figure , Figure ). Here, the final mesoporous population at t = 5500 s of heated Ni-struvite with a mean pore diameter of 14±4 nm is much broader and larger than the narrow mesoporous population of Mgstruvite of 8±1 nm. In addition, Mg-struvite exhibits a higher volume of mesopores in relation to the volume of micropores compared to Ni-struvite (approximately for Mg: φmicro ≈ 83% to φmeso ≈ 17% and for Ni: φmicro ≈ 60% to φmeso ≈ 40%, ESI: Table ). Based on the relative volume fraction of meso-and micropores SAXS, the final heated amorphous magnesium phosphate phase exhibits 2 -2.5 higher volume of mesopores than the final heated Ni-PO4 phase (Mg: φmeso= 40% vs. Ni: φmeso= 17%). Although a pure Co-struvite precursor did not evolve mesopores in the final stage, a detailed view on in-situ data could reveal transitional pores formed in the heating process, which eventually disappeared. In fact, we could observe short-lived micro-to mesopores of an average size of 2-3 nm at around t = 150 s (Figure ). They evolved during a thermal treatment due to the simultaneous decomposition/degassing of Co-struvite. After this time, all released gases, mainly H2O, had evaporated and Co-dittmarite recrystallized immediately, resulting in a progressive decline of the mesopore signal until its disappearance at around t = 700 s. This points out again to a sharp crystalline-crystalline phase transition between Co-struvite and Codittmarite. Interestingly, permanent well-defined narrow peaks at 5.1 and 5.5 nm -1 developed rapidly already within the first 150 s and remained present in the scattering pattern. Such peaks did not appear either in the Mg-or in the Ni-system (Figure ). These narrow and sharp reflexes are probably associated with the crystal structure changes rather than with an actual evolving microporosity.