MILLIONS OF EDUCATED and prosperous Iranians resent being isolated from the rest of the world. Until sanctions started to emasculate trade, life had been gradually improving. Now many people have lost their jobs or seen their pay and savings eroded by inflation. The government, too, is having a difficult time. Oil revenues have dwindled and allies around the region are wobbling. Is relief in sight?

After nine months of nuclear talks in Geneva, the broad outlines of a possible deal with the West are becoming clear. The aim is to ensure that Iran would need about a year to build a bomb, giving the West plenty of advance warning. To achieve that, the two sides are talking about limiting Iran’s enrichment of uranium to 5% for the next decade or so, and putting the plutonium programme at Arak to irreversibly civilian use. All this would be monitored closely by international inspectors, but without forcing Iran to acknowledge past weapons tests in any detail. In return, Iran could expect a rolling (though reversible) lifting of sanctions over several years.

According to one Western official involved in the negotiations, “technical issues are not the main problem.” The tough part is convincing the respective elites back home to accept the deal that is on the table. The real negotiations arguably take place in Tehran and Washington, not Geneva. A majority of American congressmen seem reluctant to approve anything negotiated by the White House, even if their own generals say it is in America’s national interest. Mr Rohani, for his part, faces pushback from conservatives, even though a deal promises to relieve economic and regional pressures.

Opposition is driven by each side’s suspicion of the other. Some of that may be justified. Iran has repeatedly lied about and cheated over its nuclear programme. Equally, many of the Washington-based architects of the sanctions would like to see regime change in Tehran. Both sides have covertly and overtly harmed each other in recent years, compounding distrust.

However, mutual suspicion is also driven by pride, ignorance, historical grievances and partisan self-interest. American suggestions in the past that the Islamic Republic might be close to collapse still rankle in Tehran. One academic close to the revolutionary guards says testily, “America keeps thinking we are about to sink, that we’ll implode. I say, just come to terms with reality. We have figured out a stable path.”

Iranians complain that America is being hypocritical, supporting autocratic Saudi Arabia while denouncing more democratic Iran. Americans retort that the Saudis have not tried to kill or kidnap them, and point out that Iran has its own double standards, supporting the crushing of a revolution in Syria that is similar to its own in 1979. Iranian students at Tehran University are particularly aggrieved by what they see as American hypocrisy in foreign military missions, asking why Americans supplied weapons to rebels in Soviet-occupied Afghanistan in the 1980s. The students quote from a Hollywood film on the subject, “Charlie Wilson’s War”, in which American officials intone, “Let’s go kill some Russians.” So why, they ask, were Americans so offended when Iran used similar tactics against them in Iraq?

Historical grievances lurk everywhere. Three decades ago America shot down a civilian Iranian airliner, and Iran helped to bomb America’s embassy in Beirut. Hardliners on both sides are still looking for revenge. In April Mr Rohani tried to appoint his deputy chief of staff, Hamid Aboutalebi, as head of Iran’s UN mission in New York. But the ambassador was denied a visa after an outcry in Congress because he had played a minor part in the hostage crisis in 1979. America thus deprived itself of the chance to have a trusted interlocutor on its doorstep.

Many Iranian leaders have built political careers on bashing America. To a lesser degree the same in reverse is true for some congressmen with close links to Israel. Accommodation now would cause a loss of face, maybe even of factional support.

Yet overall, the greatest obstacle to reaching a deal is ignorance rather than self-interest. Iran’s supreme leader believes that the American government, not just its hardliners, wants to see him toppled. He misread the Ukrainian revolt earlier this year as an American plot.

Enigma variations

No diplomat from either Iran or America has been posted in the other’s capital for 35 years, though some Iranians have served at the UN in New York. In a documentary called “The Fog of War”, Robert McNamara, who served as America’s defence secretary in the 1960s, said that America escaped disaster in the Cuban missile crisis because its officials knew their adversaries in Moscow and could work out what sort of deal they might accept. On the other hand, America came to grief in Vietnam because it knew nothing and nobody in Hanoi. A central premise of the war—America’s fear that North Vietnam might form a communist alliance with China—ignored the fact that the two regimes hated each other.

In the absence of knowledge, people will err on the side of caution. A politically active member of the Khomeini family forcefully makes this point:

