TO HEAR President Hassan Rohani in full charm offensive one would think that, barring a few trivial details, a deal to settle long-running concerns about Iran’s nuclear programme by the agreed deadline of November 24th is very nearly in the bag. “I think a final settlement can be achieved...the world is tired and wants it to end, resolved through negotiations,” he declared on Iranian television earlier this month; a nuclear settlement was “certain”.

The Americans are trying to rein in expectations. Wendy Sherman, who leads the American delegation at the so-called P5+1 talks with Iran (the five permanent members of the UN Security Council and Germany), noted last week that Iran had met its commitments under the interim agreement reached last year, known as the Joint Plan of Action. The discussions since July, when an extension was announced, were going better than some had expected, but not as well as might have been hoped. The problem remained Iran’s uranium-enrichment capacity: “Iran’s leaders would very much hope that the world would conclude that the status quo—at least on this pivotal subject—should be acceptable, but obviously, it is not”.

The Iranians want to tap into what they think is a yearning in the West, after years of stalemate, to seize the opportunity for an agreement; a sentiment made all the more intense by the regional chaos and the rise of jihadists from Islamic State as a common enemy. If Iran were cut some slack on enrichment, suggests Mr Rohani, it could be more co-operative on other issues. More subtly, he implies that without some concessions by the West, hardliners at home will scupper any possibility of a deal; the supreme leader, Ayatollah Ali Khamenei, is known to be sceptical.

Profound differences between the two sides have been apparent for months. They concern four main issues: Iran’s uranium-enrichment capacity (which determines how soon Iran could achieve “breakout” by producing enough fissile material for a bomb); clarity over the evidence of Iran’s past work on nuclear warheads; how soon sanctions would be lifted; and how long Iran would be subjected to nuclear constraints before earning the right to be treated as a “normal” signatory of the Non-Proliferation Treaty.

On enrichment, the division is over what Iran’s “practical needs” really are. The West thinks the nuclear-fuel requirements for Iran’s two research reactors (the Tehran Research Reactor and the controversial Arak heavy-water reactor) can be met with fewer than 2,000 first-generation centrifuges. This would be much less than the 10,200 machines now running and the 9,000 built but not yet installed. As for the nuclear power station at Bushehr, the West says a contract with Russia to supply fuel could be extended after it expires in 2021.

Iran says it will not dismantle any of its existing centrifuges and must be able to build them up to a level sufficient to fuel Bushehr—a tenfold increase in its current installed capacity. In July Mr Khamenei said that Iran would in due course need at least 190,000 “separative work units”, a technical term indicating more than 200,000 of the current IR-1 centrifuges.

The West wants any agreement to last for up to 20 years, with sanctions only coming off in stages. Iran expects the majority of sanctions to be suspended almost immediately and for constraints to bind it for no more than five years. As for the evidence of previous work on “weaponisation”, the Iranians assert (implausibly) that there is nothing to reveal.

Huge though the gap appears, there are compromise proposals that might work if there was greater mutual trust. One, devised by the Washington-based Arms Control Association and the International Crisis Group, a conflict-resolution outfit, would entail a three-phase process. First, during an initial three-year period, about half of Iran’s installed enrichment capacity would be mothballed, pushing back the breakout period from the current two or three months to between nine and twelve months.

Over the next two phases, running up to 2031, Iran would be allowed to build up its capacity roughly back to current levels, while nuclear inspectors satisfied themselves that the programme was entirely peaceful. Tehran would continue research on new centrifuges in preparation for industrial-scale production, and would receive guarantees of fuel for Bushehr.

Such a deal would only be possible for the West if backed up by a highly intrusive inspection regime. But it would be far from humiliating for Iran, while making it a lot harder and riskier than it is now for the country to attempt to breakout (or “sneakout” through a clandestine facility).

The much likelier alternative to a comprehensive deal this month is not a collapse of diplomacy, carrying the risk of escalatory sanctions and accelerated centrifuge production, but another extension of talks. There could even be a new interim agreement, locking in some gains, such as conversion of the Arak reactor to a design producing less plutonium, in exchange for further minor sanctions relief. It is not in anyone’s interests to walk away from the table just yet.