Carbon is the ressource to upgrade Base Modules and Nanobots Storage. Carbon is stored in the Carbon Storage module, which has to be upgraded to store more carbon. You can obtain carbon with Carbon extractors or by winning base raids in sectors or in base raids of other players in the Battles screen.

Popular sectors to farm carbon are:

After getting raided by another player in a base raid you lose up to 20% of your current Carbon but you gain Nanobots