A U.S. stand seen as increasingly friendly to Iran, expressed publicly and in private consultations here, has heartened Iranian diplomats and raised their hopes of ending the Persian Gulf war through the U.N. Security Council.

But the diplomats quickly add that, back home in Tehran, they face an accumulation of mistrust and antipathy toward the United States and the West that will make their efforts to sell even a U.N.-sponsored bargain extremely difficult.

For that reason, the increased interest in U.N. proceedings manifested here by delegation chief Ali Shams Ardekani and his deputies in the last week does not necessarily reflect similar interest among all the competing centers of power in Tehran, diplomats caution.

The delegation's attitude, nevertheless, is viewed as particularly significant against the background of growing hopes within the Carter administration that Tehran will decide soon to release the American hostages to end its isolation and open the way for U.N. help in reversing its losses in the month-old conflict with Iraq.

A "positive" step from the Security Council -- particularly if the United States helps bring it about -- would go a long way toward convincing Islamic hard-liners in Tehran that Iran can benefit from participation in U.N. deliberations and that release of the hostages is a good idea, an Iranian diplomat here explained.

Although hard information on Iranian decision-making is sketchy, some diplomats here say Ardekani and his delegation represent mostly the relatively conciliatory attitude of President Abol Hassan Bani Sadr. As a result, they cannot speak with authority for Prime Minister Mohammed Ali Rajai and, even less, for the hard-line clergy and ultimately Ayatollah Ruhollah Khomeini, whose influence would be decisive in accepting a Security Council proposal or deal for release of the hostages, these sources suggest.

According to one analysis, Rajai's appearance here a week ago despite his radical Islamic politics could actually have been the result of hard-liners' efforts to prevent Bani-Sadr from directing the reentry into the U.N. forum, for fear that under him it would go too far. t

The U.S. mission to the United Nations under Ambassador Donald McHenry has taken these imponderables into account in its contacts aimed at fostering a cease-fire resolution acceptable to Iran and Iraq, diplomats say. But in the political atmosphere of Washington and in the press with its need to simplify, the distinctions sometimes blur, they add.

Iranian diplomats here, however, are painfully aware of their limited mandate. "This is our business; we understand, because we are diplomats," said one. "But you know, in Tehran, there has been such mistrust for the last 18 months . . ."

Even so, the administration's warnings against dismemberment of Iran and its support of a cease-fire coupled with calls for Iraqi withdrawal from Iranian territory have largely paralleled Iranian positions, drawing approval from the Iranian diplomats and improving their case against the doubters in Tehran.

"Well, yes. He called the [Iraqi] invasion an invasion," Ardekani replied to a question whether he approved of McHenry's speech Thursday night before the Security Council.

"The national integrity of Iran is threatened by the Iraqi invasion," McHenry said in the speech.

"Things seem to be moving," one of his deputies commented later with a smile.

Contacts under way to draw up a Security Council resolution acceptable to Iran and Iraq are going on mostly behind the scenes, with the public council meetings alongside the private contacts to dramatize concern and define the stands of the 15 council members.

Diplomats hold out little hope that anything can be resolved in the next few days, however. The countries involved -- chiefly Bangladesh, Norway and Pakistan, with the United States in the background for the time being -- are being especially cautious to prevent repetition of the Sept. 28 cease-fire appeal that was ignored because Iran had boycotted the proceedings.

To avoid another embarrassment, Iran and Iraq are to be involved as the resolution takes shape in coming days in an attempt to guarantee their acceptance before it is voted on, diplomats said. In addition, extra time is required because of parallel and in some ways competitive mediation efforts by the Islamic Conference and the nonaligned group.

Finally, the possibility of a hostage release so overshadows the proceedings that some delay is inevitable as the diplomats here watch what Tehran decides. t

In any case, contacts so far remain limited to poorly defined ideas that would constitute the backbone of an eventual resolution, according to diplomats involved in the talks. These revolve around a phased withdrawal coupled with an internationally supervised cease-fire and negoiations over territorial disputes, including sovereignty over the Shatt-al-Arab waterway, they said.

Another element, the only Iraqi position backed by the United States, probably will be an appeal for noninterference by Iraq and Iran in each other's internal affairs. This would be in response to Iraqi charges that Khomeini's Islamic revolution is sponsoring dissent by Shiite Moslems in Iraq and other Sunni-dominated countries along the Persian Gulf.

Underlining Iraqi insistence on this, Iraqi chief delegate Ismet Kattani said: "I think it is not useful to separate elements of a solution and consider them individually. All outstanding issues must be considered comprehensively. All the elements of a solution must be considered as a package."

His comment also reflected Iraqi demands that the U.N. resolution not be limited to halting the fighting and organizing a troop withdrawal without also addressing Iraq's demand for sovereignty over the entire Shatt-al-Arab, the only Iraqi outlet to the sea and a vital route for its oil exports into the gulf.