Cryptocurrency enthusiasts chant the mantra 'not your keys, not your coin' with a near-religious fervour.

The idea is that if you're storing your cryptocurrency wallet on an exchange – or any platform where you cede control over your valuable private keys – then you're at risk of losing your coin to bad actors.

Cold cryptocurrency wallets aren't directly connected to the internet and are a great way to keep your bitcoin safe from would-be thieves as you watch the asset's value ebb and flow.

Unless, of course, you forget your password.

That's the tragic story of Stefan Thomas, a programmer who has just two more chances to guess the password of his encrypted IronKey hard drive before it permanently locks away his 7,002 bitcoin.

At today's Bitcoin price, that hard drive is worth over $340 million.

If only he could remember the password.

Speaking to the New York Times, Thomas – who was formerly a CTO at blockchain company Ripple Labs – said he was initially determined to get back his cryptographically-locked fortune as the price started to hike in recent years.

“I would just lay in bed and think about it,” he said.

“Then I would go to the computer with some new strategy, and it wouldn’t work, and I would be desperate again.”

The 7,002 bitcoins was given to Thomas in 2011 as payment for a video he made about the early cryptocurrency.

As an early adopter, he did keep track of passwords for other bitcoin he owned and has made considerable wealth from the currency's ballooning price, according to the Times.

Now he stores the IronKey drive in an undisclosed secure facility in the hopes that one day he can retrieve it.

“I got to a point where I said to myself, ‘Let it be in the past, just for your own mental health,’” Thomas said.

Of course, Thomas isn't the only person to be without literal fortunes thanks to poor bitcoin storage.

James Howells had mined over 7,500 bitcoin on his laptop back when mining didn't require hundreds of connected GPUs.

Unfortunately, the drive he kept his wallet on was tossed out one day and he has unsuccessfully petitioned his local council to dig up the landfill in search of his missing riches.

Bitcoin was designed to be scarce with the open source protocol only allowing for just under 21 million coins to be circulated.

At the moment about 18.6 million bitcoins have been created but blockchain firm Chainanalysis estimates between 2.3 and 3.7 million bitcoin are lost.