The sun is the ultimate source of energy in most terrestrial and marine ecosystems. The major exceptions are deep sea communities that depend on heat from hydrothermal vents as well as lithotrophic archaebacteria that derive energy directly from rocks.
Until a few decades ago, biologists were unaware that any exceptions existed at the ecosystem level. In every known terrestrial and aquatic environment, the base of the food chain was thought to consist of producers, i.e. autotrophic organisms capable of photosynthesis, such as plants, algae, phytoplankton and cyanobacteria. Since producers depend on sunlight for photosynthesis and every trophic level above the producers depends on them for food and energy, the logical conclusion was that all ecosystems depend on the sun, directly or indirectly, as their ultimate source of energy.
That view changed dramatically in 1977 when scientists aboard the submersible Alvin discovered a deep sea ecosystem thriving around hydrothermal vents in the Pacific Ocean. In this environment, the producers are chemosynthetic bacteria that use heat from the thermal vents to split hydrogen sulfide and use its chemical energy to make ATP and food molecules. Tube worms and giant clams feed on the bacteria. At thermal vents discovered later in the Atlantic Ocean, residents include mussels, crabs, and shrimp. The producers are still chemosynthetic bacteria, the base of the food chain in an ecosystem that survives without sunlight.