Shotgun-toting guards patrol an anonymous warehouse on the outskirts of Ciudad del Este. Perched on the triple border where Paraguay meets Brazil and Argentina, the melting-pot city is often associated with smuggling, cartels and drugs.

But inside, a new hot commodity is piling up by the second. Dozens of dismantled CPUs and internet-connected circuits whirr away in the gloom, LEDs flashing, adding to the subtropical heat.

They are just a few of an estimated 20,000 units citywide, mostly mining the cryptocurrencies Bitcoin and Ethereum in an industry that has sprung up almost overnight.

Behind the boom is the monolithic Itaipú dam the country shares with Brazil, stretching across the Paraná river just north of the city. It is the world’s most powerful hydroelectric facility, and its abundant energy supply makes Paraguay an ideal setting for bitcoin “mining”.

Itaipú is enriching some. But the increasingly complicated computations that underpin bitcoins need ever-more powerful computers and cooling systems – which consume more and more power.

“Some people have become multimillionaires,” said Gregorio Bareiro, whose first contact with the bitcoin industry came last September, when his air-conditioning business began providing bitcoin investors with a DIY cooling system involving damp cardboard and industrial fans.

Now, he rents out 750 computers of his own – mainly to Brazilians, Europeans and North Americans – hires a dozen staff, and has plans to install mobile mines in portable trailers.

See the full visual

“Paraguay today is the only place where there’s abundant energy,” Bareiro enthused. “We can become the centre of global bitcoin mining.”

Paraguay owns half of Itaipú’s output. But its few factories and creaking national grid can barely absorb all this power, and it is forced to sell the huge surplus to Brazil – at well below market price, experts claim.

This surfeit of power means its domestic energy prices are around 5c per kilowatt hour – barely a fifth of that of the giant next door – prompting an influx of foreign-owned factories and investors in recent years.

Paraguay should roll out the red carpet further to cryptocurrency miners, said Bareiro. The entrepreneur thinks that by using Itaipú’s power to cut energy prices further, the owners of the 150,000 units currently in China can be tempted to decamp to Paraguay.

“In 10 years, it would generate enough money to pay Paraguay’s external debt,” he suggested. “With our resources, we ought to have electric helicopters, drones for transporting goods …

“We’ve found a way out for our country,” he added. “The best chance we have is not selling our energy to Brazil but investing in cryptocurrency.”

Not everyone is convinced that the energy-guzzling commodity is the way forward.

A growing coalition of Paraguayan politicians, academics and businesspeople wants the country to seize looming negotiations with Brazil over the dam’s financial dividends – due by 2023 – to spread the benefits of Itaipú’s bounty more widely.

According to Gerardo Blanco, director of a research group on energy at the Universidad Nacional de Asunción, “2023 represents a unique opportunity for Paraguay.”

A study by the group suggests that directing the energy currently sold abroad into domestic manufacturing could generate 2m jobs and quadruple Paraguay’s GDP, transforming the destiny of one of South America’s poorest countries.

“This would be a quantum leap that will have huge implications for society, the economy, and even our culture,” Blanco added.

Cristine Folch of Duke University similarly suggested that Paraguay could provide data centres powered by clean energy for software giants like Google, Apple and Facebook, and become a regional hub for the manufacture of lithium batteries.

If the country takes advantage of Itaipú now, while its population is still small, “it could put Paraguay on the edge of the technological frontier,” she told the Guardian.

Miguel Carter, a Paraguayan development expert, suggested that by negotiating a fairer price for its energy, Paraguay could better fund hospitals and schools and resurrect Paraguay’s rusting railways.

According to Carter’s calculations, Paraguay was outgunned by Brazil in negotiating the 1973 Itaipú treaty – signed between two dictatorships – and cheated out of an astonishing $57.7bn in lost income.

In 1979, Brazil’s military regime murdered its ambassador to Paraguay to prevent him from revealing the billions of dollars of kickbacks involved in Itaipú’s construction, it was officially confirmed in October.

“When I saw the numbers I burst into tears,” Carter told the Guardian. “I know of so many stories of Paraguayans going to hospital and losing their loved ones … there would have been lives saved, kids with a decent education. You could have had a different country.”

A spokesperson for Brazil’s foreign ministry rejected the idea that Paraguay had been swindled, pointing to previous Brazilian concessions and stating that the country had secured and guaranteed the shared debt used to finance Itaipú’s construction.

Brazil’s president-elect, Jair Bolsonaro, who takes office in January, is likely to prove a fierce adversary in the negotiations.

But some are daring to hope that Paraguay’s energy riches might soon be leveraged to help them.

Several hours north on the highway, and an hour down a dirt track, 43 indigenous Ava Guaraní families of the Tekoha Sauce community live in tarpaulin shacks, sandwiched between fields of soybean and a polluted tendril of the Paraná, close to the border with Brazil.

They lack clean water, healthcare – and electricity. Chemical run-off from the nearby fields has given many skin complaints.

They returned here in 2015, after being forced off their land by the dam’s rising floodwaters in the late 1970s.

Soon after, a police raid tore up their crops and burned their houses, school and church. “If there’s another eviction we’ll stay and die,” said Amada Martínez, a community leader. “Because we have nowhere else to go.”

They are now in talks to secure title to a fraction of their ancestral territory. “People think it’s a marvel,” Martínez added. “But the damage Itaipú caused to our people … behind the story, there’s suffering.”