LONDON (MarketWatch) — Central banks are not exactly short of things to worry about right now.

The euro may well be on the road to a chaotic collapse, taking some of the world’s biggest banks with it. A currency war may break out between Japan, the U.S. and Europe. Printing money has run out of steam, but there is still little sign of the global economy returning to the kind of growth rates it saw before the credit crunch.

But in the long term what they should perhaps be most worried about is losing their monopoly on issuing money. A new breed of virtual currencies are starting to emerge — and some of the giants of the web industry such as Amazon.com Inc. AMZN, -2.47% are edging into the market.

Gresham’s law famously stated that bad money would drive out the good. In the 21st century, it is now possible the law might be turned on it head. Good money might drive out the bad. If so, that matters to investors — for the simple reason that investing in the right currency makes a lot more difference to the kind of returns you can expect than what you actually put your money into.

But Gresham’s law applied to the age when it was formulated — Tudor England, where money consisted of the physical metal in the coins. If someone started minting coins with less gold or silver in them, they inevitably squeezed out the coins that had been properly made. But today’s world, dominated by paper currencies controlled by central banks, operates very differently. The money we use has no intrinsic value — so bad money could be driven out by the good.

We are starting to see a flurry of new currencies.

Amazon Coins: a virtual currency for Kindle Fire. Amazon

This month, Amazon launched its own coins — a virtual currency that can be used to buy stuff for your Kindle tablet. It is a very tentative move to start with: more like loyalty points on a reward card than actual cash. But every river needs to start with a spring — and with the web’s mightiest retailer behind it the coins could grow into something significant.

If so, Amazon coins will be far from alone. The virtual web currency BitCoin has already attracted a huge amount of publicity — and is steadily gaining in both circulation and value. After a crash last year — regrettably virtual currencies are just as prone to booms and busts as the real sort — it has steadied at around $25 and has gained acceptance.

There are virtual currencies swapped on games such as Second Life and Farmville that may one day escape into the real world. At the time of the launch of the iPhone 5, there was speculation that Apple AAPL, -2.95% would include a banking function, and perhaps even a currency — an iCoin would, of course, be much the same as everyone else’s money except twice as expensive and really cool to look at.

We might be reaching the point where virtual currencies start to pose a real challenge to the existing ones: the dollar DXY, +0.14% , euro EURUSD, -0.36% , yen USDJPY, -0.11% and pound GBPUSD, -0.10% . Indeed, at the end of last year, the ECB put out a paper warning about the competition from these new currencies. Although still small, the paper suggested they might undermine the credibility of national currencies.

It is not hard to see why central bankers are worried. Right now, virtual currencies are tiny. Hardly anyone is taking them seriously. And yet people are increasingly losing faith with traditional currencies. They are losing value steadily to inflation. And quantitative easing and currency wars mean they are constantly being debased. They are open to alternatives.

Plenty of investors have been turning to gold. Russia and China are building up their reserves, and so are many private individuals. But gold has always had its own problems as a currency. After all, if it was perfect the world would not have stopped using it as a currency. It has irregular supply. And it is as prone to crashes and collapses as any other monetary unit.

There is little doubt there is a demand for virtual currencies. They are, of course, completely untested. But with so much of the world’s business now conducted online there is little reason why currencies shouldn’t be minted online as well.

For investors, this matters. As a general rule, investing in the right currency matters far more than what stocks or bonds you choose. If you’d invested in Swiss francs USDCHF, +0.38% in the 1970s, for example, you’d have done very well over the next four decades, regardless of whether the stocks you picked were any good or not. Likewise if you’d invested in gold US:GCJ3 — a quasi-currency — during the 1990s you’d have done better than most other investments.

Right now, what the virtual currencies need is a major company to make them universally acceptable. Amazon may be the one, or it may be an iCoin from Apple, or G-Dollars from Google GOOG, -1.33% , or some new company we haven’t heard of yet. But the potential is surely there. If a virtual currency can be just as good as a medium of exchange, and a better store of value, it will start to gain traction, taking its place alongside traditional currencies. And perhaps even replacing them.

Of course, governments and central banks will try to stop it. They won’t give up their monopoly over money without a struggle. A virtual currency will never be legal tender. But the online universe is very hard to regulate. Governments haven’t managed to stop spam, or pornography, or terror chat rooms, or any of the other online activities they don’t like. There is little reason to imagine they can prevent virtual currencies circulating either.

And if you invest in one of the new currencies, it will certainly do better than any of the traditional ones. As they emerge, they are almost certainly worth a minor hedge — and who knows, perhaps even a major one.