When I visit a new city I figure out two or three main roads and use them to go anywhere—even if it takes longer—because I fear getting lost. Eventually I will try new, shorter routes. But as soon as I’m no longer sure where I am I revert to the thoroughfares. Regime hardliners act much the same. Occasionally they try new, conciliatory routes, but as soon as they feel insecure they revert to familiar antagonism. They know they won’t get lost that way, even if it means travelling the long way round. You have to remember that most of them have spent very little time in the West and feel intimidated by it. Just listen to all the talk of past humiliations. They regard it as a hostile environment they don’t understand. It fits into the wider historical experience of the Shia as a minority sect. We have long been the victims, or at least defined ourselves as such, dressing in black. The most successful strategy in our past has been to hunker down, wait and distrust rather than act.

Seen in this light, the nuclear negotiators have taken courageous steps. To get the talks going, America conceded that in principle Iran could enrich nuclear fuel for civilian use. In return, Iran froze its programme for the duration of the talks. Both sides appear committed to reaching a deal. They recognise that this is a rare moment. For the first time since 1979 the governments in Tehran and Washington both want to improve relations at the same time. Previously, one or the other was always on the warpath.

Many observers believe that a deal will either be done in the next few months or not at all. Both presidents have a narrow window to sell it at home. Mr Obama is likely to face an even more hostile Congress from next January and will soon become a lame duck. Mr Rohani is struggling to hold off hardliners and cannot afford to use all his political capital on this venture. If the November 24th deadline is missed by much, the naysayers on both sides will claim that no deal can be had, making a future agreement even harder.

Others think it is possible or even likely that the two sides will formally extend the talks. They see little sign of Iranian hardliners accepting the sort of deal that is available. Yet neither they nor the Americans want to see the talks fail conclusively. Negotiations may yet drag on into next year.

The prizes to be had

If the negotiators do succeed, it will be because the potential benefits would be substantial, especially for Iran. In its foreign relations, it could breathe easier and come a step closer to fulfilling its ambition of leading other nations in the region. The partial withdrawal of American troops from the Gulf would be a strategic victory. The economy would be likely to pick up. Foreign investors are ready to return to Iran. Many have visited in recent months in anticipation of an opening. Rolling back sanctions would take a long time, and difficult economic reforms will still be needed. But there would be some quick results. Car production could soon double, and so might oil exports.

The potential benefits of a deal would be substantial, especially for Iran

The impact on Iranian domestic politics is harder to gauge. Mr Rohani could expect a boost from the lifting of sanctions and improve his longer-term chances of succeeding Mr Khamenei as supreme leader. However, if he is seen as garnering too much acclaim too quickly, hardliners may decide to take him down a peg, say, by blocking economic reforms or boosting sponsorship of foreign extremists. People close to Mr Rohani suggest that he has a longer-term plan to use the momentum he would gain from lifting sanctions into reshaping the political system. The next step would be to win more seats in parliament. But how much more sway he could gain is uncertain. Hardliners retain control of many levers of power. The totems of their ideology, from denouncing Israel to insisting on the veil for women, are unlikely to disappear. Progress will be slow.

If no nuclear deal is signed, the domestic pendulum is likely to swing in the opposite direction. Conservatives will reassert themselves. They have already talked of running a “resistance economy”, meaning one less reliant on trade. Hostility towards the West would increase. State media would resume their mantra that America is only interested in destroying Iran.

The likely American response would be to impose more sanctions. In the absence of a deal, Congress will conclude that Iran is not serious about finding a solution and tighten its grip still further. The question is whether other countries will go along with it. China may no longer be willing to curtail trade with Iran. Russia is already in talks about a $20 billion barter deal. Some of Iran’s old trading partners in Europe could peel away too, especially if they feel that America is to blame for the failure of the talks. Even so, as long as American banking sanctions remain in place, trade will continue to suffer.

And if Iran still refuses to budge? Pressure to bomb its nuclear installations would increase, but until hope of a deal has completely evaporated America seems unlikely to attack Iran when it is also fighting Islamic militants in Iraq and Syria, protecting Europe from Russia and guarding Asian allies against an increasingly aggressive China. By comparison, doing a deal with Iran may seem easy.