It is still far too early to tell if the compromises will survive the next and final negotiating round, or review in Washington and Tehran. The timing of sanctions relief remains unresolved, for example, and already the two sides are describing it in different terms.

But the events of the last two years, and particularly the past week, offer some fascinating insights into what happens when two countries that have barely spoken with each other for 35 years — and have a long and troubled history of mistrust, sabotage, lies and violence — all but move into the same hotel room to try to figure out how they are going to get along.

It is fairly certain there will be a lot more wrangling in the next three months as the negotiators seek to wrap up a final, comprehensive treaty. That is because the negotiators left the Beau Rivage Hotel with astoundingly high bills — suites run more than $1,500 a night — but not an agreed-upon document detailing Iran’s commitments and those of the United States and its negotiating partners.

Wherever Wendy Sherman, the lead American negotiator, traveled in the ornate hotel here, she was trailed by a whiteboard, where the Iranians and the Americans marked down their understandings, sometimes in both English and Persian.

The board served a major diplomatic purpose, letting both sides consider proposals without putting anything on paper. That allowed the Iranians to talk without sending a document back to Tehran for review, where hard-liners could chip away at it, according to several American officials interviewed for this article, who all spoke on the condition of anonymity to discuss internal deliberations.

“It was a brilliantly low-tech solution,” one White House official said. (It also had its drawbacks. One American wrote on it with a regular marker, then had to scrub hard to wipe out some classified numbers.)

Image John Kerry and his counterpart, Mohammad Javad Zarif. Credit... Laurent Gillieron/European Pressphoto Agency

And it was far removed from the first year of Mr. Obama’s presidency when, one of his top aides recalled a few years ago, there were more Situation Room meetings on Iran than any other topic. By the end of his first year in office, the president had come to some big conclusions.