Where the foothills of the Andes meet the vast Amazonian rainforest in eastern Ecuador there is a small town called Shell. It's a pockmarked, termite-eaten, one-street place which doubles as a missionary centre and a regional airstrip, but it was here in 1937 that the mighty Shell oil company based its crack Latin American oil-prospecting team. The prize was the vast deposits of crude oil believed then – and now known – to lie beneath some of the densest forests in the world.
Nearly 75 years later, Shell the company has long left Shell the town and half of Ecuador's estimated nine billion barrels of oil reserves have been extracted. Ecuador has earned $130bn from the oil found so far in its forests and it earns 40% of its income from it.
But Ecuador now faces a dilemma. Five years ago the state oil company Petroecuador found a massive new oil field containing nearly a billion barrels of oil in Block 31 of the Yasuní national park close to the Brazilian border. The find was equivalent to 20% of all the nation's reserves, worth a minimum $7-10bn.
The dilemma is that the oil in the Ishpingo Tambococha Tiputini (ITT) field is below one of the most biodiverse areas of the world and to extract it would devastate one of the last great wildernesses.
Because of its location right on the equator at the junction of the forest and the mountains, Yasuní is one of the last places on earth which is truly undisturbed. As well being home to the the Tagaeri and the Taromenane, two of the world's last uncontacted tribes, the park is thought to have more species of plants, animals and insects per hectare than anywhere else on earth.
One six-square-kilometre patch of Yasuní – chosen by scientists almost at random – was found to have 47 amphibian and reptile species, 550 bird and 200 mammal species living there. Another patch of land in the park breaks all the world records for bats and insects. More tree species grow in a single hectare of rainforest in Yasuní than in all of north America. A single hectare of rainforest there may contain as many as 100,000 insect species and most of the 2,000 species of fish known to live in the rivers of the Amazon region are believed to be there.
There have been more species of frogs and toads recorded in the park than are native to the United States and Canada combined; more insect species have been found living on one tree than in all of the United States; more birds seen there than in all Europe.
What to do with Yasuní was left to oil minister Alberto Acosta. A European-trained economist, he had spent years in the state oil company, was a friend of the president, Rafael Correa, and has long been part of Ecuador's political establishment. At the time he was an elected senator (MP), and president of the national assembly, and had helped rewrite Ecuador's constitution.
But Acosta admits now that finding so much oil in Block 31 terrified him. "It is one of the last places on earth which is truly undisturbed. It is simply a paradise," he says.
Acosta is one of the few people ever to have visited Yasuní but his dilemma was how to assess the full costs and benefits of drilling for oil there. On the one hand, the find presented the country with perhaps its last great chance to develop in the traditional 20th-century way, by building roads and industrialising. The money could be used for vitally needed housing, infrastructure, health and education.
On the other hand, the former oilman knew drilling for oil would push the oil frontier far deeper into the Amazon, release 400m tonnes of climate-changing CO2 and make the total destruction of a vast and pristine area inevitable.
"To extract oil on that scale from Yasuní," says Acosta, "would lead to contamination, deforestation, extinction of cultures and destruction of social structures. It would need a vast infrastructure including roads, river ports, tracks, airstrips. Villages would have to be constructed, pipelines laid and millions of tonnes of contaminated waste buried."
In addition, Acosta also knew that the oil industry inevitably attracts corruption, violence and social problems when it works in poor countries such as Ecuador.
"As with everywhere else in the world, the oil company roads will attract settlers in search of land and work, leading to more forest destruction. You only need to see the crime, pollution and poverty in Ecuador's other oilfields to know that to extract the oil [there] would mean the extinction of a paradise," he says. Acosta and his team, backed by scientists and non government groups, considered the options. "Oil is very important in a country like Ecuador. We have extracted 4.5bn barrels so far, which has given us around $130bn. We are at the top of the curve. We have consumed half and we have half our oil left.
"But the reality is that oil has not brought development. It has brought us immense contamination and environmental destruction. Since the 1950s the impact on people has been dramatic. Pollution and deforestation bring problems everywhere the oil is. Oil has not solved the problems of Ecuador.
"I knew the oil industry. I could see the monster from the inside. I began to think perhaps we were poor because of our resources. I called it the curse of abundance. I thought we must have a less extractive economy. We want oil to be used to benefit the country, to transform living conditions."
Acosta and the ministry prepared two plans: plan A was a revolutionary scheme to leave the oil in the ground in perpetuity in return for half of its value from the rich countries of the world; plan B was for business as usual. For the first time in history, a nation would seriously consider accepting a binding agreement not to extract fossil fuels.
"We said that Ecuador should approach the world with a deal. We will leave the oil in the ground and save the forest and the people if you, the world, make a financial contribution. If countries and individuals put up just half the "value" of the 960m barrels of oil – around $3.6bn – in Yasuní then Ecuador would guarantee to leave it there," he says. The money earned from the world would then go to protecting Yasuní and Ecuador's other national parks and towards education and hospitals.
Acosta's thinking was in fact a shrewd response to the economic phenomenon called "oil curse". Experience shows that developing countries who strike oil invariably stay poor. Rather than bringing wealth to many, it enriches a few, fosters corruption, encourages dictatorships and distorts the economies of nearly every poor country it has been found in. The story has been repeated from Nigeria to Sudan, Equatorial Guinea to Gabon and Angola to Venezuela.
Plan A was received with scepticism in government circles, says Acosta. "But I debated it with the president, showed him the benefits, told him he would be seen as a global statesman."
But crucially, it was backed strongly by powerful indigenous groups in the country, as well as the many social movements and the public. President Correa went along with it but at the same time has been enthusiastic about the oil.
Acosta left the government in 2009 and is now a professor at the University of Quito and an open supporter of leaving the oil underground. "One day the president said yes, the next no. I received attacks, people I know lied to defend the interests of the oil companies, and tried to weaken my position."
But polls showed that 90% of the Ecuadorian people backed Plan A and it was endorsed by government.Last year the UN development programme declared Plan A to be a safe environmental investment, and agreed to administer the fund. If a downpayment of $100m is made by December, the forest and the indigenous groups will be left alone. If the money is not found, then a Chinese company is expected to move in within months and the destruction of Yasuní will begin.
So far, Chile and Peru have each donated symbolic amounts, Spain has given €1m and Italy has waived €35m in debt relief. Around $40m has been raised, and the Yasuní fund is backed by celebrities, statesman and Nobel prize winners, including Desmond Tutu, Mikhail Gorbachev, Leonardo DiCaprio, Rigoberta Menchú and Muhammad Yunus.
The options for a life in Ecuador without oil from Yasuní are immense, says Acosta. "The money from the world can be used to protect Ecuador's other national parks, including the Galápagos islands. We have massive renewable energy potential but we use only a fraction of it. We should not export oil but energy. We need a massive reforestation programme. We should be investing in science and teachers.
"We cannot bring mass tourism [to Yasuní] but we can have scientific research. It would be an opportunity for the pharmaceutical industry. What about making it a sanctuary for humanity and nature? It would be extraordinary.
"We must understand that oil is unsustainable. We should be an intelligent country and see it in the long term. Climate change is a limit and we can't continue to burn oil. Perhaps we must change our model of life. What we have learned is that while we cannot live without nature, it can live without us."