  LHS 1140 b is a small planet orbiting in the habitable zone of its M4.5V
dwarf host. Recent mass and radius constraints have indicated that it has
either a thick H$_2$-rich atmosphere or substantial water by mass. Here we
present a transmission spectrum of LHS 1140 b between 1.7 and 5.2 $\mu$m,
obtained using the NIRSpec instrument on JWST. By combining spectral retrievals
and self-consistent atmospheric models, we show that the transmission spectrum
is inconsistent with H$_2$-rich atmospheres with varied size and metallicity,
leaving a water world as the remaining scenario to explain the planet's low
density. Specifically, a H$_2$-rich atmosphere would result in prominent
spectral features of CH$_4$ or CO$_2$ on this planet, but they are not seen in
the transmission spectrum. Instead, the data favors a
high-mean-molecular-weight atmosphere (possibly N$_2$-dominated with H$_2$O and
CO$_2$) with a modest confidence. Forming the planet by accreting C- and
N-bearing ices could naturally give rise to a CO$_2$- or N$_2$-dominated
atmosphere, and if the planet evolves to or has the climate-stabilizing
mechanism to maintain a moderate-size CO$_2$/N$_2$-dominated atmosphere, the
planet could have liquid-water oceans. Our models suggest CO$_2$ absorption
features with an expected signal of 20 ppm at 4.2 $\mu$m. As the existence of
an atmosphere on TRAPPIST-1 planets is uncertain, LHS 1140 b may well present
the best current opportunity to detect and characterize a habitable world.
