  The latest pulsar timing array data reveals evidence of nanohertz
gravitational waves (GWs), which have been explained by both cosmological and
astrophysical sources. However, current observations lack the precision needed
to differentiate between different models from the spectral index. We find that
the cosmological GW sources, including bubble collisions, sound waves, domain
walls, condensate fragmentations, and primordial curvature perturbations,
induce large energy density perturbations so that most dark matter will exist
in gravitationally self-bound subhalos. Then, the observation of such
substructures of dark matter can serve as a novel independent method to confirm
or exclude the cosmological GW sources.
