For more than 100 years after California's Gold Rush, developers and city leaders filled in San Francisco Bay, shrinking it by one-third to build farms, freeways, airports and subdivisions.

All that changed in the 1970s with modern environmental laws. But now as sea level rise threatens to cause billions of dollars of flooding in the coming decades, the bay is going to need to be filled again—but this time in a different way, according to a new scientific report out Tuesday.

Twice the amount of sediment excavated for the Panama Canal will be needed to build up the bay's shoreline, researchers say, to protect communities from disastrous flooding and rising seas that could climb as much as 6 feet by the end of the century.

The best source for that immense volume of fill is the mud and silt scooped up when the bay's harbors and shipping channels are dredged every year. But currently, that material is being dumped into the ocean 60 miles off the Golden Gate, or sent to the bottom of the bay near Alcatraz Island.

The report calls for a radical change in those disposal practices.

"It's not a waste product. It's a valued resource. It should be used for the public good," said Letitia Grenier, a co-author of the report and a senior scientist at the San Francisco Estuary Institute, a non-profit research organization in Richmond.

The study, called "Sediment for Survival," was written by San Francisco Estuary Institute scientists, with input from researchers at UC Davis, the U.S. Geological Survey, the Environmental Protection Agency, the San Francisco Bay Conservation and Development Commission, and other bay experts.

The math is fairly simple.

To raise the wetlands and mudflats around the bay by 6.9 feet over the next 80 years, the high end of most estimates of sea level rise, 477 million cubic yards of mud and dirt will need to be added to them. That's the equivalent load of 48 million dump trucks. Or enough to fill the massive Hangar One at Moffett Field 265 times.

If nothing is done, between 150 million and 170 million cubic yards will come into the bay naturally from streams, rivers and other sources. That leaves a shortfall of about 300 million cubic yards. The good news? About 60% of that deficit can be made up with mud and silt from dredging, Grenier and her colleague Scott Dusterhoff estimate. The rest can be produced by scooping out vast amounts of sediment trapped behind dams, removing dams, rerouting flood-control projects or shifting inland dirt from over the coming generations.

Using what has been considered a to protect the bay from flooding would be a transformation similar to society realizing that aluminum cans and glass bottles shouldn't be thrown in landfills, or that wastewater could be cleaned and used again for irrigation, said David Lewis, executive director of Save the Bay, an environmental group in Oakland.

"Let's stop wasting this valuable resource and use it to protect our communities and our wetlands before swamps them," he said. "There are places where we are going to need to raise levees and seawalls. But in most of the bay we can use natural infrastructure. And that costs less than seawalls and brings more benefits."

Among those benefits are habitat for birds, fish and other wildlife, and recreational trails for the public.

According to tide gauges, San Francisco Bay has risen 8 inches since 1900. Hotter temperatures are melting polar ice caps around the world and causing ocean water to expand in volume. Scientists project the bay will rise another 1 foot or more by 2050 and another 3 feet or more by 2100. Heavy winter storms already cause flooding in some parts of the Bay Area, especially during high tides. Billions of dollars of infrastructure, including high-tech company headquarters like Facebook and Yahoo, wastewater treatment plants that serve millions of people and communities like Alviso and Foster City, are at risk.

San Francisco International Airport is moving forward with a $587 million plan to build a major new sea wall of steel and concrete around the entire 10-mile perimeter of the airport and its runways, which serve 55 million passengers a year. The Santa Clara Valley Water District is working to raise earthen levees in parts of the South Bay. And in 2018 voters in San Francisco approved a $425 million bond measure to begin work on an enormous, 30-year, $5 billion project to rebuild the seawall along the Embarcadero from the Giants ballpark to Fisherman's Wharf.

But around much of the rest of the bay, researchers say, it's cheaper, and environmentally smarter, to expand the size of wetlands and raise their elevation.

Lewis said a key challenge is convincing the Army Corps of Engineers, the federal agency that does most of the dredging, to change its longstanding practices. Several projects have used dredge materials already, barging it in and spreading it with pumps, including 648 acres of wetland restoration at Hamilton Airfield in Marin County, and 566 acres of restored marsh at Montezuma Slough in Solano County. But the practice is still in its infancy, and some soils contaminated with PCB, DDT and other old toxins can't be used or must be buried and sealed.

Another big challenge is the price tag. It costs $10 a cubic yard to dispose of dredge materials off Alcatraz, about $20 in the ocean, and about $30 in the Hamilton and Montezuma wetlands projects, said Jim Haussener, executive director of the California Marine Affairs & Navigation Conference, an organization that represents ports and harbors.

Haussener said "beneficial reuse" of dredge spoils is a good idea, but if the federal or state government doesn't provide more funding, he worries local ports either won't be dredged as often or will see their fees go up.

"Everybody supports it," he said. "The question is who pays?"