If you swallow a bunch of cyanide or breathe in too much carbon monoxide, you are in for a pretty bad time, since both are poisonous to humans. But they may have been instrumental to our very existence - and new evidence suggests both were carried here on meteorites.

In a type of carbon-rich meteorite called carbonaceous chondrites, which bombarded our planet prior to the emergence of life, scientists have found compounds containing cyanide, carbon monoxide, and iron.

It's not the first time cyanide and CO have been discovered in meteorites; but it is the first time that the two have been found binding with iron to form stable compounds.

It's compelling evidence that these compounds were present on Earth before the first single-celled organism squirmed into existence in the primordial ocean. And that means they could have contributed to the mysterious process that let that organism squirm at all.

"When most people think of cyanide, they think of spy movies - a guy swallowing a pill, foaming at the mouth and dying, but cyanide was probably an essential compound for building molecules necessary for life," said biochemist Karen Smith of Boise State University.

It's been thought for years that cyanide could play a role in producing organic compounds found in organisms, and last year scientists at Harvard demonstrated cyanide can produce the simple sugars that form RNA nucleotides - the building blocks of life.

But where did the cyanide come from in Earth's early days? To try to figure this out, Smith and her team devised a new method to extract and measure cyanide from ancient meteorites, and used it on a range of meteorite samples.

They found that the cyanide compounds were only found in a particularly organic-rich class of carbonaceous chondrites called CM chondrites. Other types tested - including a meteorite from Mars - contained no detectable cyanide.

Using high-resolution liquid chromatography-mass spectrometry, they analysed the chemical composition of their samples, and found two distinct compounds of iron, cyanide and carbon monoxide, called iron cyano-carbonyl complexes.

"One of the most interesting observations from our study is that these iron cyano-carbonyl complexes resemble portions of the active sites of hydrogenases, which have a very distinct structure," said biochemist Mike Callahan of Boise State University.

Hydrogenases are enzymes found in most modern bacteria and archaea that break down hydrogen. It's thought that they date back to the dawn of life, when Earth's atmosphere was possibly much richer in hydrogen than it is now.

Although the enzymes themselves are quite large in size, the active region within them where the chemical reactions take place is a much smaller metal-organic compound. This is what the meteorite cyanide compounds resemble, the researchers said.

"Cyanide and carbon monoxide attached to a metal are unusual and rare in enzymes. Hydrogenases are the exception. When you compare the structure of these iron cyano-carbonyl complexes in meteorites to these active sites in hydrogenases, it makes you wonder if there was a link between the two," Smith said.

"It's possible that iron cyano-carbonyl complexes may have been a precursor to these active sites and later incorporated into proteins billions of years ago. These complexes probably acted as sources of cyanide on early Earth as well."

NASA currently has a spacecraft visiting the asteroid Bennu far from Earth. As part of its survey, it will be collecting a sample and returning it to Earth. The team hopes to be able to use their technique to determine if Bennu can be linked to those CM chondrites from long ago.

The research has been published in Nature Communications.