Image copyright AFP Image caption Mr Kerry brokered a deal between the two candidates, Abdullah Abdullah (C) and Ashraf Ghani (R)

Just hours before the official start of an audit of eight million votes in Afghanistan, negotiations were under way with the electoral authorities to pin down the ground rules.

All the votes cast in last month's presidential runoff are due to be scrutinised under an agreement brokered by US Secretary of State John Kerry at the weekend.

Afghans heaved a collective sigh of relief when the deal was announced, because it appeared to offer a reprieve just when many feared the country risked slipping back into chaos and violence after both candidates, Ashraf Ghani and Abdullah Abdullah, disputed the results.

But there are still some hurdles to be overcome.

A final "checklist" setting out what constitutes a "suspect vote" still needs to be agreed upon with the electoral authorities.

"They're still trying to draft it now as we speak," one insider told the BBC on condition of anonymity, as dusk approached on Wednesday evening.

Mistrust

Nato's International Assistance Force (Isaf) troops are preparing the mammoth logistical challenge of supporting the election authorities by bringing most of the 23,000 ballot boxes from the provinces to the Independent Election Commission (IEC) headquarters in Kabul.

Yet the procedure for disqualifying votes, or giving them the all clear, was still being thrashed out behind closed doors on Wednesday night.

The situation betrays a continued sense of mistrust in the IEC by the competing camps, despite promises of international standards and oversight of the audit by UN technical teams.

The expectation is that it will take about four weeks to complete the audit.

How rival candidates compare Ashraf Ghani Abdullah Abdullah Technocrat and former World Bank official. Open to talks with Taliban Former anti-Soviet resistance member. Wary of Taliban talks Leading in Pashtun-dominated southern provinces Ahead in mainly Tajik northern areas Backed by Rashid Dostum, an Uzbek ex-warlord accused of human rights abuses Supported by wealthy Balkh governor Atta Mohammad, a bitter Dostum rival Has support of Qayyum Karzai, brother of President Karzai Also has backing of Mohamed Mohaqiq, powerful leader of ethnic Hazaras Ahmed Zia Masood, whose brother was a famous resistance hero, helped balance ticket Gul Agha Sherzai, an influential Pashtun, helped bring ethnic balance to ticket

The first ballot boxes from Kabul are ready to be checked, in what is expected to be a rolling process of scrutinising each vote in the presence of international observers and agents from the two rival political camps.

A team of 100 election officials will work in pairs to assess each vote, on the basis of a 16-point "checklist" which the BBC has sought to obtain.

Broadly this will assess the physical characteristics of the ballot boxes, the bar codes and seals to check it has not been tampered with.

The contents will be viewed, ballot papers checked for markings and the total numbers counted in each box.

Image copyright AFP Image caption All eight million votes will have to be recounted

Although both sides are broadly happy with the process, there are still sticking points over how the IEC interprets international standards.

Daud Sultanzoy from Mr Ghani's side has expressed concern about "discriminating practices" which may target certain areas, such as those in which there were large discrepancies between the first- and second-round presidential race.

On Mr Abdullah's side, insiders are pushing for entire ballot boxes containing more than one-third of votes considered to be fraudulent to be disqualified altogether.

Mr Sultanzoy argues that this amounts to potentially "disenfranchising" many voters.

It may appear that the technical detail of this process is being picked over in excruciatingly painful detail, but it is a measure of the distrust behind what one Abdullah loyalist described as "an environment of political cordiality".

Sharing power?

The next step will be thrashing out how a government of national unity is to be achieved.

Both sides in the Kerry-negotiated deal agreed to come up with a formula for "winners" and "losers" - themselves controversial terms here - to share power together. But there already appear to be differences in interpretation.

It is still early days but the Ghani camp has talked of a long-term ambition to eventually have a "loya jirga" or grand council to consider a constitutional change.

It would allow for a prime minister to be appointed by the president and not parliament.

The Abdullah camp feel such discussions are premature. Their immediate concerns are more focused on how cabinet portfolios and other key posts will be divided.

Meanwhile commentators have expressed concerns about the absence of an opposition within a unity government.

Despite much relief that the fighting talk appears to be over, it could be a interesting few weeks ahead.