There have been several Bitcoin exchanges robbed/hacked for all their Bitcoins over the past year.
One of the most recent being Flexcoin, and this is how they describe what happened.
The attacker then successfully exploited a flaw in the code which allows transfers between flexcoin users. By sending thousands of simultaneous requests, the attacker was able to "move" coins from one user account to another until the sending account was overdrawn, before balances were updated.
My question is, how do we make using a hot wallet safe? Users need to be able to withdraw their funds from their accounts, but allowing them to do this opens you up for targeted attacks.
I was wondering if anyone could share some insight on ways to protect against these types of attacks?
I had thought of a few solutions but I noticed they have flaws in them.
1) Bob deposits coins into their deposit address and then Bob can only withdraw from the same address via the site. The problem is that Bitcoin Daemon only allows sendfrom to and not sendfrom to meaning that in order to do this you would need to create your own raw transactions.
Now normally this wouldn't be a problem, but when users fund their accounts using SharedCoin, it creates so many inputs that the size of the transaction is huge and thus requires more fees. Am I correct on this? I may be wrong. It's also quite hard to be accurate on your account balances due to SharedCoin with so many inputs and outputs. Even Blockchain.info's account balances are sometimes incorrect due to SharedCoin.
2) When moving coins from Bob to Alice because Alice deposited fiat currency and wants to withdraw coins to their account, funds need to be moved to another address, possibly either a central address or Alice's withdraw address. If Alice sends simultaneous requests like someone did against Flexcoin, this could cause a problem. So again, you would need to use raw transactions so that funds can ONLY be sent from ONE address that preferrably only has enough funds to satisfy the withdraw request and no more in case of an attack.
Anyways, I think you all get the picture and I hope we can discuss some safe ways of doing this type of hot wallet approach?