Cross-feeding is the exchange of nutrients among species of microbes. It has two potential evolutionary origins, one as an exchange of metabolic wastes or byproducts among species, the other as a form of cooperation known as reciprocal altruism. This paper explores the conditions favoring the origin of cooperative cross-feeding between two species. There is an extensive literature on the evolution of cooperation, and some of the requirements for the evolution of cooperative cross-feeding follow from this prior work-specifically the requirement that interactions be limited to small groups of individuals, such as colonies in a spatially structured environment. Evolution of cooperative cross-feeding by a species also requires that cross-feeding from the partner species already exists, so that the cooperating mutant will automatically be reciprocated for its actions. Beyond these considerations, some unintuitive dynamical constraints apply. In particular, the benefit of cooperative cross-feeding applies only in the range of intermediate cell densities. At low density, resource concentrations are too low to offset the cost of cooperation. At high density, resources shared by both species become limiting, and the two species become competitors. These considerations suggest that the evolution of cooperative cross-feeding in nature may be more challenging than for other types of cooperation. However, the principles identified here may enable the experimental evolution of cross-feeding, as born out by a recent study.