An illustration photo of Bitcoin (virtual currency) coins that are seen at La Maison du Bitcoin in Paris Thomson Reuters By Jemima Kelly

LONDON (Reuters) - Bitcoin surged by as much as 7 percent on Tuesday and was on track for its longest winning streak in 18 months, as concerns that Greece could tumble out of the euro drove speculators and Greek depositors into the decentralized digital currency.

Prime Minister Alexis Tsipras lashed out at Greece's creditors on Tuesday as he defied a string of warnings that Europe is preparing for a "Grexit". The debt-stricken country faces 1.6 billion euros ($1.8 billion) in repayments to the International Monetary Fund by the end of June.

Bitcoin, a web-based "cryptocurrency" invented six years ago, is not backed by or controlled by any government or central bank and floats freely, fluctuating according to user demand.

Though bitcoin's value has previously been highly volatile, it has stabilized over the past six months and is increasingly treated as a legitimate and potentially valuable asset by major financial institutions, and even by governments such as Britain's.

Joshua Scigala, co-founder of Vaultoro.com, a firm that holds bitcoin for its customers and allows them to exchange it for gold and vice versa, said that Greeks were buying the currency as their trust in the authorities waned. It is also unclear what currency would be used if a Grexit does occur -- another potential factor driving Greek demand for bitcoin.

"Some people aren't waiting for the government to figure out an exit plan and are doing it for themselves," said Scigala.

"You have people worrying about their families' wealth or their life savings, and worrying that their money might be locked up in banks ... They'd rather hold money in a private asset like gold or bitcoin."

Scigala said over the past two months, with Greece locked in talks with its creditors, the company had seen a 124 percent pick-up in inflows from Greek IP addresses - numerical labels that identify computers and other internet-enabled devices.

Bitcoin traded as high as $252.05 on the Bitstamp exchange on Tuesday, its strongest in over two months, before easing a little to $245.21, still up around 4 percent on the day. That marked its sixth straight session of gains -- its best run since January 2014.

In March-April 2013 bitcoin's value shot up by almost 700 percent in just over a month, as Cyprus clamped down on withdrawals and seized deposits, rattling faith in fiat currencies.

Paul Gordon, founder of bitcoin firm Quantave and a board member of the UK Digital Currency Association, said that although he did not share the view that worries about Cyprus had driven that rally, Grexit fears could be driving the current one, with more people now aware of bitcoin.

"This time round, the worries about Greece could be filtering through. (Bitcoin) could provide an alternative outlet for some people who are concerned about capital controls, along with more traditional methods."

Some have suggested that a bitcoin-like digital currency, backed either by Greece's assets or future tax revenues, could be introduced as an parallel currency to the euro in Greece in order to avert an exit from Europe.($1 = 0.8881 Euros)

(Reporting By Jemima Kelly; editing by Ralph Boulton)