Inside a small laboratory in California, scientists have figured out something remarkable: how to turn the carbon dioxide floating in the air into solid graphite — the same soft black material that lines the tip of a No. 2 pencil and powers the batteries in your phone and laptop.

The discovery comes from researchers at the U.S. Department of Energy's Lawrence Berkeley National Laboratory, working alongside partners at UC Berkeley and Estonia's National Institute of Chemical Physics and Biophysics. Their findings, published in the journal Nature Communications, could offer a new way to make graphite without digging it out of the ground.

Graphite is everywhere. It sits inside the batteries that keep our devices running, from the phone in your pocket to the laptop on your desk. Today, nearly all of it must be mined from the earth and processed overseas before reaching American manufacturers. But this new research suggests we might someday grow graphite in a lab instead.

To make this happen, the team built a special microscope setup that let them watch a chemical process called molten-salt electrolysis. That's a mouthful, but the idea is simple: pass electricity through extremely hot salt — about 500 degrees Celsius, or 932 degrees Fahrenheit — and the carbon dioxide dissolved in it slowly transforms into solid carbon. The tricky part is that molten salt is incredibly harsh and hard to study. For the first time ever, researchers were able to watch what was happening at the molecular level while the reaction was actually running.

What they saw surprised them. The transformation happened in two steps, not one — a discovery that answers a decades-old question about how this chemistry works. The researchers also found that changing the materials used for the electrodes (the parts that carry electricity into the salt) did not change the basic reaction, though it did affect what kind of carbon structure formed. This means scientists could eventually tweak the process to produce exactly the type of graphite needed for batteries.

Mike Whittaker, a scientist at Berkeley Lab who worked on the project, sees big possibilities. "If you could run this process at low temperatures with really cheap salts, you could have it in a lot of places, and you could generate enough graphite that you could feed into battery supply chains," he said.

The team now plans to find the best combinations of salts, electrode materials, temperatures, and electrical voltages to produce graphite efficiently and at larger scales. Turning air pollution into something useful — that is the kind of future this research is building toward.