It is an idea at once audacious and simplistic, a seeming impossibility that is now technologically within reach: cities floating in international waters — independent, self-sustaining nation states at sea.

Long the stuff of science fiction, so-called "seasteading" has in recent years matured from pure fantasy into something approaching reality, and there are now companies, academics, architects and even a government working together on a prototype by 2020.

At the center of the effort is the Seasteading Institute, a nonprofit organization based in San Francisco. Founded in 2008, the group has spent about a decade trying to convince the public that seasteading is not an entirely crazy idea.

That has not always been easy. At times, the story of the seasteading movement seems to lapse into self parody. Burning Man gatherings in the Nevada desert are an inspiration, while references to the Kevin Costner film "Waterworld" are inevitable. The project is being partially funded by an initial coin offering, a new concept sweeping Silicon Valley and Wall Street in which money can be raised by creating and selling virtual currency.

And yet in 2017, with sea levels rising because of climate change and established political orders around the world teetering under the strains of populism, seasteading can seem not just practical, but downright appealing.

Earlier this year, the government of French Polynesia agreed to let the Seasteading Institute begin testing in its waters. Construction could begin soon, and the first floating buildings — the nucleus of a city — might be inhabitable in just a few years.

"If you could have a floating city, it would essentially be a start-up country," said Joe Quirk, president of the Seasteading Institute. "We can create a huge diversity of governments for a huge diversity of people."

The term seasteading has been around since at least 1981, when the avid sailor Ken Neumeyer wrote a book, "Sailing the Farm," that discussed living sustainably aboard a sailboat. Two decades later, the idea attracted the attention of Patri Friedman, the grandson of the economist Milton Friedman, who seized on the notion.

Mr. Friedman, a freethinker who had founded "intentional communities" while in college, was living in Silicon Valley at the time and was inspired to think big. So in 2008 he quit his job at Google and co-founded the Seasteading Institute with seed funding from Peter Thiel, the libertarian billionaire. In a 2009 essay, Mr. Thiel described seasteading as a long shot, but one worth taking. "Between cyberspace and outer space lies the possibility of settling the oceans," he wrote.

The investment from Mr. Thiel generated a flurry of media attention, but for several years after its founding, the Seasteading Institute did not amount to much. A prototype planned for San Francisco Bay in 2010 never materialized, and seasteading became a punch line to jokes about the techno-utopian fantasies gone awry, even becoming a plotline in the HBO series "Silicon Valley."