The inherent flammability of most polymeric materials poses a significant fire hazard, leading to substantial property damage and loss of life. A universal flame-retardant protective coating is considered as a promising strategy to mitigate such risks; however, simultaneously achieving high transparency of the coatings remains a great challenge. Here, inspired by the moth eye effect, we designed a nanoporous structure into a protective coating that leverages a hydrophilic−hydrophobic interactive assembly facilitated by phosphoric acid protonated amino siloxane. The coating demonstrates robust adhesion to a diverse range of substrates, including but not limited to fabrics, foams, paper, and wood. As expected, its moth-eyeinspired nanoporous structure conferred a high visible light transparency of >97% and water vapor transmittance of 96%. The synergistic effect among phosphorus (P), nitrogen (N), and silicon (Si) largely enhanced the charforming ability and restricted the decomposition of the coated substrates, which successfully endowed the coating with high fire-fighting performance. More importantly, for both flexible and rigid substrates, the coated samples all possessed great mechanical properties. This work provides a new insight for the design of protective coatings, particularly focusing on achieving high transparency.