Cyanobacteria are a phylum of bacteria that obtain their energy through photosynthesis. They use light energy to split or oxidize water, with oxygen gas as a by-product. The electrons are passed through an electron transport chain and used to make NADPH and ATP.
Photosynthesis in cyanobacteria commonly uses water as an electron donor and produces oxygen as a by-product, however, some species of cyanobacteria may also use hydrogen sulfide as it occurs among other photosynthetic bacteria.