In recent decades, pentazolate salts have gained considerable attention as high energy density materials (HEDMs). Using the machine-learning accelerated structure searching method, we predicted four pentazolate salts stabilized with tetravalent metals (Ti-N and Zr-N). Specifically, the ground state MN20 (M = Ti, Zr) adopts the space-group P4/mcc under ambient conditions, transforming into the I-4 phase at higher pressure. Moreover, the I-4-MN20 becomes energetically stable at moderate pressure (46.8 GPa for TiN20, 38.7 GPa for ZrN20). Anharmonic phonon spectrum calculations demonstrate the dynamic stabilities of these MN20 phases. Among them, the P4/mcc phase can be quenched to 0 GPa. Further ab-initio molecular dynamic simulations suggest that the N5 rings within these MN20 systems can still maintain integrity at finite temperatures. Calculations of the projected crystal orbital Hamilton population and reduced density gradient revealed their covalent and noncovalent interactions, respectively. The aromaticity of the N5 ring was investigated by molecular orbital theory. Finally, we predicted that these MN20 compounds have very high energy densities and exhibit good detonation velocities and pressures, compared to the HMX explosive. These calculations enrich the family of pentazolate compounds and may also guide future experiments.