It’s believed by scientists that perhaps the largest solar flare in human history occurred back in 1859. At the time, this geomagnetic storm didn’t affect much on Earth, but mainly because there wasn’t much technology at the time. If a storm of that magnitude happened on Earth now, it would cause massive power outages and loss to infrastructure, and the closest that we’ve come since then was in 2001 when the largest recorded solar flare was tracked on April 2.

Now, scientists are predicting that what could be the largest solar flare ever might happen in the next 100 years, with some saying that it will come by the end of the 21st century. The size of the potential solar flare could wipe out satellites, internet connections, power grids and much more. Avi Loeb of Harvard University said that “The sun is usually thought of as a friend and the source of life, but it could also be the opposite. It just depends on circumstances.”

Massive solar flares could have the potential to completely end human life by destroying the ozone layer, but that’s not something that’s predicted to happen in millions of years. For now, we (and the next couple of generations) might have to worry about this solar flare that could set back technology for a few years. Loeb said he believed the estimated damage to be “trillions of dollars,” adding that “A flare like (the one in 1859) today could shut down all the power grids, all the computers, all the cooling systems on nuclear reactions. A lot of things could go bad.”

Loeb also said that even the next few years (around a decade or so) could potentially bring the solar flare, giving it a chance of just over 10 percent. Greg Laughlin of Yale University said that “I’m not lying awake in bed at night worrying about solar superflares, but that doesn’t mean someone shouldn’t be worrying about it.” So is there any way that humans can prevent a solar flare from doing major damage? It turns out there is.

A recent study proposed by Loeb and Doctor Manasavi Lingam has said that Earth could potentially put up a shield that would prevent massive damage from solar flares. The shield would be a magnetic one that’s placed in the correct point where it could deflect particles from the sun, completely avoiding our home planet. The Earth already has a magnetic field that does this, but would need some help on a larger scale.

Of course, this shield would have to be large enough to completely cover the Earth from disaster, which would mean a massive cost. Loeb suggests that the shield would cost around $100 billion to put into place. Laughlin said “I think that seriously diverting resources to build a wire loop in space would not be the best way to spend money, but thinking more about how superflares work and getting a sense of how our sun fits in with its peers would be a very valuable effort.”

While Loeb agrees that $100 billion is a high price tag, he estimates that the solar flare could cause $20 trillion worth of damage, making it a sound investment. “The engineering project associated with the magnetic shield that we propose could take a few decades to construct in space,” he said. Similar shields have been proposed for other planets such as Mars in hopes of making them habitable.

The people of Earth need to get moving soon on a massive project like that if the shield is going to be up in time for the potential solar flare. Loeb and Lingam said that “The vulnerable phase (of the sun) is during the relatively short-lived regime of exponential amplification that is likely to begin a few decades henceforth. The ideal scenario entails the identification and implementation of an effective strategy to mitigate the risks from extreme space weather events within the next century.”

Another back-up plan could be even more simple according to scientist Don Lincoln. To avoid long-term damage to power grids across the world, Lincoln says that “In the case of a really, really bad event, they could decide simply to take the grid offline and have a blackout for 10 or 12 hours, but save the infrastructure of the nation.” Lincoln adds that this plan could work wonders as the charge of magnetic fields from a solar flare “induces electrical currents in big circuits.” So whether it’s a massive multi-billion dollar shield or simply turning off the power for a few hours, we have some sort of plan in the event of a solar flare.