Understanding the Security of Cryptocurrency Transactions