Across the West, early miners digging for gold, silver and copper had no idea that one day something else very valuable would be buried in the piles of dirt and rocks they tossed aside.
There's a rush in the US to find key components of mobile phones, televisions, weapons systems, wind turbines, MRI machines and the regenerative brakes in hybrid cars, and old mine tailings piles just might be the answer.
They may contain a group of versatile minerals the periodic table called rare earth elements.
"Uncle Sam could be sitting on a gold mine," said Larry Meinert, director of the mineral resource program for the US Geological Survey (USGS) in Reston, Virigina.
The USGS and Department of Energy are on a nationwide scramble for deposits of the elements that make magnets lighter, bring balanced hues to fluorescent lighting and colour to the touch screens of smartphones in order to break the Chinese stranglehold on those supplies.
They were surprised to find that the critical elements could be in plain sight in piles of rubble otherwise considered eyesores and toxic waste.
One era's junk could turn out to be this era's treasure.
"Those were almost never analysed for anything other than what they were mining for," Meinert said.
"If they turn out to be valuable that is a win-win on several fronts - getting us off our dependence on China and having a resource we didn't know about."
The 15 rare earth elements were discovered long after the gold rush began to wane, but demand for them only took off over the past 10 years as electronics became smaller and more sophisticated.
They begin with number 57 Lanthanum and end with 71 Lutetium, a group of metallic chemical elements that are not rare as much as they are just difficult to mine because they occur in tiny amounts and are often stuck to each other.
Unlike metals higher up on the table, such as silver and gold, there's no good agent for dissolving elements so closely linked in atomic structure without destroying the target. It makes mining for them tedious and expensive.
"The reason they haven't been explored for in the US was because as long as China was prepared to export enough rare earths to fill the demand, everything was fine - like with the oil cartels. When China began to use them as a political tool, people began to see the vulnerability to the US economy to having one source of rare earth elements," said Ian Ridley, director of the USGS Central Mineral and Environmental Resources Science Centre in Colorado.
Two years ago, China raised prices - in the case of Neodymium, used to make Prius electric motors stronger and lighter, from $US15 a kilogram in 2009 to $US500 in 2011, while Dysprosium oxide used in lasers and halide lamps went from $US114 a kilogram in 2010 to $US2,830 in 2011.
It's also about the time China cut off supplies to Japan, maker of the Prius, in a dispute over international fishing territory.
That's when the US government went into emergency mode and sent geologists to hunt for new domestic sources.
"What we have is a clash of supply and demand. It's a global problem. A growing middle class around the world means more and more people want things like mobile phones," said Alex King, director of the Critical Materials Institute of the Department of Energy's Ames Research Lab in Iowa.
At the University of Nevada-Reno and the Colorado School of Mines, USGS scientists used lasers to examine extensive samples of rocks and ore collected across the West during the gold rush days by geologists from Stanford University and Cal Tech.
One sample collected in 1870 from an area near Sparks, Nevada, where miners had searched for a viable copper vein, has shown promise and has given researchers clues in the search for more.
They have found that some rare earths exist with minerals they had not previously known occur together.
"The copper mine never went into production, but now, after all of this time, we've analysed it and it came back high with Indium, which is used in photovoltaic panels. It never economically produced copper, but it gives us insight into some associations we didn't previously recognise," said Alan Koenig, the USGS scientist in charge of the tailings project.
Indium also has been found in the defunct copper mine that dominates the artsy southern Arizona town of Bisbee.
Koenig and his colleagues are working to understand the composition of all of the nation's major deposits sampled over the past 150 years. In some cases, the mines were depleted of gold or copper, but the rocks left piled alongside mines and pits could hold a modern mother lode.
They are compiling data from 2,500 samples to better understand whether it's possible to predict where rare earths might be hiding based on the presence of other elements there, too.
Currently, there is only one US mine producing rare earths - at Mountain Pass in the Southern California desert. Molycorp Inc's goal in re-opening the defunct mine is 20,000 metric tons of rare earth elements, including cerium oxide used to polish telescope lenses and other glass.
The USGS is counting on companies like Molycorp to use the information they've gleaned to uncover other easy-to-reach deposits sitting on federal land and elsewhere.