In the 2015 movie “The Martian,” astronaut Mark Watney survives on Mars by growing potato plants in his own waste. The scenario is fictional, of course, but it underscores a real-world challenge for NASA: How can the space agency ensure an uninterrupted supply of safe, nutritious food for astronauts who are tens of millions of miles from the nearest supermarket?

The successful launch of SpaceX’s Falcon Heavy rocket marked a big step toward developing the technology needed to transport colonists to Mars, though the strategy for keeping them and deep-space astronauts fed remains a work in progress.

At Pennsylvania State University, researchers think they’ve hit upon a solution. They’ve devised a compact recycling system that uses astronaut poop and pee to fuel the growth of edible bacteria. As described in a paper published in November 2017 in Life Sciences in Space Research, the bioreactor breaks down human waste into salts and methane gas; the latter is used to fuel the growth of a protein-rich “microbial goo” that's similar in consistency to Vegemite.

“This paper lays out a novel vision for how deep spaceflight might work, and I think we’ll find the right microbe or the right combination of microbes to make this work,” said Dr. Christopher House, director of Penn State’s Astrobiology Research Center and a co-author of the paper.

Faster and more reliable

If it performs as House and his colleagues predict, the bioreactor could provide a reliable source of food at very low effort and with a lag time of just days (while helping eliminate potentially hazardous human waste). In contrast, growing crops requires weeks or months of careful tending — and despite recent research into growing crops in space or on Mars, there’s no assurance that space-based agriculture can reliably sustain far-flung space travelers.

The bioreactor could even find use here on Earth.

Get the mach newsletter. This site is protected by recaptcha

Dr. Lisa Steinberg, who cowrote the paper while a postdoctoral researcher in House’s lab, said the system could also prove useful as a more efficient way to feed livestock — and possibly humans, if scientists can verify its safety and convince people to eat food made from bacterial goo. “If there is more work done on nutritional content and you get some good food scientists in there to make it yummy, and you maybe look at different kinds of bacteria, that could also be a supplemental human protein source,” she said.

The research could also inspire better wastewater treatment systems that deliver valuable byproducts like biogas and electricity, said Steinberg, who is now the science lab supervisor at Delaware County Community College in Media, Pennsylvania.

Simulated poop

To test their reactor, House and Steinberg didn’t use actual human feces — in large part because of the risk of infection. So they filled their 4-foot-long prototype with wastewater containing simulated urine and feces — the latter a mixture of dog food, cellulose, glycerol, and salts.

Inside the reactor, kept at 95 degrees Fahrenheit, the waste circulated around small plastic balls coated with microbes that specialize in decomposition. One microbe broke down the solid waste into salts and fatty acids, which are the building blocks of human fat. Another microbe converted fat molecules into methane gas.

After the reactor’s microbial communities had become established, the researchers removed about 2 quarts of treated waste every two days and added an equal amount of new waste. In the treated wastewater, the microbes had removed about 97 percent of the simulated poop.

Calysta Energy is gearing up to mass-produce a bacterial meal made primarily from Methylococcus grown in natural gas-filled fermentation vats. Calysta

From old research reports, the researchers hit upon the idea of capturing the methane gas and injecting it into a second reactor to fertilize the growth of a protein-rich bacterium. Scientists first isolated this unusual microbe, known as Methylococcus capsulatus, from the Roman baths in Bath, England. No one yet knows if it’s fit for human consumption, but Menlo Park, California-based Calysta Energy is gearing up to mass-produce a bacterial meal called FeedKind that is made primarily from Methylococcus. It’s being marketed as a sustainable food source for fish, pets, and livestock.

Technology inspired by nature

House said more work is needed to ensure the safety and reliability of the waste-to-food system for astronauts. “If this is not only treating your waste but it’s also generating — in a separate process — your food, it can’t ever fail,” he said.

Dr. Michael Webber, deputy director of the Energy Institute at the University of Texas and one of the scientists who helped develop the wastewater recycling system used on the International Space Station, agreed that significant work would be needed before the Penn State technology is ready for real-world (or off-world) use. “There’s still a lot of engineering science that has to happen, but it’s a cool idea,” he said, adding that the same recycling strategy could be a boon to communities that have limited food and water supplies.

Life on Earth, after all, relies on the reuse of nutrients in our environment, said Dr. John Hogan, an environmental scientist at NASA Ames Research Center in Mountain View, California and an early advisor to House and Steinberg. “It’s become very clear to me over the many years now, that we really are on a spaceship — it’s not a metaphor — and that recycling is the way that this system works,” Hogan said.

FOLLOW NBC NEWS MACH ON TWITTER, FACEBOOK, AND INSTAGRAM.