Faced with an uneven world recovery and uncertain outlook, finance leaders were hoping on Friday to flesh out a plan to build a global economy less prone to the booms and busts of recent decades.

Forging consensus among central bankers and ministers from the Group of 20 advanced and developing economies won't be easy amid the current array of threats to stability, including high oil prices and debt levels, and unrest across the Middle East.

But with officials eager to avoid a recurrence of the 2007-2009 crisis and the worst global recession since World War Two, Canadian Finance Minister Jim Flaherty said addressing imbalances between export-rich and debt-burdened countries that have long plagued the global economy was a top G20 priority.

Many economists say these imbalances contributed to the crisis, as emerging market countries reinvested their surpluses in Western markets and caused excessive risk-taking by banks.

The G20 accounts for 85 percent of world output and is now the main forum for trying to reform the world's financial system. But it has become hard to agree on just how to do that now that the darkest days of the financial crisis have passed.

An uncertain outlook complicates things further. Signs of recovery in some rich countries have led their central banks to raise interest rates. But high oil and food prices threaten to slow growth and worsen unrest in some developing countries.

Then, there's the euro zone's sovereign debt crisis, political infighting over the massive U.S. deficit and the damage from last month's earthquake, tsunami and nuclear crisis in Japan, the world's third-largest economy.

Officials on Friday were likely to push for a deal on how to apply guidelines to identify countries with excess trade deficits or surpluses.

It is a matter of credibility for the G20 that we agree on the indicative guidelines this weekend, said Olli Rehn, the European Union's economic and monetary affairs commissioner.

The International Monetary Fund, which holds its twice-yearly meetings this weekend, warned officials not to grow complacent about the recovery's prospects.

The apex of the crisis is behind us, but it would be part of the complacency I am trying to avoid to believe we are in a post-crisis era, IMF chief Dominique Strauss-Kahn said.

The G20 wasn't expected on Friday to name specific countries that spend or save too much, but if it did, the United States and China would almost certainly top the list.

It would probably include others. French Finance Minister Christine Lagarde said Thursday the biggest economies -- those representing 5 percent of total G20 output -- might get special scrutiny. That would also include France, Germany and Japan.

Beyond that the G20 hopes to discuss how to apply guidelines. That might be done through computer modeling, with sources telling Reuters four different models for identifying imbalances were being discussed.

Canada's Flaherty expected ministers to reach agreement, but added: there are still some bumps along the road.

China has expressed suspicion that the effort may be aimed at pressuring it to reduce its hefty trade surpluses.

At a February meeting in Paris, G20 ministers agreed on a list of indicators for monitoring imbalances, including public debt, private savings and borrowing. But China balked at any mention of the real effective exchange rate or foreign currency reserves.

China's foreign exchange reserves -- a stockpile that reflects Beijing's exporting prowess -- soared to a record of more than $3 trillion by the end of March, a sum certain to raise eyebrows in Washington.

Reducing deficits is also crucial, and the IMF this week said the United States may have a hard time of meeting a G20 goal of halving its deficit by 2013.

President Barack Obama presented a plan this week to cut the deficit by $4 trillion over 10 years, but his former economic adviser said the country should wait until after growth is strong enough to warrant higher interest rates.

If the United States were to slash its deficit next year, the consequences for real economic activity would be most unfortunate, said ex-White House economic adviser Lawrence Summers said Thursday.

(Reporting by Reuters IMF/G20 team; Writing by Steven C. Johnson; editing by Leslie Adler)