Russia and Ukraine are due Friday to sign an elusive agreement designed to resume grain shipments across the Black Sea for the first time since the Kremlin's invasion in February.
Here is what we know about the deal:
Joint command and control
A joint command and control centre will be set up in Istanbul to oversee smooth operations and resolve disputes.
Its participants will include the two warring sides and officials from Turkey and the United Nations.
UN officials believe that the centre will take three to four weeks to be set up. This means that grain might not start flowing at full speed again until the second half of August.
Its location in Istanbul is both a nod to Turkey's central location and President Recep Tayyip Erdogan's key role in resolving a dispute which has often seemed to be intractable.
Ship inspections remained one of the most complex and politically charged parts of the agreement.
Mines have been laid in areas around Ukraine's main Black Sea ports with the aim of averting a feared Russian amphibious assault.
Ukraine also did not want Russia to board its vessels to check for the possible delivery of weapons when the ships returned to port.
UN officials said the four sides agreed that ship inspections -- demanded by Russia -- would be too difficult to conduct in the open seas.
The four parties would instead oversee them at one of the Turkish ports on their way back to Ukraine -- most likely in Istanbul.
It is still not clear precisely who will be allowed to board the Ukrainian ships.
Officials say it was quickly decided that de-mining the area would take too long to relieve the threat of starvation spreading to some of the poorest parts of the world.
UN officials say the deal ensures that Ukrainians pilot their own ships along safe routes -- dubbed "corridors" -- that avoid known mine fields.
Ukrainian vessels will lead the grain ships into and out of Ukrainian territorial waters.
Both sides also pledged not to attack ships on the way in or out.
This point has also been contentious: Ukraine has warned that it does not trust Russian promises because these have been broken repeatedly throughout the war.
Any attacks or disputes at sea would go to the joint command and control centre in Istanbul for review.
The agreement threatened to unravel when Russian President Vladimir Putin announced this week that he also expected his own country's grain to be covered by the deal.
Russia has been beset by waves of sanctions on its shipping companies, as well as on agricultural products such as fertilizer.
The US Treasury last week issued a clarification, saying that Russian fertilizer and "agricultural commodities" were not subject to trade restrictions.
The European Union on Wednesday also made an exception for Russian wheat and fertilizer.
The UN and Russia are due to sign a separate memorandum of understanding in Istanbul guaranteeing that grain and fertilizer cannot be directly or indirectly affected by sanctions.
The deal is due to be signed at 1330 GMT at Istanbul's lavish Dolmabahce Palace in the presence of Turkish President Recep Tayyip Erdogan and UN Secretary General Antonio Guterres.
The warring sides are expected to be represented by Russian Defence Minister Sergei Shoigu and Ukraine's Oleksandr Kubrakov.
The agreement is valid for 120 days and may be automatically renewed without the need for more negotiations.
It covers Ukraine's Black Sea ports in Odessa and two neighboring locations.
Officials believe 120 days should be enough to clear a backlog of up to 25 million tonnes of wheat and other grain now stuck in Ukrainian ports.
© 2022 AFP