BRUSSELS/VIENNA When world powers start talks with Iran next week on a final agreement on their nuclear dispute, the main question for the West will be how to ensure Tehran gives up enough atomic activity to ensure it cannot build a bomb any time soon.
If successful, the negotiations could put to rest a decade of hostility between the West and the Islamic Republic, and head off the danger of a new war in the Middle East.
Ingrained mistrust and a vast gap in expectations between the two sides may still doom the search for a deal: U.S. President Barack Obama has put the chance of success at no more than 50 percent. Some say that is optimistic.
But both sides say the political will is there to reach what would amount to a historic compromise with potentially far-reaching geopolitical and economic consequences.
Iran holds some of the world's largest oil and gas reserves and with nearly 80 million people represents a largely untapped market with vast potential for foreign businesses.
Western governments appear to have given up on the idea, enshrined in a series of United Nations Security Council resolutions since 2006, that Iran should suspend the most controversial aspect of its program - enrichment of uranium.
Diplomats privately acknowledge that Iran's nuclear work, which Western states fear may be aimed at developing the capability to assemble bombs, is now too far advanced for Tehran to agree to dismantle it completely.
But while Iran may be allowed to keep a limited enrichment capacity, the West will seek guarantees that mean any attempt to build a nuclear bomb would take long enough for it to be detected and stopped, possibly with military action.
Iran says its nuclear program is entirely peaceful.
"The key question for us is what kind of breakout time we can accept," said a diplomat on one of the six powers' negotiating teams, speaking on condition of anonymity.
Extending that "breakout time", experts and diplomats say, means Iran would have to restrict enriching uranium to a low fissile concentration, stop a large number of its centrifuges now used for such work, limit nuclear research, and submit to highly intrusive monitoring by U.N. inspectors.
Ahead of the February 18 start of the talks in Vienna, a defiant President Hassan Rouhani pledged that peaceful atomic research would be pursued "forever".
Tehran wants an end to the sanctions that have battered its economy, mainly U.S. and European Union bans on its oil sales. Western states are wary of giving up this leverage too soon.
"They are going to start this negotiation very far apart and it's hard to speculate on what the end state's going to be," Robert Einhorn, a former top U.S. State Department official on Iran, said last month.
"But to be acceptable to the United States, Iran for a substantial amount of time ... is going to have to live with a very limited enrichment capacity."
The talks coordinated by European Union foreign policy chief Catherine Ashton aim to build on a deal last November under which Iran agreed to halt some of its most sensitive work for six months, in return for modest sanctions relief.
That accord, made possible with last year's election of Rouhani on a platform to ease Iran's international isolation, was designed to give the sides confidence that a broad agreement is possible. It left the biggest challenges for later.
In the new diplomatic phase, which has to finish in July or the six-month interim accord may have to renegotiated, both sides must satisfy hardliners at home.
In a foretaste of difficulties ahead, Iranian Foreign Minister Mohammad Javad Zarif clashed with U.S. negotiator Wendy Sherman this month over the future of Iran's planned Arak heavy water reactor and the Fordow underground enrichment site.
Western states worry Arak, likely to be at the heart of the talks, could yield plutonium for a bomb. Sherman suggested Iran had no need for it or for Fordow. Zarif called her comments "worthless" and said atomic technology was non-negotiable.
Israel, which views a nuclear-armed Iran as an existential threat, will push the six negotiating powers - the United States, Russia, China, France, Britain and Germany - to demand that Iran gives up Arak as well as its enrichment plants.
Iran says it is Israel, with its assumed atomic arsenal, that threatens regional peace and security.
Negotiators say one possible way forward on Arak could be to modify it so that it can still produce medical isotopes, Iran's stated goal, without using heavy water which provides a potential route for obtaining weapons-grade plutonium.
Another major issue will be the number of centrifuges - machines that spin at supersonic speed to refine uranium - that Iran is allowed to keep. Enriched uranium can have both civilian and military uses.
Jofi Joseph, former director for non-proliferation on the White House National Security Council staff, said Iran will likely demand it can keep 10,000 machines in operation. It has nearly the same number installed but not running.
But nuclear experts say Iran must sharply reduce its centrifuges in order to extend the time for producing enough weapons-grade fissile material for a bomb. Iran says it only refines uranium for a planned network of nuclear power plants.
"The number and type of centrifuges will be limited to ensure that breakout times are ... a minimum of six to twelve months at all times," the Institute for Science and International Security (ISIS), a U.S.-based think-tank, said.
"In the case of a six-month breakout time, Iran should have in total no more than 4,000 IR-1 centrifuges," it said, referring to the old-generation equipment Iran has. It is also testing more modern machines, another bone of contention.
The two sides want the final-phase talks to last no more than half a year, and be finished by the time the interim deal expires on July 20. Many experts believe that is unrealistic.
(Additional reporting by Louis Charbonneau at the United Nations and Arshad Mohammed in Washington; Editing by Giles Elgood)