News that the world's top foreign exchange broker has been testing its trading system against a possible euro collapse conjures a host of images and ideas for currency traders and investors, not all of them bad.

If one or more country ditches the euro, the revival of old currencies would mean more opportunity for profit in the $4 trillion-a-day FX market, traders say.

Yet establishing new exchange rates, sorting out how to settle trades and getting a handle on counterparty risk are enough to unnerve even the most intrepid of investors. The cost to nations of leaving the euro zone would be felt in reduced purchasing power that comes with a suddenly weak currency.

Banks with large foreign exchange dealing operations, including Barclays <bcs.n> and Citigroup <c.n>, declined comment on whether they had tested their trading systems.

But a trader at a global investment bank told Reuters that conversation is taking place. It (euro zone breakup) is not something we think is going to happen, but as a contingency, it's just prudent to look at all the options.

Markets got a reminder about the prospect of a smaller euro zone on Monday after ICAP <iap.l>, the biggest forex broker, confirmed it had tested its EBS currency platform to ensure it could handle a Greek euro exit and a revival of its old currency, the drachma.

No doubt it would be messy, said Jens Nordvig, global head of G10 currency strategy at Nomura Securities. It could be very hard for the system to manage.

Europe's worsening debt crisis has markets on edge. Last week, poor bond auctions in Spain, Germany and Italy, which paid a euro-era high to finance short-term debt, suggested to some that markets were losing confidence in the entire euro project, which began in 1999.

According to a Barclays survey conducted in November, nearly 50 percent of respondents expect at least one country to leave the 17-member euro zone in 2012.

MORE PROFITS, MORE UNCERTAINTY

On the bright side, quoting a revived drachma or Italian lira on an electronic trading platform would be the easy part, one currency trader at a North American bank said.

What's more, giving traders a new host of currencies to trade would be hugely profitable, he said.

One interesting thing, though, is if you are going to trade drachmas or (Portuguese) escudos or whatever, where are you going to settle? he said. Which bank do you trust? It would be awkward. Who would the market maker be? I don't know.

Complicating things further is the fear that European banks may face major losses on euro zone sovereign debt holdings, making traders less likely to use those banks to settle trades.

One way to get around this, some traders said, would be to trade off-shore via a non-deliverable forward contract, much the way markets trade Brazil's real and China's yuan trade.

Per Rasmussen, a retired currency trader who began his career in the 1970s, said things could get even messier if Germany decided to exit the euro and revive the Deutschemark. Demand for the new mark relative to the rump euro could be so great, he said, that the Bundesbank might be unable to print them or credit accounts fast enough.

I could see the markets not trading for several weeks, he said. It could paralyze things.

KEEPING IT TOGETHER

These potential complications may be enough to spur European leaders to do what it takes to keep the euro zone together.

I have seen estimates that suggest that the cost to a peripheral country like Greece of exiting the euro zone on a unilateral basis would be more than 40 percent of GDP, said Frances Hudson, who helps manage $250 billion at Standard Life Investments in Edinburgh. And for Germany at the other extreme it's still around 30 percent - quite a disincentive.

She said analysis of how markets would handle a breakup is being done, but this alone may be enough to discourage any further moves in that direction.

Ron Leven, an executive director at Morgan Stanley in New York, said he expects the euro zone to survive intact, with the European Central Bank likely having to give in and guarantee sovereign debt or European banks.

This will require the ECB to increase significantly its balance sheet and money supply, so it's still negative for the euro, Leven said.

(Reporting by Steven C. Johnson, Nick Olivari, Wanfeng Zhou and Julie Haviv in New York and Luke Jeffs and Nia Williams in London; editing by Kenneth Barry)