Surrogate Database Key, Not Bitcoin Protocol Flaw, To Blame For Mt Gox Problems
An anonymous reader writes "Bitcoin values dropped sharply over the weekend after the largest trading exchange, MtGox, revealed that an investigation into unusual trading activity turned up a flaw in the underlying Bitcoin software that allowed an attacker to double withdrawal a transaction"
Not so fast according to database experts: the real problem is that Mt Gox (and other exchanges) are using a surrogate transaction id rather than a natural key in their databases: "The flaw isn't so much in Bitcoin as it is in exchange-systems. Many exchanges use the tx-id to uniquely identify transactions, but as it turns out, an attacker can change the tx-id without changing the actual transaction, rebroadcast the changed transaction (effectively creating a double-spend) and if his altered transaction gets accepted into a block instead of the legit transaction, the attacker receives his coins and can complain with the exchange that he didn't. The exchange will then check their db, fetch the tx-id from it, look it up in the blockchain and not find it. So they could conclude that the transaction indeed failed and credit the account with the coins. ... A simple workaround is to not use the tx-id to identify transactions on the exchange side, but the (amount, address, timestamp) instead."
So a site with strong experience in trading Magic cards wasn't quite ready to handle the combined rigors of cryptography and finance?
The world is just full of surprises....
Many pro bitcoin will hate me for saying that, but the transaction ID should not be change and once published it's value should be considered safe to check if a transaction is part of the blockchain or not. All the crap related to 3rd party modifying Sign script is pretty idiot compare the power for having a single ID to track a transaction. That said, this give no excuse for Mt Gox to not release the funds, the problem is not new, not even to them, and probably hide a much bigger financial problem.
Bitcoin with other people's money and not mine!
I'd have a real hard time buying into, or putting any investment into a currency that could run into these types of problems - or even potentially vaporize overnight - due to some intricate techical problem that I didn't understand - and maybe STILL wouldn't even long after it was explained to me ...
The reason behind it doesn't matter anywhere near as much as that it happened and is high profile. It is like being arrested for a sex crime, especially child molestation. Even if one is proven innocent beyond a shadow of a doubt, one's life will be changed beyond recovery. Every time someone searches one's name online, that arrest will pop up and inject doubt.
As the events happen, they eat away at the credibility of not just the individual people and companies involved but also BitCoin. It shows how easy it is to steal them, how sites thought safe are not.
There is no "-1 offended" or "-1 you don't agree with me" mod options for a reason.
Funny how the currency is only as good as the institutions supporting it. (In this case the exchanges)
Lets not kid around. Bitcoin was created with the intention of getting around existing laws and regulations regarding currency. The philosophy behind this idea suggests that these things are unnecessary and represent others stealing your money.
Not saying the banks and money regulations are completely without flaws, but they do have some damn good reasons for being there.
When they go back up tomorrow I can make a weeks worth of money in 1 day :-)
http://saveie6.com/
it doesn't matter why this or that happened in case of Bitcoins, faith based money, the faith being that it will go up in price and that there always be somebody there, buying these off of you when you need it.
mtgox doesn't accept Bitcoins or money transfers, if people can't get other currencies for Bitcoins easily, they just may turn to alternative ways of 'cashing in' their BTCs, I am talking about buying actual products with them on a much higher scale, which will prompt the sellers of the products to flood BTC exchanges to get their preferred currencies (because almost no seller actually keeps BTCs). This will put more downward pressure on the market, more exchanges may shut down not and for technical reasons at all. Meanwhile there are all these people that bought BTCs at a much higher price, there are still millions of those who hold BTCs that they got for almost free. Once BTCs fall below 200, many will rush in to sell, who otherwise wouldn't have.
You can't handle the truth.
A bitcoin transaction comprises 3 parts:
Transaction data - Source, destination, amount and timestamp
An ECDSA signature signed with the private key of the source
A transaction ID.
The transaction ID is generated as the cryptographic hash of the transaction data and signature.
The problem comes with how ECDSA signatures are formatted. A signature is essentially a large integer of undefined length. Industry standards are that the signature should be written with no zero padding - i.e. the first byte should be non-zero. In practice, many software implementations would define a fixed length field and zero-pad signature.
The signature would still be valid even if zero padded. However, the transaction ID which is a hash of the transaction data and signature would change.
Early versions of the bitcoin daemon would accept padded signatures, but this bug was fixed a couple of years ago, and transactions submitted to the network with excessive signature padding would be rejected as invalid.
Mt Gox used in-house bitcoin client software which for a long time continued to pad their transaction signatures, even after the bitcoin developers issued an alert to users, resulting in failed or delayed (if the first node to receive the transaction broadcast was running on old daemon which would accept the transaction, the transaction would be validated and accepted; therefore a semi-invalid transaction may succeed after a number of retries) withdrawal transactions.
Finally, the thing that really screwed things up was that 3rd parties (possibly early adopters with large amounts of bitcoin at Mt Gox) recognised the bug, and provided a workaround for Gox's broken software. Their software acted as transaction relay nodes, and when it received a broken transaction from Gox would rewrite the signature in the correct form, and compute a new transaction ID, before re-broadcasting the transaction.
The result was that Gox's withdrawral problems disappeared for a number of months - until Gox's client went out of sync with the bitcoin network, as it was trying to spend coins that had previously been spent by transactions that it thought had failed.
Captcha: bugged
... it raised up again with the same speed, if not more. Less that 24h after the FUD announcement by MtGox, Bitcoin value is already recovered and rising. See: http://bitcoinwisdom.com/markets/bitstamp/btcusd
Then please don't read how the dollar works. You won't be able to sleep at night.
I can't believe whoever wrote the original code didn't catch this. It seems pretty database 101 class to me. Even the non-programmers had to take that class at my college and it always taught that you don't base a primary key in a table (or use as a unique ID in code) a value which isn't necessarily unique or can change. It's almost the same thing as not using as the primary data table key a compound key of last name, first name, and middle initial. First of all, it can change. Secondly, it can be repeated. That's basics, people. This isn't too far from that.
It's built into the protocol, and always will be. Everyone who uses Bitcoin needs to be aware of this limitation!
Bitcoins are the collectable of the moment - it's like the comic book bubble. Sure, really old comics (like 1940's) remain valuable as artistic artifacts (issues that only exist in single or double digits in known quantity in the world), but you can pretty much get any comic from 1990 on for cover price at this point with very few exceptions, and even 60's/70's stuff for $20-30 now that all used to go for $100's in the 90's during the boom.
Once the "thrill of the chase" is over, and people start to realize that they have nothing of value to show for it, they still can't spend their Bitcoins on Amazon, or any brick and mortar environment, it all evaporates. Worse, in this case, is that with all of the issues and flaws in the system - it can happen much more quickly, as this weekend showed.
It's human nature to want something for nothing (or very little) - people are playing the Bitcoin lottery right now, and they'd be better off buying scratch tickets. Sure, folks are making a few bucks here and there, and a select few are probably making a lot of money on folks just trying to get in on it, but like any bubble, it doesn't last forever. In five years we'll be looking back at this and laughing that anyone paid $700 (or whatever it gets up to before the jig is up) for a virtual coin that can't really be spent anywhere significant, and is just people buying/selling to each other. Kudos to those who are taking advantage of this and making what they can while they can - but most folks would be better off buying virtual items in Everquest or WOW because then they actually get to use the items to enjoy in the game, because 100 Bitcoins can't even buy you a cup of coffee in 99.99999999...% of the world.
I'd say (address, timestamp). 'amount' adds nothing to the key.
"because 100 Bitcoins can't even buy you a cup of coffee in 99.99999999...% of the world."
Sir, for 100 BTC I will deliver you personally a yearly supply of coffey, anywhere in the world (including active war zones etc)
You are either personally hugely in debt, or everyone round about you is hugely in debt, and even if neither of these are the case, the banks have kindly loaded up the government with debt on your behalf and you and your children have to pay it off...
At the point of a gun.
Reality == you are a debt serf.
Better use a fucking high resolution timestamp.
(The number of times I've seen systems fall over because some idiot thought two things can't happen in the same second/millisecond/microsecond....)
Watch this Heartland Institute video
Shazbot! We ran into some trouble getting the comments.
Try again... na-nu, na-nu!
Fuck Beta!
Really? Simple workaround? Using a unique ID is the only real option, and the problem has more to do with the ability of the "attacker" to change the transaction ID. If I write someone a check and the check numbers don't match my records then I know I have to examine the records. How do these Banking Anarchists think our mishmash of Bank databases with a Central Bank work?
/sarcasm
Oh that's how "Real" banking works. We can't be seen doing something that "Real" banks have to do. We're against the man, and bank databases are the man.
3rd Largest Bitcoin exchange, Bitstamp has now suspended withdrawals as well.